Ninjakreborn Posted March 29, 2009 Share Posted March 29, 2009 1) I have been studying/playing with C++ for awhile. However I have always been curious how to go above and beyond command line applications (which is all I can write currently) and start developing windows applications (and eventually making them compatible with MAC, Unix, and Linux). Basically this is the general code below i have seen in a variety of places. However this code throws a variety of errors..is there a way to make this code work. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow); [errors] 1>c:\users\businessman332211\documents\visual studio 2008\projects\windows application start\windows application start\windows application start\index.cpp(1) : error C2146: syntax error : missing ';' before identifier 'WinMain' 1>c:\users\businessman332211\documents\visual studio 2008\projects\windows application start\windows application start\windows application start\index.cpp(1) : error C2065: 'HINSTANCE' : undeclared identifier 1>c:\users\businessman332211\documents\visual studio 2008\projects\windows application start\windows application start\windows application start\index.cpp(1) : error C2146: syntax error : missing ')' before identifier 'hInstance' 1>c:\users\businessman332211\documents\visual studio 2008\projects\windows application start\windows application start\windows application start\index.cpp(1) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\businessman332211\documents\visual studio 2008\projects\windows application start\windows application start\windows application start\index.cpp(4) : error C2059: syntax error : ')' [/errors] 2) What is the difference between a "Struct" and a "Function" in C++. I have seen a few examples where Struct is used instead of Function? Quote Link to comment https://forums.phpfreaks.com/topic/151657-solved-2-c-related-questions/ Share on other sites More sharing options...
Yacoby Posted March 29, 2009 Share Posted March 29, 2009 1: Are you including Windows.h? 2: In C++, a struct is a class, but all members default to public rather than private (and inheritance for that matter). It is totally different from a function. Quote Link to comment https://forums.phpfreaks.com/topic/151657-solved-2-c-related-questions/#findComment-796457 Share on other sites More sharing options...
Ninjakreborn Posted March 29, 2009 Author Share Posted March 29, 2009 Ah ok thank you for both answers. Quote Link to comment https://forums.phpfreaks.com/topic/151657-solved-2-c-related-questions/#findComment-796463 Share on other sites More sharing options...
corbin Posted March 29, 2009 Share Posted March 29, 2009 If by "Windows Applications," you mean applications that are coded using the Windows API for graphical stuff, then good luck making those compatible with Mac/linux. The Windows API is just on Windows ;p. But nevertheless, I wish I were good with the WinAPI . Quote Link to comment https://forums.phpfreaks.com/topic/151657-solved-2-c-related-questions/#findComment-796466 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.