Try to place a "wscript.echo" to debug what the "lcMBXLoc" variable
contains, ex:

..
oshell.echo lcMBXLoc
oShell.Run( ( lcMBXLoc), 1, .T.)
..

The 2 situations (development environment and user deployment) probably
differs regarding directory assingments

(I assume you want your Foxpro app to launch MapInfo + mbx app and wait
until the mbx is finished.. and the mbx contains a "end mapinfo" statement)

regards 
Bo Thomsen

-----Oprindelig meddelelse-----
Fra: Terry McDonnell [mailto:[EMAIL PROTECTED]
Sendt: 12. juli 2004 17:39
Til: [EMAIL PROTECTED]
Emne: MI-L OLE Error 0X80070002


Dear Listers

I don't suppose many will be able to solve this but here goes...

I'm invoking a MapInfo application, via a MapBasic .MBX. 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, 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.

Please, somebody, help me!!!

Terry


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 12577

Reply via email to