From: Fernando L. <fer...@gm...> - 2008-06-28 17:39:10
|
Argument 11 (h) should be of type HINSTANCE and it is declared as HWND, see http://msdn.microsoft.com/en-us/library/ms632679(VS.85).aspx. There is a good tutorial at http://winprog.org/tutorial/, or get Programming Windows by Charles Petzold. Best regards, Fernando On Fri, Jun 27, 2008 at 3:20 PM, sudipta basu <tup...@ya...> wrote: > > Hi all, > I am learning C programing under windows.I was trying to compile the following code. > > #include <windows.h> > int _stdcall WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpszCmdline,int nCmdShow) > { > HWND h; > h=CreateWindow("BUTTON","Press Me",WS_OVERLAPPEDWINDOW,10,10,150,100,0,0,h,0); > ShowWindow(h,nCmdShow); > MessageBox(0,"Hi!","Waiting",MB_OK); > return 0; > } > > But I am getting an error as follows:- > 5 C:\Dev-Cpp\tupai\Winapp3.cpp cannot convert `HWND__*' to `HINSTANCE__*' for argument `11' to `HWND__* CreateWindowExA(DWORD, const CHAR*, const CHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)' . > > I have worked with C programs under DOS but not under windows, so I am unable to understand what it means and what rectification is needed in the program. > > And also can someone suggest me some books/websites from where I can learn C under windows efficiently. > > > Regards > Sudipta Lal Basu > > Student, M.Tech (Structural Engineering) > G-51, Jawahar Bhawan > IIT Roorkee > Ph-9897509977 > > Send instant messages to your online friends http://uk.messenger.yahoo.com > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > -- Fernando Lichtschein li...@fi... |