PureBasic Take Over!

Just starting out? Need help? Post your questions and find answers here.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

let us now how you get on, if it is a problem with runprogram(), post it in the bug forum and fred will get to it :)
--Kale

Image
User avatar
waffle
Enthusiast
Enthusiast
Posts: 129
Joined: Mon May 12, 2003 1:34 pm
Location: USA
Contact:

Post by waffle »

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....
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> its a PureBasic Problem though... I know that for sure...
> 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
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.
Last edited by PB on Sat May 24, 2003 7:41 am, edited 1 time in total.
DarthPuff
User
User
Posts: 47
Joined: Sat Apr 26, 2003 2:51 am
Location: USA
Contact:

Post by DarthPuff »

=\ hrmmm your right... O_O F**k...
Post Reply