Kenn,

        It took me a while to get this working when I did it 2 years ago, so
I hope what I tell you is correct. I just opened my C++ project and here's
what I have. 
        First, If I remember right you need to create a Windows 32 dll -
empty project. Then create a resource script file. Insert your Bitmaps by
right clicking on the resource folder, then insert, then select bitmap and
click import. Make sure to copy the bitmaps into the project folder before
you do an insert. Or you can create your own bitmaps by drawing them with
C++ by selecting New instead. The bitmaps have to be 16 color and either 18
width by 16 height and 26 width by 24 height. See page 246 of the MapBasic
User's guide for reasons why you have to have two and other specs. Also,
make sure their resource id value is sequential. Start the smaller bmp as
100, then the larger as 101 then the next icon set as 102 and 103. If you
need to change the values append a '=<integer>' to the name like
DRAW_LINE=100.
        Then go under Project-settings. LINK . In the Project Options box at
the bottom of the window type /NOENTRY at the end of the list. Make sure
there is a space between the last option. Then rebuild all and you should
have your DLL.

        Now for the Mapbasic code, I think your error is in the Icon value.
If you didn't create 2 Icons, this is where it'll fail, or if you picked a
value not in the file. The Icon value in MB source has to be the smaller
value. You could put the DLL anywhere, but Mapinfo will find it if it's in
the Mapinfo program directory without adding a path to the statement. I like
to leave the dll with the mbx if its only for that app, but I have about 30
icons in my dll for several apps, so I have to tell my employees using it to
move it to their MI directory.
        Here is an example call " ICON 102 file applicationdirectory$() +
"testicons.dll"
If it doesn't work. Let me know and I'll send you a sample to help.

Thanks,
Dion Duran
GIS Systems Analyst
Metricom, Inc.
[EMAIL PROTECTED]

                -----Original Message-----
                From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
                Sent:   Monday, June 19, 2000 2:36 PM
                To:     [EMAIL PROTECTED]
                Subject:        MI Accessing DLL

                I require some guidance with respect to accessing resources
inside a
                .dll. I am trying to make custom icons. I know my MapBasic
code is
                correct since I am able to create new button icons accessing
other
                dll's. My problem must be in the compiling of my .dll..  I
am using
                Visual C++. What parameters or procedures are required to
compile a dll
                that MapBasic can access. My error message is unable to load
external
                Icon resource. There is something I must be overlooking.
Thanks for
                everything gang!

                Cheers Kenn

        
----------------------------------------------------------------------
                To unsubscribe from this list, send e-mail to
[EMAIL PROTECTED] and put
                "unsubscribe MAPINFO-L" in the message body, or contact
[EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to