im trying to put a varible into a parameter with a char * varible as well.
it compiles with these warningsCode:int i(5); MessageBox(ghwnd_Main,(LPCSTR)sprintf("Hey this is my number %a",(LPCSTR)i),"",MB_OK);
but at run time it gives me this.c:\C++\winControls\winControls.cpp(51): warning C4312: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size
c:\C++\winControls\winControls.cpp(51): warning C4312: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size
cheersUnhandled exception at 0x0041ffe6 in winControls.exe: 0xC0000005: Access violation reading location 0x00000005.![]()


Reply With Quote