Jump to content

Callback, MAPINFO and AutoIT


snaileater
 Share

Recommended Posts

Hi,

i try to implement information exchange between the GIS application Mapinfo et my AutoIt application using a callback function.

here's what i'm doing :

$o_Mapinfo = ObjCreate("MapInfo.application")   

$toto = DLLCallbackRegister ("_toto", "int", "str")
$h_toto = DllCallbackGetPtr($toto)

$o_Mapinfo.SetCallback $h_toto

Func _toto($str_mapinfo)    
;
EndFunc

I always get an error when using the SetCallBack command, i'm not sure of the syntax, nor of passing the right parameter ...

Could anybody help me ?

Thanks !

Edited by snaileater
Link to comment
Share on other sites

You should try to use MapInfoCallBacksManagerX and set Object Events for it :)

http://www.microolap.com/products/gis/micm...02_02_00_VB.htm

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Try:

$o_Mapinfo.SetCallback($h_toto)

But I wonder it will not work not due to syntax but due to bad callback using.

But I'm not sure about that, just try it...

Yep ... already tried ... generating same error ...

using the COM Error Handler found in autoIt documentation i get "err.windescription : type not corresponding" ... (that's my translation from french to english...)

thanks anyway

Link to comment
Share on other sites

i tried the Setcallback command with all kind of datatype in the following line :

$o_Mapinfo.SetCallback("many datatype tried...")

the com error handler always give me an "type not corresponding error" ...

Could it be a problem with the size of the pointer (32 - 64 bits) ?

(since the parameter to pass should be a pointer, right ?)

I am under Vista 64.

thanks for help !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...