Sign in to follow this  
Followers 0
snaileater

Callback, MAPINFO and AutoIT

11 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Is there any way i could retrieve more information about the error generated ?

Thanks for help ...

Share this post


Link to post
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 !

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

would this screen capture help the specialists telling me what is the right syntax to use with the SetCallBack method ?

thanks in advance !

post-6480-1227825747_thumb.jpg

Edited by snaileater

Share this post


Link to post
Share on other sites

It requires a pointer to an IDispatch object. Does the AutoIt callback use IDispatch?

Share this post


Link to post
Share on other sites

It requires a pointer to an IDispatch object. Does the AutoIt callback use IDispatch?

i dunno ... where could i find an IDispatch object ... ? :)

i'm not sure to understand your question ...

Share this post


Link to post
Share on other sites

Actually that question is aimed toward the developers.

I just looked at the DllCallback functions (never having used them before) and it appears that they will not work for what you are doing. IDispatch is apparently some COM related object that can consume events. I don't know anything about it.

Share this post


Link to post
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
Sign in to follow this  
Followers 0