This topic is 4347 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm sorry post this thread here but it is not connected with a game programming. Can sombody help with some problems. 1. I want to handle additional parameters in my application. For example if I write (in cmd.exe) MyApp.exe -a the application do one thing, if I write MyApp.exe -b the application do another thing. 2. I have a problem with a dialogs. I add DS_3DLOOK style but nothing changes. My OS is MS Win XP SP2 and I using MS Visual studio 8.0. Also If I add to a dialog RichEdit Control it fails to show it. PLS Help [help][help][help]

##### Share on other sites
Quote:
 Original post by Illuminate1. I want to handle additional parameters in my application. For example if I write (in cmd.exe) MyApp.exe -a the application do one thing, if I write MyApp.exe -b the application do another thing.

Well, the way to do this is to decode the command line. Change your main function so that it looks like:
int main( int argc, char** argv )

When you run your program, the operating system will fill in the arguments argc and argv. argc is the number of command line arguments (including the program name). argv is an array of argc C-strings. In your example, argc will be 2, argv[0] will be "MyApp.exe" and argv[1] will be "-a" or "-b". From this point it is just a matter of testing the value of argv[1] and deciding what to do.

Hope that helps.

##### Share on other sites
Quote:
 Original post by Illuminate1. I want to handle additional parameters in my application. For example if I write (in cmd.exe) MyApp.exe -a the application do one thing, if I write MyApp.exe -b the application do another thing.

Well, the way to do this is to decode the command line. Change your main function so that it looks like:
int main( int argc, char** argv )
When you run your program, the operating system will fill in the arguments argc and argv. argc is the number of command line arguments (including the program name). argv is an array of argc C-strings. In your example, argc will be 2, argv[0] will be "MyApp.exe" and argv[1] will be "-a" or "-b". From this point it is just a matter of testing the value of argv[1] and deciding what to do.

Hope that helps.

##### Share on other sites
This does not belong in Your Announcements. Moved to General Programming.

##### Share on other sites
OK, I understand. In WinMain lpCmdLine contains "-a" and "-b"
I have just one more question. How can I create a custom look window (for example - window skins in WinAmp where the titlebar is not blue and have different height and width and the "X" button is not red and also have defferent have and width and so on)?

##### Share on other sites
To draw stuff in the title bar you need to process the WM_NCPAINT message. Look at MSDN for more information. Also to handle mouse messages for the title bar you need to handle WM_NC* messages.

The reason the richedit control is not showing is because you haven't loaded RICHED32.DLL or RICHED20.DLL into memory.

##### Share on other sites
Quote:
 Original post by Marcus SpeightTo draw stuff in the title bar you need to process the WM_NCPAINT message. Look at MSDN for more information. Also to handle mouse messages for the title bar you need to handle WM_NC* messages.The reason the richedit control is not showing is because you haven't loaded RICHED32.DLL or RICHED20.DLL into memory.

After install MS Visual Studio it add additional DLL directories, also I added some libraries including RICHED20.DLL in C:\Windows\System32 so it is 100% sure that RICHED32.DLL is loaded in memory! But even now it isn't show RichEdit20A class.

I have a problem loading DLL for Console solution in debug version. I have an mainfest file but it show an error R6034 try to load DLL without mainfest file. In release version it did not show any error!

##### Share on other sites
To load the RICHED20.DLL file, you need to call AfxInitRichEdit2() when your application starts up (i.e., just put the call in CMyApp::InitInstance). If you have a dialog box with a rich edit control in it and you omit this call, the dialog's creation will fail - if you specify the "No Fail Create" property for the dialog, the dialog will show up, but the rich edit control won't.

• 10
• 16
• 14
• 18
• 15