Hi both,

Kaul:
You can't use an ActiveX DLL from MapBasic, so that idea won't work. Only
plain DLLs are usable, which puts VB out of the question. You'll need C++
or Delphi to build your DLL.

David:
Yes, you can call individual MapBasic subroutines in Integrated Mapping,
but not as easily as you describe it. First of all, your example asks
MapInfo itself to call a subroutine inside an unnamed MapBasic program,
which off course doesn't work. And then you can only call the
RemoteMsgHandler subroutine, by use of the Do method on the MBX (!) object:

Set miObj = ...
Set mbxObj = miObj.MBApplications("FooHolder.mbx")
mbxObj.Do "text parameter to RemoteMsgHandler sub"

In the RemoteMsgHandler sub you retrieve the submitted text parameter with
CommandInfo(CMD_INFO_MSG), and possibly decode it yourself. From this sub
you then call your Foo() subroutine in the same MapBasic program, e.g.:

Sub RemoteMsgHandler
  Dim param as String
  param = CommandInfo(CMD_INFO_MSG)
  Call Foo (param)
End Sub

Hope this helps.

Best regards / Med venlig hilsen
Lars Nielsen

**********************************************************
Lars Nielsen                                [EMAIL PROTECTED]
Sr. Developer, MapBasic & MapXtreme Specialist
Kampsax/MapInfo, Odense              http://www.mapinfo.dk
Authorized MapInfo Distributor in Denmark & Norway
Address: Rugaardsvej 55, DK-5000 Odense C
Telephone: +45 6313-5000           Facsimile +45 6313-5090
**********************************************************
"Klik ind p� http://www.kortal.dk og se det hele lidt fra oven!"
"Visit http://www.kortal.dk and see Denmark from above!"



                                                                                       
                                            
                    [EMAIL PROTECTED]                                               
                                            
                    Sendt af:                            Til:    "Cautley, David/PDX" 
<[EMAIL PROTECTED]>,                         
                    [EMAIL PROTECTED]        
[EMAIL PROTECTED]                                         
                    onsmag.com                           cc:                           
                                            
                                                         Vedr.:  Re: MI-L Integrated 
Mapping: Calling a function in MBX            
                                                                                       
                                            
                    11-12-01 05:18                                                     
                                            
                    Besvar venligst til DeepakKa                                       
                                            
                                                                                       
                                            
                                                                                       
                                            





Hi David
                why don't u make a ActiveX DLL of your wondorous code in VB
and then call that function in your MapBasic application....

Regs
Kaul




                    "Cautley, David/PDX"

                    <[EMAIL PROTECTED]>                  To:     "'MapInfo
List ([EMAIL PROTECTED])'"
                    Sent by:
<[EMAIL PROTECTED]>, "'Mapinfo Tech Support (Mapinfo Tech
                    [EMAIL PROTECTED]        Support)'"
<[EMAIL PROTECTED]>
                    onsmag.com                           cc:

                                                         Subject:     MI-L
Integrated Mapping:  Calling a function in MBX

                    12/11/01 07:02 AM

                    Please respond to "Cautley,

                    David/PDX"







This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.


Is is possible to call a function inside a running MBX from Visual
Basic?

Consider the following simplified MBX:
==============================================================
Declare sub Main()
Declare Sub Foo(strSomething as string)

Sub Main
'       make some menus, etc....
'       stay loaded when you're done
'
End Sub
Sub Foo(strSomething as string)
'
'       do wonderous things...
'
End Sub
==============================================================

Is there some way, inside Visual Basic, that I can call "Foo"?

....   Launch Mapinfo, stick handle in mMIInstance
'   run the mbx...
        mMIInstance.do "run application FooHolder.mbx"
'
'       now, what can I do to call foo?  The following doesn't work, as
any function call from the mapbasic window is doomed...

        mMIInstance.do "call Foo(HelloWorld)"

Thanks.

David Cautley
Software Architect
CH2M HILL, Inc. -- Portland, Oregon USA Office
(503) 235 - 5022 x 4478    dcautley @ ch2m.com




_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.






_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.






_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to