While it i is true that DDE is considered old fashioned and is definitely
out of favor it is not going away until Windows goes away.  .NET has no
support for .DDE but then one might claim it does not need any.  Two
applications (whether written in .NET language or not) can communicate
together if they both support DDE. You just won't get any help from .NET.

However, this may have little to do with the original question which is how
to make a MapBasic application talk to a .NET application. We have not done
this here so I offer the rest as just my (and not MapInfo's) ideas.

Let's start with some facts.

   To talk to a .NET application you need to be running in the .NET
   environment.  Note that .NET executable assembly can be called just like
   a DLL assembly. The only thing special about an .EXE is that it might
   have a program start entry point. The .NET loader searches for
   assemblies regardless of the extension. So, if you were using
   "MyFavoriteAssembly", .NET first looks for a DLL of that name and then
   tries for a .EXE.
   Running in the .NET environment can be done in a number of ways. The
   critical piece is that the common language runtime (CLR) is
   instantiated. This is done by starting a .NET executable and just
   calling it, calling a COM object which is a wrapper for a .NET object
   (the wrapper ensures the CLR is started) or calling the .NET code from
   native C/C++ code where the compiler handles the instantiating of the
   CLR and the calling and marshalling of values.

So, while I have not done this from MapBasic, I would be surprised if one
could not write a C DLL, call it from MapBasic and have that DLL either use
the COM or Managed C++ methods to invoke the .NET methods.  The C++ way
would probably be my choice.  Note that I am not sure if a call to a .NET
.EXE automatically creates a new Windows process. You might be(probably)
calling the .NET code within the calling process.

However, that is not exactly what is being asked here.  Mr. Healy, for some
unspecified reasons,  wanted to launch the executable (via MapBasic or
ShellExecute probably does not matter) and/or communicate with an already
running instance of that application. I don't know of any explicit support
for finding out if a .NET process is running. All the usual stuff should
work. That is, one can search the process list (like Task Manager or
Process viewer apps do) and search for something by name, or if the process
has a top level window, you can search for HWND handle with a specific
name.

Once you find out a process is running, communicating with that instance
probably requires use of the remoting APIs and requires that the .NET app
in question support remoting interfaces. I am sure this can be done but I
don't have any experience doing that. Certainly, there is no reason that
the .NET app could not have its own code or call  C or C++ code that
handled DDE as well.

Again, without knowing whether the need is to talk to .NET code or whether
the .NET application instance is what is really required.

I hope this helps.

Eric Blasenheim
Software Architect
MapInfo Corporation



Mail List:
       [EMAIL PROTECTED]
                                                                       
 From:      on 09/06/2004 12:21 PM ZE2                                 
                                                                       
 To:       <[EMAIL PROTECTED]>                         
                                                                       
 cc:                                                                   
                                                                       
 Subject:  Re: MI-L .NET and MapBasic                                  
                                                                       



DDE may be old fashioned, but it is perfectly suited for this kind of
communication.

Dumping it to me seems like dumping ordinary old-fashioned telephones just
because WCDMA/UMTS provides wireless video capabilities.

Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/
----- Original Message -----
From: "Peter Horsb�ll M�ller" <[EMAIL PROTECTED]>
To: "Lars V. Nielsen (GisPro)" <[EMAIL PROTECTED]>; "Rob Healy"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 06, 2004 12:06 PM
Subject: RE: MI-L .NET and MapBasic


Actually I think still exists in .NET, but as Bill Thoen once put it, it is
kind of "old" ;-)

Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT

COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark

Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk/gis

Har du husket MapInfo Konferencen d. 8 og 9. september 2004.
Tilmelding samt yderligere information kan ses p�: http://www.cowi.dk/GIS


-----Original Message-----
From: Lars V. Nielsen (GisPro) [mailto:[EMAIL PROTECTED]
Sent: Monday, September 06, 2004 11:55 AM
To: Rob Healy
Cc: [EMAIL PROTECTED]
Subject: Re: MI-L .NET and MapBasic


Hi Rob,

I've used pre-.Net exe's that way. I first used DDE from the MB app to try
and contact the EXE before starting a new instance. If a
contact was made, the EXE was running, and the MB app could transfer
parameters to it instead of issuing a Run Program.

But I suppose .Net excludes the use of DDE ?? ;-)

Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/
----- Original Message -----
From: "Rob Healy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 06, 2004 11:38 AM
Subject: MI-L .NET and MapBasic


> Dear List,
>
> We are venturing out into .NET and have hit a wall.
> We are trying to launch a .NET EXE from MapBasic and pass it some
> startup arguments - this part is easy. However if the EXE is already
> running, I would like to "jump/switch" to this and pass some different
> arguments, or even better, invoke a public method from the EXE.
> Essentially refresh the EXE with some new initialisation values. We do
> not want to Kill the EXE and then start a new instance of it.
>
> Has anyone had success with something similar.
>
> Look forward to your responses.
>
> Regards
> Rob Healy
> Meridian GIS Pty Ltd
>  MapInfo Partner & Reseller
>  Encom Partner - Discover Suite
>  Earth Resource Mapping Partner - Image Web Server
>  Safe Software Partner - FME
>
> Level 2, 1050 Hay Street
> West Perth 6005
> Western Australia
> Ph: 618 9226-0101
> Fax: 618 9226-0102
> email: [EMAIL PROTECTED]
> web: www.meridian-gis.com.au
>
>
>
> This transmission is confidential and intended solely for the person
> or organization to whom it is addressed. It may contain privileged and
> confidential information. If you are not the intended recipient, you
> should not copy, distribute or take any action in reliance on it. You
> are receiving this email because of your area of professional
> interest. If you have received this transmission in error or would
> like to be removed from our mailing list for company announcements
> please reply to this email with UNSUBSCRIBE in the subject field.
> Thank you.
>
>
>
>
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> Message number: 13222
>
>


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To
unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13223



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13225



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13229






---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13240

Reply via email to