Extracting the called paramaters of a dialog box application

I want to extract the parameters of which my MFC dialog box application was
called in a dos box.
Is there any api for that?

Thanks

Beni


0
beni (7)
10/30/2006 6:51:03 AM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
532 Views

Similar Articles

[PageSpeed] 34

You can always use GetCommandLine();

AliR.

"Beni" <beni@beni.com> wrote in message
news:%23SoAl9%23%23GHA.4356@TK2MSFTNGP05.phx.gbl...
> I want to extract the parameters of which my MFC dialog box application
was
> called in a dos box.
> Is there any api for that?
>
> Thanks
>
> Beni
>
>


0
AliR3470 (3235)
10/30/2006 4:36:57 PM
Take a look at:

http://msdn2.microsoft.com/en-US/library/zaydx040.aspx

Tom

"Beni" <beni@beni.com> wrote in message 
news:%23SoAl9%23%23GHA.4356@TK2MSFTNGP05.phx.gbl...
>I want to extract the parameters of which my MFC dialog box application was
> called in a dos box.
> Is there any api for that?
>
> Thanks
>
> Beni
>
> 


0
tserface (3860)
10/31/2006 1:17:51 AM
Hi Tom,

Have you used CCommandLineInfo before (Other than passing it to
ProcessShellCommands).
I haven't been able to affectivly use it.
say I have something like this
myapp.exe -r xyz

If you have a chance can you send me an example of using CCommandLineInfo to
get the parameters?

Thanks
AliR.


"Tom Serface" <tserface@msn.com> wrote in message
news:%235FykpI$GHA.1196@TK2MSFTNGP02.phx.gbl...
> Take a look at:
>
> http://msdn2.microsoft.com/en-US/library/zaydx040.aspx
>
> Tom
>
> "Beni" <beni@beni.com> wrote in message
> news:%23SoAl9%23%23GHA.4356@TK2MSFTNGP05.phx.gbl...
> >I want to extract the parameters of which my MFC dialog box application
was
> > called in a dos box.
> > Is there any api for that?
> >
> > Thanks
> >
> > Beni
> >
> >
>
>


0
AliR3470 (3235)
10/31/2006 3:47:52 PM
I think I see how, override the CCommandLineInfo::ParseParam()

AliR.

"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message
news:45477020$0$2905$a8266bb1@reader.corenews.com...
> Hi Tom,
>
> Have you used CCommandLineInfo before (Other than passing it to
> ProcessShellCommands).
> I haven't been able to affectivly use it.
> say I have something like this
> myapp.exe -r xyz
>
> If you have a chance can you send me an example of using CCommandLineInfo
to
> get the parameters?
>
> Thanks
> AliR.
>
>
> "Tom Serface" <tserface@msn.com> wrote in message
> news:%235FykpI$GHA.1196@TK2MSFTNGP02.phx.gbl...
> > Take a look at:
> >
> > http://msdn2.microsoft.com/en-US/library/zaydx040.aspx
> >
> > Tom
> >
> > "Beni" <beni@beni.com> wrote in message
> > news:%23SoAl9%23%23GHA.4356@TK2MSFTNGP05.phx.gbl...
> > >I want to extract the parameters of which my MFC dialog box application
> was
> > > called in a dos box.
> > > Is there any api for that?
> > >
> > > Thanks
> > >
> > > Beni
> > >
> > >
> >
> >
>
>


0
AliR3470 (3235)
10/31/2006 3:55:53 PM
Hi Ali,

I'm not near my own code to get the stuff, but basically you derive your own 
class from CCommandLineInfo and override the ParseParam function.  Then your 
function gets called so you can extract other parameters.  I'm not sure this 
is a lot easier than just looking at the _targv stuff, but ...  here is an 
article where this sort of thing is done...

http://www.codeguru.com/Cpp/misc/misc/consoleapps/article.php/c243

Tom


0
tserface (3860)
11/1/2006 11:46:18 PM
Oops, I answered before seeing that you figured it out... :o)

Tom

