snakey Posted January 20, 2008 Share Posted January 20, 2008 How can i use windows API's with dev C++ i tryed making winnie but i get some errors so it there a dev pac or am i spose to link to a libary or something Quote Link to comment Share on other sites More sharing options...
K1u Posted January 21, 2008 Share Posted January 21, 2008 How can i use windows API's with dev C++ i tryed making winnie but i get some errors so it there a dev pac or am i spose to link to a libary or something Silly question but is it possible you forget to include windows.h? Quote Link to comment Share on other sites More sharing options...
snakey Posted January 21, 2008 Author Share Posted January 21, 2008 Don't work sorry. Theres the code. #include <windows.h> LRESULT CALLBACK WindowProcedure (HWND hwnd, unsigned int message, WPARAM wParam, LPARAM lParam); class WinClass { public: WinClass (WNDPROC winProc, char const * className, HINSTANCE hInst); void Register () { ::RegisterClass (&_class); } private: WNDCLASS _class; }; WinClass::WinClass (WNDPROC winProc, char const * className, HINSTANCE hInst) { _class.style = 0; _class.lpfnWndProc = winProc; // window procedure: mandatory _class.cbClsExtra = 0; _class.cbWndExtra = 0; _class.hInstance = hInst; // owner of the class: mandatory _class.hIcon = 0; _class.hCursor = ::LoadCursor (0, IDC_ARROW); // optional _class.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1); // optional _class.lpszMenuName = 0; _class.lpszClassName = className; // mandatory } And heres the error msg. [linker error] undefined reference to `WinMain@16' ld returned 1 exit status Quote Link to comment Share on other sites More sharing options...
jollyrancher82 Posted January 21, 2008 Share Posted January 21, 2008 That is just a class, it's not being used. You should learn how to use Windows API in C first. http://winprog.org Quote Link to comment Share on other sites More sharing options...
snakey Posted January 22, 2008 Author Share Posted January 22, 2008 Thanks tomb your the man. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.