PureBasic Take Over!
Hi DarthPuff,
nice to see you learning new things.
If you are trying to use PB to front-end for your particle test app for DB,
try making a PB .DLL file for DB to access. That would simplify your problems. Just ensure that you "Hide" DB before calling a PB window and then call the windows function that makes your PB window a forground window. Can't remember it off hand, but i'll look it up if you ask.
Also, the other possible problem you may be having is DB may not support background operations. Therefore it requires "Focus" to run correctly. The WinExec api function may be the only other option. Also, did you place a delay(20) in your program loop to permit other apps to work? Also, as was mentioned before, the file should only be accessed by one program at a time. Ensure it is closed and remains closed until the other app is done.
another problem i found...
you open/close and or delete the .dat file
with every windows message (each time through the loop). Try placing all file operations into a comand button control loop. That would limit file operations to only those times that you desire.... actually press the button.
the waffler murrmurs....
nice to see you learning new things.
If you are trying to use PB to front-end for your particle test app for DB,
try making a PB .DLL file for DB to access. That would simplify your problems. Just ensure that you "Hide" DB before calling a PB window and then call the windows function that makes your PB window a forground window. Can't remember it off hand, but i'll look it up if you ask.
Also, the other possible problem you may be having is DB may not support background operations. Therefore it requires "Focus" to run correctly. The WinExec api function may be the only other option. Also, did you place a delay(20) in your program loop to permit other apps to work? Also, as was mentioned before, the file should only be accessed by one program at a time. Ensure it is closed and remains closed until the other app is done.
another problem i found...
you open/close and or delete the .dat file
with every windows message (each time through the loop). Try placing all file operations into a comand button control loop. That would limit file operations to only those times that you desire.... actually press the button.
the waffler murrmurs....
> its a PureBasic Problem though... I know that for sure...
> it has everything to do with the "RunProgram()" command...
WRONG. Run this test app:
This app opens Notepad with RunProgram, and doesn't exit until you hit
the Escape key. When the Notepad window opens, type some text and
save it. As you'll see, Notepad can read/write to the file even though
RunProgram started it. So there is NO problem with RunProgram at all,
and it definitely doesn't stop another exe from reading/writing to a file.
The problem lies elsewhere in your app's code.
> it has everything to do with the "RunProgram()" command...
WRONG. Run this test app:
Code: Select all
RunProgram("notepad.exe","c:\test.txt","c:\",0)
Repeat : Sleep_(1) : Until GetAsyncKeyState_(#VK_ESCAPE)<>0
the Escape key. When the Notepad window opens, type some text and
save it. As you'll see, Notepad can read/write to the file even though
RunProgram started it. So there is NO problem with RunProgram at all,
and it definitely doesn't stop another exe from reading/writing to a file.
The problem lies elsewhere in your app's code.
Last edited by PB on Sat May 24, 2003 7:41 am, edited 1 time in total.



