Overview

Previous Top Next

Control shell of the program the GIS Panorama allows you to call the individual tasks implemented by the user, for work with digital maps.

There are two types of such tasks.

The first type are the tasks which are carried out in a streamed mode without interactive work of the operator (user) with the image of a digital map. For example: conversion, transformation, sorting, updating and other kinds of data processing.

The second type are the interactive tasks. For example: editing, solution of computation tasks, construction of reports, work with databases and so on.

Applications must be in the form of 32-bit DLL format modules for programs x32. MAPACCES.DLL library is applied for using the functions of access to digital maps.

For x64 software the application tasks should be in the form of 64-bit DLL format modules. MAPACCES64.DLL library is applied for using the functions of access to digital maps.

For a calling the tasks in modules two standard functions should be declared.

All tasks should have the function of the type:

extern "C"

{

long int _ export WINAPI GetInterfaceVersion()

{

 return MAPACCESSVERSION;

}

}

If the application is developed on Visual C ++, then instead of "_export" it is necessary to write down "__ declspec (dllexport)".

At an application's writing in Delphi the following statement can be used:

procedure GetInterfaceVersion; stdcall; export;

begin

...

end;

exports

GetInterfaceVersion;

This function is always called before starting the task for comparison of the version of library MAPACCESS used for writing the task, and the version of the library actually installed in the system. If the versions are different - the task will not be performed. In this case, you must recompile the application. Variable MAPACCESSVERSION is declared in the file mapapi.h.

In addition to this function, the task of the first type should have the function of the type: 

extern "C"

{

long int _export WINAPI CallMapFunction(HMAP hmap, TASKPARM * parm);

{

  ...

 }

}

The variable hmap of HMAP type contains a pointer onto a class of open data of the document of a map. TASKPARM structure is described in the MAPTYPE.H file.  

typedef struct TASKPARM        // PARAMETERS OF THE APPLICATION

{

long int        Language;        // Code of dialogs language (1 - ENGLISH, 2 - RUSSIAN, ...)

#if defined(_M_X64) || defined(BUILD_DLL64)

#ifdef WIN32API

longint        Zero;                // Pointers alignment

#endif

#endif

HINSTANCE        Resource;        // Module of application's resources

constchar*        HelpName;        // Full name of the help file ".chm"

constchar*        IniName;        // The full file name of ".ini" application

const char*        PathShell;        // The application's directory (exe,dll,...)

const char*        ApplicationName; // The application's name

#ifdef WIN32API

HWND        Handle;        // Identifier of the main application window

#else

MSGHANDLER        Handle;// ID of the commands handler of the main application window

#endif

}

TASKPARM;

 

Tasks of the second type can be developed with using EmbarcaderoC++BuilderXE* or Microsoft VisualC++ as they use the mechanism of classes export of language C ++. But during their execution the components developed by means of other programming languages can be used.

For developing user application tasks in the system of GIS Panorama working in interactive mode, it is necessary to use software interface PANAPI.

In addition to the function "GetInterfaceVersion()" the task of the second type must contain a function of the type:

extern "C"

{

HMAPTASK WINAPI __export CreatePanTask(HMAPDOC HMapDoc, TASKPARM * parm, const char * pathname)

  {

    TPanTask * task;

    try

       {

         task = new TUserTask(HMapDoc,parm,pathname);

       }

     catch(...)

       {

         task = 0;

       }

    if (task == 0) return 0;

    if (task->GetTaskIdent() == 0)

      {

       delete task;

       return 0;

      }

    return task->GetTaskIdent();

  }

 

TPanTask class is described in the file \pantask\pantask.h. TUserTask class should be derived from TPanTask class.

As the example of the second type's tasks the source codes of the task of a raster editing can be used (project SDK12\rswedit\rswedit.cbproj for assembly x32 and project SDK12\rswedit\rswedit64.cbproj for assembly x64) and print execution (project SDK12\Ready\MapPrint\mapprint.cbproj for assembly x32 and project SDK12\Ready\MapPrint\mapprint64.cbproj for assembly x64), included in the examples of application development in the GIS "Panorama" 12.