snaileater Posted November 23, 2008 Share Posted November 23, 2008 (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) ; EndFuncI 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 November 23, 2008 by snaileater Link to comment Share on other sites More sharing options...
Zedna Posted November 23, 2008 Share Posted November 23, 2008 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... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ProgAndy Posted November 23, 2008 Share Posted November 23, 2008 (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 November 23, 2008 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 More sharing options...
snaileater Posted November 23, 2008 Author Share Posted November 23, 2008 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 More sharing options...
snaileater Posted November 23, 2008 Author Share Posted November 23, 2008 You should try to use MapInfoCallBacksManagerX and set Object Events for it http://www.microolap.com/products/gis/micm...02_02_00_VB.htmyes i had already seen it ... doesn't seem to be "free" anyway (even if i don't find its pricing on the site ...) Link to comment Share on other sites More sharing options...
snaileater Posted November 26, 2008 Author Share Posted November 26, 2008 Is there any way i could retrieve more information about the error generated ? Thanks for help ... Link to comment Share on other sites More sharing options...
snaileater Posted November 27, 2008 Author Share Posted November 27, 2008 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 More sharing options...
snaileater Posted November 27, 2008 Author Share Posted November 27, 2008 (edited) would this screen capture help the specialists telling me what is the right syntax to use with the SetCallBack method ?thanks in advance ! Edited November 28, 2008 by snaileater Link to comment Share on other sites More sharing options...
Richard Robertson Posted November 29, 2008 Share Posted November 29, 2008 It requires a pointer to an IDispatch object. Does the AutoIt callback use IDispatch? Link to comment Share on other sites More sharing options...
snaileater Posted November 29, 2008 Author Share Posted November 29, 2008 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 ... Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 1, 2008 Share Posted December 1, 2008 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now