Hello All!



I write dll with Delphi to work with some Mapbasic application. When i
call this dll rom mb application I want to "connect" with the same
instance of Mapinfo that calls my dll. There is
SystemInfo(SYS_INFO_APPDISPATCH) function in MapBasic, but i can't
understand how to work with this function results.

May be problem is in speciality of building dll, or in my unability to
convert integer value to variant or interface variable to start working
with Mapinfo.




Dll has, for example, 2 procedures:




procedure ConnectToMI(Ipointer: integer); stdcall; export;

begin

  // MI - global dll variant variable to communicate with Mapinfo

  MI:= IDispatch(Pointer(Ipointer))

end;




function TestConnect : integer; stdcall; export;

begin

  // test function returning number of opened tables

  try

    Result:= MI.Eval('NumTables()')

  except

    Result:= -1;

  end;

end;




-- MapBasic usage of dll procedures

First:

  call ConnectToMI(SystemInfo(SYS_INFO_APPDISPATCH))

Second:

  Note "Number of opened tables: " + TestConnect()




Hope to "Mapinfo community" help.




With best regards,

  Yuriy Fedorinov




Russia, St.Petersburg

###########################################

????????? ????????? F-Secure Anti-Virus for Microsoft Exchange.
????????? ??????? ?? ??????????.
_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to