Skip to main content
gamedev.net
🔒 Locked

fatal error ....

Started by Metal Typhoon 10 replies 600+ views
Original Post
Metal Typhoon
Metal Typhoon
LINK : fatal error LNK1104: cannot open file "Debug/Texture.exe" Error executing link.exe. i can''t figure out what is happening .. evertime this happens i have to do a new project arghhhhhhh.. can someone hep me out thx in a dvance
Metal Typhoon

Metal Typhoon
IndirectX
IndirectX
It means your program is running. If you can''t see it, use the task manager to kill it.
---visit #directxdev on afternet <- not just for directx, despite the name
doctorsixstring
doctorsixstring
You get that error when the .exe file you are writing to is already running. That would happen if you forgot to close your app and then tried to compile again. Assuming you did close its, you want to press CTRL-ALT-DEL to get to the task manager and see if your program is still running in the background. You want to make sure your program completely stops running when it is done executing.
Metal Typhoon
Metal Typhoon
thx alot guys ...

i have another question i still wonder why this window is exiting with cod e90783489392 whatever.. shoudln''t it be 0 (0x0) ??


  
#include <windows.h>


LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg)
{
//====================================================

case WM_CLOSE:
DestroyWindow (hwnd);
break;
//====================================================

case WM_DESTROY:
PostQuitMessage (0);
break;
//====================================================

default:
return DefWindowProc (hwnd,msg,wparam,lparam);
}

return 0;
}

int WINAPI WinMain (HINSTANCE hInstance,
HINSTANCE hPInstance,
LPSTR CmdLine,
int ShowCmd)
{
WNDCLASS wc;
MSG msg;
HWND hwnd;

wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hbrBackground = (HBRUSH) GetStockObject (4);
wc.hCursor = LoadCursor (NULL,IDC_ARROW);
wc.hIcon = LoadIcon (NULL,NULL);
wc.hInstance = hInstance;
wc.lpfnWndProc = WndProc;
wc.lpszClassName = "OPENGL";
wc.lpszMenuName = NULL;
wc.style = CS_OWNDC;

if (!RegisterClass (&wc))
{
MessageBox (NULL,"Error registering class","Error...",MB_OK);
return 0;
}

hwnd = CreateWindow (
"OPENGL",
"Texture - Press ESC to exit",
WS_OVERLAPPEDWINDOW,
100,100,300,300,NULL,NULL,hInstance,NULL);

ShowWindow (hwnd,ShowCmd);

while (GetMessage (&msg,hwnd,0,0) > 0)
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}

return msg.wParam;
}



Metal Typhoon



Metal Typhoon
TDragon
TDragon
It''s returning the wParam of the message sent by PostQuitMessage(), which is the huge number that you said (possibly because wParam wasn''t initialized, so that is it''s max value).

Twilight Dragon
Win32 API Expert
www.freewebz.com/j-world
Metal Typhoon
Metal Typhoon
quote:
Original post by TDragon
It''s returning the wParam of the message sent by PostQuitMessage(), which is the huge number that you said (possibly because wParam wasn''t initialized, so that is it''s max value).

Twilight Dragon
Win32 API Expert
www.freewebz.com/j-world


i''m a newbie in windows programming so... is it OK, i mean TOTALLY OK to exit without (0x0) ?? if not how can i initializee wparam and what to ? thx in advance


Metal Typhoon



Metal Typhoon
PouyaCat
PouyaCat
hmmmz... Doesn''t that have something to do with "hey, I can''t process this message, so I''d better return it to windows"?
superpig
superpig
msg.wParam should be equal to the value you pass to PostQuitMessage(). So it should be returning 0.

Is the window being created at all? If the CreateWindow call fails, msg.wParam doesn''t get set... Try changing the HWND parameter of GetMessage to NULL.

Superpig
- saving pigs from untimely fates
- sleeps in a ham-mock at www.thebinaryrefinery.cjb.net
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
Metal Typhoon
Metal Typhoon
one thing that will impress you ALL... i ran the same same same source under windows 2000 and it exited with code 0 (0x0) and under xp it exits with this huge number... WHY ? i don''t know..

The windows is being created .... it''s FINE... but the thingy happens when it exits...


Metal Typhoon



Metal Typhoon
TDragon
TDragon
As was said before, if the window isn''t being created, it''ll do that. However, since like you said the window is being created fine and dandy, it isn''t that. Windows XP is the most complex OS out there, and it isn''t too surprising that it''s not returning a simple value of 0. If what you''re needing to do is check to see whether this program ran OK, by way of another program, then you should either consider some other method, or see if the value returned is always the same (and if so, use it). (BTW, I wouldn''t be depend on the value passed in PostQuitMessage(x) being passed to msg.wParam.)

Twilight Dragon
Win32 API Expert
www.freewebz.com/j-world

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.