Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using mapinfo 10 and I have created dll with Pelles C with 16*16 and 24*24 bmp images. I placed the dll file into folder containing .mbx file but I get error :

Unableable to locate external icon resource.

Am I missing something.

Code:

Create ButtonPad "mybuttonpad"  As
        ToggleButton
        ID 1001
        Icon 8001 File "icon.dll"
          Calling vendor_ButtonAction
          HelpMsg "ICONTEST"
Show
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Two things to try:

1. Add the full path to your icon.dll. I normally create a constant aóutside the main procedure and refer to this for all my buttons:

Define FILE_ICONS_DLL  ApplicationDirectory$() & "Icons.dll"

Sub Main
   Create ButtonPad "mybuttonpad"  As
        ToggleButton
        ID 1001
        Icon 8001 File FILE_ICONS_DLL
          Calling vendor_ButtonAction
          HelpMsg "ICONTEST"

2. If that doesn't fix it, try to use lower numbers for you icons, for instance 1 (and 2). Also I assume that you added the small icons as no 8001 and the larger as no 8002. Right?

share|improve this answer
1  
thanks for help but it now says could not convert data what might be the problem –  kinkajou Aug 26 '11 at 8:46
    
convert the data? Can you be a bit more precise on the error message –  Peter Horsbøll Møller Aug 26 '11 at 9:26
    
When I add the code for DLL file it generates error "Cannot convert data" That's all.Is it problem with dll creating I have smaller icon with lower number. –  kinkajou Aug 26 '11 at 9:51
    
Could you try with a different dll to see if it is the dll that is the problem. You can find some here: gispro.dk/php/download.php?rep=11&fil=DLLicons.zip –  Peter Horsbøll Møller Aug 26 '11 at 10:11
1  
Actually a "+" in place of "&" in Define FILE_ICONS_DLL ApplicationDirectory$() & "Icons.dll" solved problem. –  kinkajou Aug 26 '11 at 10:13
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.