Prototype and description of the function convntvbin2gridimport() (Function of the unlock requiring group "NTv2 Tools") |
convntvbin2gridimport() Import an NTv2 grid from a binary source file into a binary target file. Prototype of the DLL function in C++ syntax (attend lower case!): extern "C" __declspec(dllimport) unsigned long __stdcall convntvbin2gridimport( const char *pszFileSource, const char *pszFileTarget, unsigned short nGridSource, unsigned short *nGridTarget, unsigned long lSaveTarget) { Prototype of the DLL function in Visual Objects syntax: _DLL function convntvbin2gridimport(; pszFileSource as psz,; // 4 Byte, char* pszFileTarget as psz,; // 4 Byte, char* nGridSource as word,; // 2 Byte nGridTarget ref word,; // 4 Byte lSaveTarget as logic); // 4 Byte as logic pascal:geodll32.convntvbin2gridimport // 4 Byte The function imports the NTv2 grid with the number nGridSource from a binary NTv2 source file into an existing NTv2 binary target file. The number of grids NUM_FILE is increased by 1 in the file header of the target file. The position of the grid within the target file is automatically determined according to the NTv2 rules. The grid to be imported is written with the grid header and the grid data at the automatically determined position. If necessary, the name of the grid SUB_NAME and the name of the parent grid PARENT are updated in the grid header. The number nGridSource of the grid to be imported can be determined with the function getBinGridHeader(). The position of the imported grid in the target file, which was automatically determined by the NTv2 rules, is returned In nGridTarget. If lSaveTarget is set, a backup file is created with the path and the name of the target file and the file extension "sav". If a file already exists with this file name, it will be overwritten without asking. The file names of the NTv2 source file and the existing NTv2 target file may contain a drive letter and a directory path. Example: Soruce file "c:\programm_ntv2\BeTA2007.gsb" Target file "c:\programm_ntv2\Germany.gsb" Attention, in C syntax double backslashes must be used! The parameters are passed and/or returned as follows: pszFileSource File name of the NTV2 binary file which is used as source for the NTv2 grid to be transferred to the target file. The file name may contain a drive letter, a directory path and a file name extension. The file name should have the file name extension ".gsb". pszFileTarget File name of the NTv2 binary file in which the NTv2 grid is to be imported. The file name may contain a drive letter, a directory path and a file name extension. The file name should have the file name extension ".gsb". nGridSource Number of the NTv2 grid to be transfered from the source file. nGridTarget Number of the imported NTv2 grid in the target file. (ref) lSaveTarget Flag for creating a backup file from the target file. TRUE A backup file with the path and name of the target file and the file extension "sav" is created. FALSE No backup file is created. returnVal In case of an error the function returns FALSE, otherwise TRUE. Unlocking: This function is a component of the unlock requiring function group "NTv2 tools". It is unlocked for unrestricted use together with the other functions of the group by passing the unlock parameters, acquired from the software distribution company, trough the function setunlockcode(). Without unlocking no calls for test purposes (shareware principle) are possible with this function. |