Listers,
I agree with much of Chris's analysis except I would say that the emphasis
is wrong. In my opinion the problem is not that applications built with
VB5/6 expose their functionality to other applications as COM objects, but
rather the fact that MapBasic is not COM compliant. The Component Object
Model (COM) is central to the Microsoft Windows environment and there
probably isn't much of a future for development environments which don't
support it. Nowadays, most do - for example any development environment in
which you can incorporate a MapX map is COM compliant. MapX exposes its
functionality as a COM component - if it didn't it wouldn't have got off the
ground.
Richard Burkmar
ICL
-----Original Message-----
From: Chris Martin [mailto:[EMAIL PROTECTED]]
Sent: 07 February 2000 14:08
To: MapInfo-L; Bill Thoen
Subject: Re: MI Can MapBasic call routines in ActiveX DLLs?
I've been asking around about this; I would like to be able to share
some VB code (access to Win32API, common functions, etc.) with
MapBasic. Currently, I cut and paste the code, then make the
necessary syntax modifications... Not too much of an ordeal, but
could it be better?
The answer so far seems to be a resounding NO!
If you haven't already done so, non-VB/MB people can switch off
now...
The new VB5/6 DLLs are ActiveX DLLs or COM Servers. It doesn't really
matter what all this means apart from the fact you can't access the
functions inside from other languages. There are ways around, but
they start at complex, then get a bit worse (in my view).
You can apparently write some sort of interface in C++ or
alternatively re-write completely in C++. And there are one or two
3rd-party tools that help; I've been told that Desaware's SpyWorks
will give you some kind of export capability that will do the biz.
But unless some new information comes in, I shall stick to cutting
and pasting....
Some words from one of my sources:
"Use of VB DLL's is made through COM who takes charge of making "visible"
the appropriate classes.
In normal DLL's an Export Table is generated where all public
function names and their parameters are written. Any program can then
import that library (that's what you do when you DECLARE an api
function) and use its functions.
Unfortunately, as VB DLL's are COM servers, the only functions that they
export are to register and un register the server. There's no other
functionality you can access."
> A while ago Chris Martin's summary on how to get custom icons
> into MapInfo interested me enough to wonder what else you can do
> with this technique. Basically --and this works great-- you can
> create a custom ActiveX DLL that will allow you to use all sorts of
> home-made icons like so:
>
> 1) Create a new ActiveX DLL project
> 2) Open resource editor, and add your custom bitmap pairs
> 3) Save resource file in Project
> 4) Save and compile project
> 5) Distribute...
> 6) When selecting icon, specify pathname of DLL
> eg. ICON 1002 FILE "MyIcons.DLL"
> 7) Sit back and impress friends and colleagues, with smiley faces
> and
> Bunny Wabbits.....
> (You need at least VB 6 or you won't have the Resource Editor.)
>
> But my question now is, can you make ActiveX DLLs that can
> contain functions and subprograms that can be called from MapInfo
> like you can with the earlier style DLLs? If so, does anyone have a
> small example? I know VB can't do the old style DLLs, but it's VB
> that I have now, so it would be neat to be able to use to make new
> style DLLs, if they could be made to work with MapBasic. Can this be
> done?
>
> - Bill Thoen
> --------------------------------------------------------------------
> - To unsubscribe from this list, send e-mail to [EMAIL PROTECTED]
> and put "unsubscribe MAPINFO-L" in the message body, or contact
> [EMAIL PROTECTED]
CJ Martin
GIS Consultant
WS Atkins Consultants Ltd
(01952) 201234
----------------------------------------------------------------------
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]