"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
news:45477200$0$2952$a8266bb1@reader.corenews.com...
>I think I see how, override the CCommandLineInfo::ParseParam()
>
> AliR.
>
> "AliR (VC++ MVP)" <AliR@online.nospam> wrote in message
> news:45477020$0$2905$a8266bb1@reader.corenews.com...
>> Hi Tom,
>>
>> Have you used CCommandLineInfo before (Other than passing it to
>> ProcessShellCommands).
>> I haven't been able to affectivly use it.
>> say I have something like this
>> myapp.exe -r xyz
>>
>> If you have a chance can you send me an example of using CCommandLineInfo
> to
>> get the parameters?
>>
>> Thanks
>> AliR.
>>
>>
>> "Tom Serface" <tserface@msn.com> wrote in message
>> news:%235FykpI$GHA.1196@TK2MSFTNGP02.phx.gbl...
>> > Take a look at:
>> >
>> > http://msdn2.microsoft.com/en-US/library/zaydx040.aspx
>> >
>> > Tom
>> >
>> > "Beni" <beni@beni.com> wrote in message
>> > news:%23SoAl9%23%23GHA.4356@TK2MSFTNGP05.phx.gbl...
>> > >I want to extract the parameters of which my MFC dialog box 
>> > >application
>> was
>> > > called in a dos box.
>> > > Is there any api for that?
>> > >
>> > > Thanks
>> > >
>> > > Beni
>> > >
>> > >
>> >
>> >
>>
>>
>
> 


0
tserface (3860)
11/1/2006 11:46:41 PM
Thanks Tom. I need to remember this next time I need to parse the command
line, up til now I have been doing it the old fashioned way.

AliR.

"Tom Serface" <tserface@msn.com> wrote in message
news:Od0s9$g$GHA.4496@TK2MSFTNGP02.phx.gbl...
> Oops, I answered before seeing that you figured it out... :o)
>
> Tom
>
> "AliR (VC++ MVP)" <AliR@online.nospam> wrote in message
> news:45477200$0$2952$a8266bb1@reader.corenews.com...
> >I think I see how, override the CCommandLineInfo::ParseParam()
> >
> > AliR.
> >
> > "AliR (VC++ MVP)" <AliR@online.nospam> wrote in message
> > news:45477020$0$2905$a8266bb1@reader.corenews.com...
> >> Hi Tom,
> >>
> >> Have you used CCommandLineInfo before (Other than passing it to
> >> ProcessShellCommands).
> >> I haven't been able to affectivly use it.
> >> say I have something like this
> >> myapp.exe -r xyz
> >>
> >> If you have a chance can you send me an example of using
CCommandLineInfo
> > to
> >> get the parameters?
> >>
> >> Thanks
> >> AliR.
> >>
> >>
> >> "Tom Serface" <tserface@msn.com> wrote in message
> >> news:%235FykpI$GHA.1196@TK2MSFTNGP02.phx.gbl...
> >> > Take a look at:
> >> >
> >> > http://msdn2.microsoft.com/en-US/library/zaydx040.aspx
> >> >
> >> > Tom
> >> >
> >> > "Beni" <beni@beni.com> wrote in message
> >> > news:%23SoAl9%23%23GHA.4356@TK2MSFTNGP05.phx.gbl...
> >> > >I want to extract the parameters of which my MFC dialog box
> >> > >application
> >> was
> >> > > called in a dos box.
> >> > > Is there any api for that?
> >> > >
> >> > > Thanks
> >> > >
> >> > > Beni
> >> > >
> >> > >
> >> >
> >> >
> >>
> >>
> >
> >
>
>


0
AliR3470 (3235)
11/2/2006 3:44:43 PM
Reply:

Similar Artilces:

Requery combo box problem (error 2118)
This is a question about an Access 2000 database. I'm going to ask the question in the way that I'm trying to get it to work, but if there seems like there is a better design to avoid the problem altogether that I haven't thought of, please mention it. I have a form (lets say Form1) with a field that uses a combo box that draws its data from table tblMachines. If the user searches through the combo box for a particular choice and doesn't find it, the user would then open up another form (Form2), which directly shows data from table tblMachines. There, the user can add a new...

