|
HI, All!!!
=======
MyApp.exe arg1 arg2 arg3
To get those arguments in a console application we do it like this:
void main (int x, char ** y)
{
... y[1] ...
... y[2] ...
... y[3] ...
}
How do we do it in MFC basedialog application ???
Thanks.
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
Have a look at CWinApp::ParseCommandLine in MSDN.
Michael
|
|
|
|
|
You can use ParseCommandLine like Michael mentioned or the __argc and __argv macros.
Regards,
Alvaro
|
|
|
|
|
I have used GetCommandLine() to do that, but it may not be exactly what you are looking for..
It maybe another option
Rob
|
|
|
|
|
Do you know how can i have my resources (ex. a Button in a dialog box) in a language such as Greek which needs Unicode?
I want to have buttons in Greek
|
|
|
|
|
Hi,
How do I pass on a variable argument list to another function?
E.g. In the example below I want to pass the variable argument list passed through to PrintOutput() onto fprintf.
PrintOutput(char * format, ...)
{
//I want to pass variable list through to fprintf????
fprintf(stderr, format, ...); //This does not work as it is???????
}
Thanks in advance
Neil
|
|
|
|
|
Here's an example from the MFC CString class.
void AFX_CDECL CString::Format(LPCTSTR lpszFormat, ...)
{
ASSERT(AfxIsValidString(lpszFormat));
va_list argList;
va_start(argList, lpszFormat);
FormatV(lpszFormat, argList);
va_end(argList);
}
look up va_list and va_arg in MSDN for more info.
Hope this helps,
Bill
|
|
|
|
|
hi guys,
i'd like to know how to display a static text in bold (italic, etc.) and also how to change its colour, is it possible ?
thanks to you
Fred
|
|
|
|
|
|
thanks Michael, that looks exactly what i want to do.
see you.
|
|
|
|
|
Hi!
I have got a subclassed CEdit control. When trying to scroll to the last line nothing happens. Also, when inserting text with SetWindowText I get an extra linebreak at the top of the Edit box. Anyone got an idea?
Cheers,
/Fredrik
|
|
|
|
|
Generally, if you visit to website, the site's information is saved in cookies.
now, I have many buttons.
When each button click, my computer call IE window.
I want to give a indication in saved cookie.
The indication is a meaning to come from my computer.
how to?--;
please give a courage.
|
|
|
|
|
To send cookies, you need to add them to the header of your http request. I got this from MSDN:
Cookie Header
The Cookie header is included with any http requests that have a cookie whose domain and path match the request. The Cookie header has the following format:
Cookie: <name>=<value> [;<name>=<value>]...
One or more string sequences, using the format <name><value>, contain the information that was set in the cookie.
You would use it like this:
header = "Cookie: Button1:state1;Button:state2";
then include the header in your Navigate call.
Thanks for the help,
Bill
|
|
|
|
|
To send cookies, you need to add them to the header of your http request. I got this from MSDN:
Cookie Header
The Cookie header is included with any http requests that have a cookie whose domain and path match the request. The Cookie header has the following format:
Cookie: <name>=<value> [;<name>=<value>]...
One or more string sequences, using the format <name><value>, contain the information that was set in the cookie.
You would use it like this:
header = "Cookie: Button1:state1;Button:state2";
then include the header in your Navigate call.
Hope this helps,
Bill
|
|
|
|
|
i have got two scrollviews on my dialog. (used them as two scrollcontrols.. but don't mind that..)
the fact is that they are both intended to work together -> the one shows the headlines, the other one shows the data (something like a report generator).
My question now was how to link these two scrollviews, that the user can scroll either of them, and the other one would scroll too...
another question would be (but this is not really important) how to hide the scrollbar of the upper scrollview..
is there anybody having an approach for this ?
thank in advance and have a nice day
Bernhard
"There are three roads to ruin: women, gambling and technicians. The most pleasant is with women, the quickest is with gambling, but the surest is with technicians." Georges Pompidou
|
|
|
|
|
PROBLEM
--------
Actually i want to change the Layout of Dialog at run time, so i call CWnd::ModifyStyleEx(0,WS_EX_LAYOUTRTL);
It changes the tiltle and System Menu location from right to left.but it did not change the location of other controls lying on the dialog, eg Button, ComboBox, etc. if i set the "Right to left layout (More Extended Style)at design time, then it changes the layout of all other controls lying on dialog automatically" so would u tell me where is the problem.
Explanation
-----------
if i fix the property at design time (More Extended Style) "Right to lfet layout" then it works fine, it changes the layout of all controls, even CTreeCtrl, but if i chnage this property at run time by calling CWnd::ModifyStyleEx(0,WS_EX_LAYOUTRTL);then it changes only title bar and no effect on other controls.
Have a nice wishes for multilingual guru
|
|
|
|
|
Surely the answer to this is to convert your code to Unicode !!
This support Multi-Languages, All you need to do then is to use different resource for each Language.
|
|
|
|
|
I want to but a bmp on the background
|
|
|
|
|
ListView_SetBkImage
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Hello,
I am new to database programming (actually, I am not started yet).
I am recording some data in real-time (voice). Now I need to allow the user for searching for some data given a specific time.
I was told that I should consider using SQL, or DAO or ODBC.
I have no clue what the best thing to use is. So I am looking for some information.
Any suggestion will be largely appreciated.
Thanks a lot.
Where there is a WISH, there is a WILL.
|
|
|
|
|
This isn't a complete solution, but should help you get started.
1. First you need establish the database requirements. e.g. exactly what do you need to store, search, retrieve from your DB. How big are the images, how many, etc.
2. With that in hand, select a database engine. There are many, each has its own strengths, weaknesses and costs. Oracle and SQL server are enterprise databases. They are beefy and very capabley (expensive). Access is good for smaller or simpliler applications. May others also exist.
3. Create the actual database schema (you don't need to populate it, just define it).
4. Finally ready to start designing/coding the app. At this point you can select accessing technologies. The main ones available are ODBC, DAO, ADO. ADO is the current favorite.
If this is a significant application, you may want to consult a DB expert to help you design your database and select a db engine.
Hope this helps,
Bill
|
|
|
|
|
>This isn't a complete solution, but should help you get started.
Ok. Let's see ...
>1. First you need establish the database requirements. e.g. exactly what do you need to store, search, retrieve from your DB. How big are the images, how many, etc.
I need to store sound files (wav, ...) with a date and time associated to every piece of data that represent 1 seconde of sound.
The user can then search for a sound that have been recorded at a specific time.
The program records continuously ... so I have a very large quantity of informations.
>2. With that in hand, select a database engine. There are many, each has its own strengths, weaknesses and costs. Oracle and SQL server are enterprise databases. They are beefy and very capabley (expensive). Access is good for smaller or simpliler applications. May others also exist.
I'm thinking about SQL servers. It sounds that it is more portable and robust. And once you know how it works, you have no problem
switching to another one.
QUESTION: Are these free? or do I have to by something?
>3. Create the actual database schema (you don't need to populate it, just define it).
Ok.
>4. Finally ready to start designing/coding the app. At this point you can select accessing technologies. The main ones available are ODBC, DAO, ADO. ADO is the current favorite.
I read a little about these technologies. I am more thinking about using ODBC. It sounds that I is faster than DAO (if I don't use Access database).
Also, my database will be on a remote computer. I read that ODBC is more efficient in this case.
>If this is a significant application, you may want to consult a DB expert to help you design your database and select a db engine.
This really is a significant application. I am used to get things done by reading, asking questions, prototyping, ...
Do you think that these are things we can't learn on the fly ?
>Hope this helps,
>Bill
This helped a lot.
Thank you very much.
Where there is a WISH, there is a WILL.
|
|
|
|
|
"QUESTION: Are these free? or do I have to by something?"
No not free.
"This really is a significant application. I am used to get things done by reading, asking questions, prototyping, ...
Do you think that these are things we can't learn on the fly ?"
No, they aren't. You can, with considerable effort, become a novice DB developer. To go beyond that requires education/experience. If this application is commercial or even IT production, you will be doing yourself a favor to get a professional involved. If it turns out to not be very complicated, it won't cost much.
Hope this helps,
Bill
|
|
|
|
|
Ok. You helped me a lot. That's just too bad you don't accept credit cards
I thank you again.
Actually, I am a software engineer with 5 years experience in programming realtime systems.
I also used to be an analyst-programmer (Dbase IV) for 2 years. But things changed since then.
Just to say that I have some notions in programming.
After reading your suggestions, I think that I'll implement my own database (binary file with my own format).
I only have one thread writing informations to the database while another thread have a read-only access to
this database.
Take care.
Where there is a WISH, there is a WILL.
|
|
|
|
|
Djibril wrote:
I need to store sound files (wav, ...) with a date and time associated to every piece of data that represent 1 seconde of sound.
The user can then search for a sound that have been recorded at a specific time.
The program records continuously ... so I have a very large quantity of informations.
Wait, I think the selection of a database is the least of your worries!
Do you really want to store 1 second clips ??
In order to play a 10 second piece, you have to retrieve 10 1-sec clips using SQL SELECT, squish them together (how?), then play the 10 sec clip. It is quite a challenge in compressed formats like MP3. It may be simple in WAV but note that WAV is an uncompressed format. It will eat up your storage in no time.
I dont know the background of your project, but it sounds like (no pun intended ) a streaming input with a non-streaming output system.
I suggest you store incoming stream in 1-2 hr chunks of compressed format, such as MP3. Then use a player such as Winamp to skip to a location.
|
|
|
|
|