error LNK2028: unresolved token (trying to attach an existing window)  
Author Message
AliiZ





PostPosted: Visual C++ Language, error LNK2028: unresolved token (trying to attach an existing window) Top

Hi!

I'm trying to use the FindWindow() function, but it doesn't seem to work properly.
My whole program works just fine, but as soon as i add this piece of code, i
get these weird compiler errors.

code:
static char* fWndSTATIC = "FLYFF";
HWND fWindow = FindWindow(NULL, LPCWSTR(fWndSTATIC));

returning error when compiling:
Error 1 ) FlyFF INCA Pro.obj

Error 2 ) FlyFF INCA Pro.obj

Error 3 fatal error LNK1120: 2 unresolved externals

I'm using Visual Studio 2005. Standard IDE.



Visual C++6  
 
 
AliiZ





PostPosted: Visual C++ Language, error LNK2028: unresolved token (trying to attach an existing window) Top

Fixed.

I added:
#pragma comment(lib, "User32.lib")
under:
#include <windows.h>

But now, the program doesn't find the FLYFF window even while its running.


 
 
Brian Kramer





PostPosted: Visual C++ Language, error LNK2028: unresolved token (trying to attach an existing window) Top

This is an off-topic post. Please reserve your questions in this forum to C++ language issues only.