extracting icons
Is there any way to extract an icon from an application? Take a look at the ExtractIcon[Ex]() API Cheers Check Abdoul --------------------- <davegreb@gpxinc.com> wrote in message news:c6c54da6-574c-4c8e-8ec9-3b77b99a5523@d70g2000hsb.googlegroups.com... > Is there any way to extract an icon from an application? ...

Combo box problem to Report
I have a table with 160 records. I am trying to set up my form so the user can select a record from a combo box, enter the payroll in a text box field and submit. Then they can perform the same function several times and each record will show up on my report with the payroll for each separate record. I’ve tried the combo box on the form page but when you select one or several selections, all 160 records are displayed on the reports page. Would also like a suggestion on how to have it set up for the user to enter the payroll (automatically rounded to the closest dollar) each time they ...

Matching call data based on date, time and number called to give c
I have the following two tables on different sheets, both containing other information within them that is irrelevant in my question. SHEET 1 Date - Time - Number Called Duration Cost 01/02/10 09:05:21 01234123456 02:16 0.50 SHEET 2 Date - Time Number Called - Duration Extension 01/02/10 09:07:56 01234123456 02:15 1234 01/02/10 15:30:45 01234123456 01:59 1234 Sheet 2 HAS A LOT MORE RECORDS THAN SHEET 1 AND THERE ARE A NUMBER OF CALLS TO THE SAME NUM...

extracting totals from within a spreadsheet
I need to know how to take different information from within a spreadsheet --where two conditions/catogories must apply so that a third column where i have inputed hours, will total for those conditions only... can anyone help? Please spell out what you want we are not mind readers -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Jovetta" <Jovetta@discussions.microsoft.com> wrote in message news:91442C6D-03DF-4FC1-A069-AAB43FA57485@microsoft.com... >I need to know how to take different information from within a spreadsheet > --where two condi...

Newbie: How to Access Controls on a Dialog
I'm making my first stab at an MFC program. Basically a dialog box with some controls. I started out with basic edit boxes placed on the main dialog using the resource editor in VC++ (6.0). To set text, I have been using the SetDlgItemText(IDC_MYEDITBOX, "Sample Text"). Works fine. Now I working with Check Boxes. Okay, placed it using the dialog editor. Looked for some sort of equivalent to SetDlgItemText to check and uncheck the box using the control ID ("IDC_MYFIRSTCHECKBOX"). Nothing. Reading through Prosise's "Programming Windows with MFC"...

Excel: extract and sum numerals from mixed text/numeral cell range
I have a large (30x20) grid of cells with data, and I want to extract and then sum up certain numerals from this entire range. The catch is that the data is mixed numerals and text, as you'll see below. Here's an abbreviated 3x3 example, with a value in each of the nine cells: V7.1 T H P1 A T B V3 P4.5 If I just wanted to sum up the instances of "T" appearing, I could use COUNTIF() for the entire range to come up with answer ("T" appears 2 times). Easy enough. But, what I'm trying to accomplish is to sum up the numerals associated w...

