Link to home
Start Free TrialLog in
Avatar of Nibhatish
Nibhatish

asked on

Cannot create program workspace error when FoxPro 2.6 application executed from VC++ MFC

Hi,

We are trying to run Foxpro exe from VC++ application using CreateProcess. FoxPro application gives error -  "Cannot create program workspace". If we run application using CreateProcessWithLogonW with logged in user's credentials then it runs fine. But in production, we do not want to have any user/passwords entered or stored in application. Any alternate solution for this ?
SOLUTION
Avatar of Cyril Joudieh
Cyril Joudieh
Flag of Lebanon image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nibhatish
Nibhatish

ASKER

This application was not using config.fp file. So based on one of solution on net , I tried to put entries given by you in config file but now application directly gets closed instead of showing any error. I am not sure if it will have any impact but I am using D drive for running the application as well as path is D:\Temp.
Try at least this then

TMPFILES = D:\temp

then add
SORTWORK = D:\temp

the rest are for development version.

I am not sure about OVERLAY. I found it on the net and no documentation.
I am again getting same error now i.e. "Cannot create program workspace". I have also added one line at the start of file
RESOURCE=OFF. So my config.fp is looks as below

RESOURCE=OFF
TMPFILES          = D:\temp\Bill
SORTWORK          = D:\temp\Bill
Is your application an exe, app or prg?
It is .exe file. We do not have source code for the application.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
eg ShellExecute( 0, "Open", "notepad.exe" , "", "", 1 ) opens notepad.
@Olaf: Initially I tried it using ShellExecute but I was not able to run  .exe  using ShellExecute. I am able to open notepad , batch files etc. with ShellExecute but not the FoxPro exe. I am not sure of the reason.
I believe you are putting the config.fp with the exe file, right?

What about the access privileges of the user currently logged in when you launch the software? Under what operating system? On XP it should be no problem.
@CaptainCyril: Config file and .exe file are in same folder. I am using following command to launch application
D:\\TEMP\\BILL\\<ApplicationName> -cD:\\temp\\bill\\config.fp

It is windows xp machine. I am currently logged in with the user having admin rights. If I run the application from command line, or using CreateProcessWithLogonW passing credentials of logged in users, it runs fine. I am not sure, when we debug application in VC++, which user is used to run createprocess. I tried building my VC++ application and then running it using "Run as" option. But still I am getting same error.
I am not sure which user is logged in when you run in Debug mode. That's the problem causing the application not to have access to the temp folder.
No external CONFIG will help if there is one included in the EXE.

Also, are you talking about FoxPro for DOS application?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you're probably missing runtime files on your machine.
The solutions provided here could not solved my issue but these might solve for someone else. Solution is rated as good and not excellent because we were not able to get the solution on my machine though we got it to work in production.