Global Mapper and Dongles
We use a SafeNet Sentinel dongle for our software licensing / protection. It doesn't appear to play nicely with the Global Mapper SDK.
(If I try to call any SDK functions, my app crashes somewhere in the Sentinel code).
Does anyone have any experience or tips that might help me out?
Cheers
(If I try to call any SDK functions, my app crashes somewhere in the Sentinel code).
Does anyone have any experience or tips that might help me out?
Cheers
Comments
-
That is strange, so a call to the Global Mapper SDK is causing a crash in the Sentinel code. Is it running in a different thread or something? Does any Global Mapper SDK cause this, including something like a simple GM_GetSDKVersion call? What development environment/language are you using?
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Hi Mike,
I'm using VS2010 (VC10). The only code I added, after the model of the SDK test program, were the get version / build date function calls. I figured that would be a good way to check I had the lib and DLL and licensing all in the right places.
If I include these calls, which cause GlobalMapperInterface.dll to be (pre) loaded, my application crashes before it even gets to InitInstance, I comment those calls out, the app starts as normal.
Profiling with Dependency Walker tells me that the 'GM version' loads some DLLs earlier in the startup, as GM dependencies, and relocates MSXML6r.DLL - but nothing that looks like it would be a problem.
Dan -
Dan,
Are the calls actually crashing or is it maybe that some of the required DLLs can't be found? What if instead of linking in the GlobalMapperInterface.lib you call LoadLibrary on GlobalMapperInterface.dll at run-time to explicitly load the DLL? Sometimes that gives better error messages. You need to make sure that you have copied over all of the DLLs in the 'bin' folder of the SDK (or bin64 for 64-bit). See the 'what_to_distribute.txt' file in the doc folder of the SDK for information on system libraries that are also required.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Mike,
I'll try the LoadLibrary route tomorrow and let yuo know what happens.
Dan -
Hi Mike,
I tried LoadLibrary and it works !
uint32 theSDKVer = GM_GetSDKVersion();
/*HMODULE hGM = LoadLibrary("GlobalMapperInterface.dll");
typedef uint32 (CALLBACK* LPFN_GM_GETSDKVERSION)();
LPFN_GM_GETSDKVERSION GetSDKVersion;
GetSDKVersion = (LPFN_GM_GETSDKVERSION)GetProcAddress(hGM, "GM_GetSDKVersion");
uint32 SDKVer;
SDKVer = GetSDKVersion();*/
If I include the first line at the end of my InitInstance, my app won't start. If I swap it for the commented section I get the right version number (138). I need a way to 'late load' the DLL without having to redefine the API with GetProcAddress!
Will investigate further...
Dan -
Immediate progress - the Sentinel thing is a red-herring. I turned on catching of all exceptions and it seems that the problem is loading colours from an XML palette file during start up. Presumably because loading the Global Mapper DLL causes the MSXML DLL to be relocated.
I'll see what I can do to work around this.
Cheers,
Dan -
Mike - I re-jigged to order of a bit of stuff, made some static initialisation explicit rather than implicit to the class construction and its working now.
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website