Extract emails from cells with text
I have a row in column A which includes an email address in the text that I'd like to extract to column B. Is there a formula I can use to accomplish extracting the email address only to column B? Here's an example of different cells in column A: Please email example@law.ufl.edu to contact us...... OR Schedule an appointment for assistance, or email example@uga.edu with your questions... Thank you Try this... All on one line: =TRIM(RIGHT(SUBSTITUTE(LEFT(A1,FIND (" ",A1&" ",FIND("@",A1))-1)," ", REPT(" ",...

how to disable warning box warning against MS Word trying to send an email
Hi all, I use email in my office frequently. I'd like to disable the Outlook warning box that cautions a "program is trying to send an email." I use Windows XP and Word 2000. I know I saw a message when using a later version that offered to disable or otherwise alter the warning. Suggestions will be appreciated. :) Gil Carter Hi Gil, there is an Add on or call it programm which is clicking the OK automatically. Please look here http://www.contextmagic.com/express-clickyes/ -- Ich habe nichts gemacht, gestern gings noch! Bitte in den Newsgroup antworten damit jeder etw...

Replace context menu by dialog?
I want to create dialog which will appeare neare to cursor in editView, and I have idea, i want to replace context menu by this dialog? Can i do that? If not, please tell me how to create dialog which won't appeare in task bar? lukes wrote: > I want to create dialog which will appeare neare to cursor in > editView, and I have idea, i want to replace context menu by this > dialog? Can i do that? > If not, please tell me how to create dialog which won't appeare in > task bar? It is easy to do. Add a WM_RBUTTONDOWN message handler in your edit view class. If you do n...

Unbound Text Box Help
I have an unbound text box called TYPE, that I want to display the name of a transaction type. See below code. I have added this to the BeforeUpdate and the AfterUpdate and the TYPE remains blank. This is DSform and the infromation is for display purposes only. Does anyone have any suggestions on why this is not working and what I can do to correct my ways. Matt Private Sub TYPE_BeforeUpdate() If Me.TRANS_TYP = "S" Then Me.TYPE = "SALES FORECAST" End If If Me.TRANS_TYP = "I" Then Me.TYPE = "INVOICE" End If ...

Owner draw menu does not call DrawItem
When a user right clicks in the view I display a context menu with TrackPopupMenu. This context menu is derived from CMenu and has owner draw items on it. The menu's parent is the view. When I run it in the debugger the view calls CWnd::OnMeasureItem which calls MeasureItem in my menu class. I fill in the itemWidth and itemHeight members. However the framework doesn't then go and call either: OnDrawItem in my view class or Cwnd::OnDrawItem or DrawItem in my menu class I am using Microsft Visual Studio 2005. I wrote a noddy program because the mechanism appears broken in a more comp...

extracting individual numbers from "ranges"
I'm trying to get EXCEL to extract stock prices quoted in individual cells as 52-week ranges --e.g. 11.76-19.90-- and do the following calculation: (higher price - lower price)/lower price Obviously, this a problem because each cell appears to handle the range as text or something. Is there are way to get EXCEL to handle the "text" (or however else it is interpreting what's in the cell) as individual numbers? Great thanks for any help. Hi do your entries always look like lower_number-higher_number if yes you may try the following formula in the adjacent row (lets assum...

Query and Extract
Hello all, This seems basic, but I just cannot get it. While using SQL Server 2005 and the Microsoft SQL Server Management Studio, I created a database called AssetQuote. Inside I have on table called assetquotes. From there, I have three columns, (date, quote, author) The column type for date is datetime and the other two are just text. My Query is something this: INSERT INTO AssetQuote (date, quote, author) VALUES('052010','No act of kindness, no matter how small, is ever wasted.', 'Aesop'); When I run the query I get this result: Msg 208, ...

Comment Boxes
I have a comment box in a cell - the comment is quite large but when I drag the comment so that I can see all the text, it returns to original position and I cannot see all of the comment. Is it possible to change the position of the comment?? so that when I position the cursor over the cell it will show above rather than below?? Thanks Ann Thanks Debra Can this be changed in any way - maybe with code?? Ann >-----Original Message----- >When you reposition comments, it controls where they will appear when >comments are made visible (View>Comments). However, when you poi...

Combo boxes 02-08-08
I know that I am not an idiot and I have done it before, but I can't remember and it is driving me crazy!! I have a subform where I am trying to make a combo box that looks up something from another table. It has 4 columns to it, ID, first name, last name and rate. How in the hairy heck do I make it show all those columns when I chose it off my choices. Right now, it only shows the one column (the first name since I know how to hide the key column). Help...I am going insane (short trip) and it is going to bug me until I figure it out. Thanks!!! I believe you have to set your ...

modeless dialog #4
I have a formview class which uses a dialog on a tab control. On this dialog I call a modeless dialog. That is all working okay, but I want to uncheck a check box on the main dialog when the Ok button is pressed on the modeless dialog. I can't seem to figure out how to do this and I was wondering anyone could give me a hand. How do I get access to the variable on my main dialog from my modeless dialog? Z.K. Z.K. wrote: > I have a formview class which uses a dialog on a tab control. On this > dialog I call a modeless dialog. That is all working okay, but I want > to ...

Fill text boxes with data from another text box
I have a form that has two sections. Section 1 has orginator name, address, city state, zip. Section two has owner name, address, city, state, and zip. If orginator and owner are the same, I want to just hit a button or check mark to copy data from section one to section two. Can this be done, and how would you do it. Thanks for your help- Porkchop. Porkchop, To copy data from one control (and, hence, field, if the form control source is set to the name of a field in the form's underlying record source), put the following in the AfterUpdate event procedure of the checkbox: If ...

Porting 32 bit applications to 64 bit in Visual Studio 2005
Hi all, I am trying to convert my 32 bit application in C++ to a 64 bit compatible platform on Visual Studio 2005. I was wondering if you could guide me in this matter. I know that we have to change variables etc appropritely and compile it in x64 mode. If I am working on a 32-bit machine how do i test and basically run the 64bit version on my machine? IS it possible to do so? ( running the 64 bit converted code on a 32bit machine...) Im using macros to make it compatible in x64. Any guidance is really appreciated .... Thank you all for taking the time to help me! The /Wp64 option will gi...

extracting hours from a sum of time
I have a cell which sum a bunch of cells containing an elapsed time. The sum totals to more than 24 hours. I have to a cell with a cost per hour and I need to caclculate the total cost. The problem is that the hour function returns values in the range of 0-24. My current sum is 25:30 and the hour function return 1 and not 25. Any ideas how to bypass it? It "returns" the correct number, but doesn't show. Format Custom as [h]:mm and it will. To convert to a number that you can multiply with an hourly rate, first multiply by 24; times in Excel are fractions of a day and a day is s...

Can I extract unique cell values from every nth column?
I have a range that covers B5:XA160. For each row, data is entered in 11-cell groups: date, some numbers, description (a text value), more numbers, and more numbers. At first it was enough to merely count how many times certain descriptions appeared, because those were the only ones we would see - or so the story went. Now, I need to extract the unique descriptions AND provide a count! Actually, I'm cheating a bit. I'm using SUMPRODUCT to return the number of times the expected descriptions appear, and by subtracting these from the total number of text values I get a count of &quo...

Combo Boxes in Charts
I have created a chart which includes a combo box which refers to a list of names. The problem is that the font size is too small - size 10 - and I would like to make it bigger. Have tried changing the font size of the data range for the combo box but this has no effect. The properties of the combo box let me change its size but not the font size of the list of items. Any suggestions. Thanks Shirley Munro -- Shirley Munro ------------------------------------------------------------------------ Shirley Munro's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=83...

Combo Box 02-05-08
Is ther a way to have a combo box look up a record in a different table and fill in the client nem on a form? Here is the example.... I want the box to fill in the client name on a quote form that will be used to fill another table. It keeps asking me for the company name in the quote table. Assuming that the ID for company name is a field in the recordsource in the form. The combo needs to be bound to the field for company nameID. The rowsource for the combo is a query with the company name ID, the company name and any other fields that are needed to restrict the rowsource to valid com...

Combo Box executing query, issues
I am trying to set up a combo box that will execute a query. I've searched the site and haven't found anything that seems to help. Here is my situation. I have a combo box, cboZoneSelect, that has a source from a table, tblZone. The combo box populates fine with no problems. I have a query that pulls Table: tblZone tblDetail Fields: tblZone.Zone tblDetail.ZoneId(fk) tblDetail.Country tblDetail.Product tblDetail.StandardLevel tblDetail.PackageType. Under tblZone.Zone I have the criteria set to [Forms]![Switchboard]![cboZoneSelect].[AfterUpdate] When I run the query it requ...

Extract Text
Dear all I have this text in a field: 200701-I 200701-II 200701-III 200701-IV and I need to separate only the data after the six first data: -I -II -III -IV How can I do it? Thanks a lot!!! Andr=E9. Take a look at Access HELP for the Mid() function. Open a query in design view and add a new field something like: NewField: Mid([YourField],7) -- Regards Jeff Boyce www.InformationFutures.net Microsoft Office/Access MVP http://mvp.support.microsoft.com/ Microsoft IT Academy Program Mentor http://microsoftitacademy.com/ <gatarossi@ig.com.br> wrote in message news:11893397...