Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE Error 0X80070002
Message
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00923353
Message ID:
00923382
Views:
91
Hi Terry,

Your application is looking for .mbx file in the current directory which may or may not be the one where application started from. Try
lcMBXLoc = JUSTPATH(_VFP.ServerName) + "\mPLANMap.mbx"\...
>
>I don't suppose many will be able to solve this but here goes...
>
>I'm invoking a MapInfo application, via a MapBasic .MBX (compiled and linked) module. Everything works more or less fine from native VFP (7 SP1), via the following lines:
>
>
>lcMBXLoc	= SYS(5)+SYS(2003) + "\mPLANMap.mbx"
>oShell = CreateObject( "WScript.Shell")
>oShell.Run( ( lcMBXLoc), 1, .T.)
>
>
>As expected, the .MBX is in the same folder as my foxpro .exe. But, for the user version, where my exe is placed in \Program Files\MyAppFolder, and I invoke the exe, it crashes, presumably on the oshell.run, with the error message:
>
>
>OLE Error 0X80070002 The system cannot find the file specified.
>
>
>I thought, "Ah, maybe I have to include the MapInfo.exe in the same folder" (as the MapBasic app and MapInfo are inextricably linked), so copied it there, but no joy.
>As I said, running this from VFP there's no problem. But, when I do it in debug, at the line:
>
>oShell.Run( ( lcMBXLoc), 1, .T.)
>
>I get a brief glimpse of my MI app, which disappears, then Foxpro hangs up (with the hour-glass) and I can't do anything with the pc. I have to abort VFP with Task Manager - then the damn MapInfo application comes to life. When I exit that, as normal, of course my VFP prog has ceased.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform