Global Mapper v25.0

Global Mapper and Dongles

Kyudos
Kyudos Global Mapper UserTrusted User
edited January 2012 in SDK
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

Comments

  • global_mapper
    global_mapper Administrator
    edited January 2012
    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
  • Kyudos
    Kyudos Global Mapper User Trusted User
    edited January 2012
    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
  • global_mapper
    global_mapper Administrator
    edited January 2012
    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
  • Kyudos
    Kyudos Global Mapper User Trusted User
    edited January 2012
    Mike,

    I'll try the LoadLibrary route tomorrow and let yuo know what happens.

    Dan
  • Kyudos
    Kyudos Global Mapper User Trusted User
    edited January 2012
    Hi Mike,

    I tried LoadLibrary and it works :confused:!

    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
  • Kyudos
    Kyudos Global Mapper User Trusted User
    edited January 2012
    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
  • Kyudos
    Kyudos Global Mapper User Trusted User
    edited January 2012
    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.