Visual Basic 6?

uncledelphiuncledelphi Global Mapper UserPosts: 5
edited October 2008 in SDK
Does the Global Mapper SDK work in Visual Basic 6? I am having trouble using the DLL. I have declared this function, for instance:

Private Declare Function GM_LoadLayer Lib "GlobalMapperInterface" _
( _
ByVal aFilename As String, _
ByRef aLayer As Integer, _
ByVal aLoadFlags As Integer _
) As Integer

But when trying to call this function, it gives a Run-time error '53': File not found: GlobalMapperInterface.

I have tried copying the contents of the bin directory into my project directory, and variations on GlobalMapperInterface, including adding .dll and/or the full path.

Any ideas?

Thanks much.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2008
    Yes, the SDK should work from VB6. From the error it does sound like for some reason the GlobalMapperInterface.dll file can't be loaded, either because it can't be found or some other DLL that it depends on can't be found. You might try downloading and installing the Global Mapper application on that machine if you haven't already to make sure that your system has all of the libraries that the SDK requires.

    Once you get it loading, I do see some potential problems with your declaration. If I'm not mistaken, the Integer type in VB6 corresponds to a 16-bit integer and not a 32-bit integer. I think there is some kind of Long type or something like that for 32-bit integers, which is what you need for the layer and load flags parameters and the return. I could be mistaken though.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • uncledelphiuncledelphi Global Mapper User Posts: 5
    edited October 2008
    I have the Global Mapper application installed, as well as the SDK. It works just fine in VB .NET, but VB 6 apps just can't seem to load that DLL. Any other ideas?

    And good catch about Integer vs. Long. I'm mostly a UNIX programmer, so I expect Integer to give me four bytes.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2008
    Hmmm, I'm not sure on this one then. Have you tried various locations for the DLLs, like the build folder and the project source folder? It seems like VB has some strange path expectations at some point. I know that there are users of the SDK with VB6, but it is not something that we have here. Perhaps someone else here has experience using the SDK with VB6?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.