Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Execute file: File error 163: Failed to set cooperative draw

Author
Message
Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 19th Feb 2009 13:00
Hi, I cannot seem to execute an exe file from within db and none of the previous posts concerning .exe problems seem to help. I know the command should be execute file filename$,command$,path$,wait flag but it fails.

I tried 2 very simple programs to achieve this, the first being compiled to an executible (called Readinexe.exe
) from:


While Spacekey()=0
text 0,0,"Ok this is being readi correctly..."
sync
endwhile
do

The second program is then tries to call this .exe

do
text 100,100,"press w to execute first exe"
sync
if inkey$()="w" then EXECUTE FILE "ReadinExe.exe","","",1
loop

BOTH are saved in the same directory (C:\cold dawn) yet when I run the code above and press "w", I get this error 163: Failed to set cooperative draw message. I even tried specifying the directory instead of just having "" but same problem. Is there anything I'm doing obviously wrong?
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 19th Feb 2009 14:31
OK, I see a few no-no's here. Firstly, you NEVER execute a file in a loop if you don't know what you are doing. If I held the button "W" with your program, it would execute the exe about 1000 times per second => Crash!

Do this:



And then, put "set window on" at the start of your program. Then it should work.

TheComet

Peachy, and the Chaos of the Gems

Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 19th Feb 2009 17:49
if your trying to open another darkbasic program you can't (i don't think) thats what people say. you cAN'T run 2 drkbasic programs at the same time thats where tht error comes frm
Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 20th Feb 2009 11:50
Thanks guys!
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Feb 2009 19:36
so you figured it out? lol jw
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Feb 2009 12:28
Quote: "if your trying to open another darkbasic program you can't (i don't think) thats what people say. you cAN'T run 2 drkbasic programs at the same time thats where tht error comes frm"


Only if both programs are in full screen mode. If you set the one that executes the other one to window mode, it works.

TheComet

Peachy, and the Chaos of the Gems

Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 21st Feb 2009 20:48
oh did not know that comet! thanks! learning new things all the time hahahaa

Login to post a reply

Server time is: 2025-05-18 02:49:23
Your offset time is: 2025-05-18 02:49:23