I think Jeff is actually on the right track. We had an application here at BMC that would work only if a certain amount of time had passed since MapInfo started, so the coder added a loop to make the program "sleep" for a few seconds before beginning.
I've never tried calling back to MapInfo from a DLL, so I don't know if this will work. But if you tried Update Window WIN_MAPINFO at the beginning of Sub Main in your MapBasic app, it might clear out the MapInfo window's message queue and force everything to be initialized. If that doesn't work, a "sleep" loop may be your only alternative. Regardless of what you do in MapBasic, you should definitely handle this error in your C++ code. Hope this helps Spencer -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff H. Sent: Thursday, October 12, 2006 6:34 AM To: mapinfo-l@lists.directionsmag.com Subject: [MI-L] MBX error: Dll not found even if it's there Hi, I created a dll in C/C++ and exported one of its functions in order to be able to call it from MapBasic. Then I created a small .mbx file that calls that function. This works just fine as when my mbx is executed it runs my dll exported function. So my dll function is exported correctly as MapBasic expect it. Recently I changed my dll by adding more dll dependencies on it (my dll depends on other dll's). I noticed an *intermittent* problem. When my mbx get executed I get this error that my dll could not be found and my mbx does not get loaded nor executed. If i try the same operation again it works. So it appears to me like an *intermittent* problem. I'm not sure what the source of this problem. Would it be a racing problem as MapBasic tries to load my dll and fails as MapInfo Pro is still not completely loaded? Have any one encountered a similar problem? Thank you Jeff Lacoste ps: My dll and all it dependent dll are present. My equivalent mapbasic function has an input argument the MapInfo Dispatch ID. I'm using systemInfo(17) to pass the current running MapInfo Pro Dispatch ID to my C/C++ function to use it. _______________________________________________ MapInfo-L mailing list MapInfo-L@lists.directionsmag.com http://www.directionsmag.com/mailman/listinfo/mapinfo-l _______________________________________________ MapInfo-L mailing list MapInfo-L@lists.directionsmag.com http://www.directionsmag.com/mailman/listinfo/mapinfo-l