Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/151657-solved-2-c-related-questions/
Share on other sites

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 :(.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.