|
Thats a good one, i like it
|
|
|
|
|
I need to write a utility that integrates into the shell with right click support that will perform some of the tasks that are done with the IIS website administrator tool.
Which version of VC++ supports this?
Does anyone have any experience with this?
TIA
Glano perictu com sahni delorin!
|
|
|
|
|
are u looking for WMI (Windows Management Instrumentation). in msdn.
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
|
You got my 5!
Thanks for this 100% relevant link!
Glano perictu com sahni delorin!
|
|
|
|
|
(Strictly not a Visual C++ question, but I hope I won't be flayed alive since it's at least a programming question!)
10 points to the first person who can tell me how to extract a token (delimited by ".") from an argument (always of the form "a.b.c.d", where a, b, c, and d are strings of varying length) passed to a .CMD file. My guess is you'll want to use the FOR command to loop thru the string. I've going nuts trying to get this to work!
C:\> myExtractor welcome.to.Code.Project
Found token welcome
Found token to
Found token Code
Found token Project
C:\>
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
maybe I am totally missing the point, but can you not write a simple DOS filter in C or assembler that would take your input string and output the tokens? Examples of filters are DOS commands like SORT, FIND, or MORE. You would of course need a compiler that creates DOS files (As opposed to console programs). I am sure it could be done using pipes and maybe IO redirection.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Yes, I've already written a tiny console exe that does what I want (which is really to create a .h file that's #includ ed by my .rc ). But I'd like to reduce our build's dependency on an externally built module (which can get out of synch). Hence the desire to do it all at the DOS (actually CMD ) level.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
use strtok() or write you own simple extractor.
INTP
|
|
|
|
|
See my reply to PJ's response.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I have read your reply and do not understand the problem.
The header files string.h and stdio.h are ansi c, they are stable and should not get you out of sync; unless I am missing something.
The example I just look up under strtok will do the job with only minor changes: (1) change main(int agc,char *argv[]), (2) use arc[1] insted of the global string variable and change the printf output in any way you want.
That is DOS programming; and if you compiled it under UNIX or almost any other operating system, it would still work.
INTP
|
|
|
|
|
Hi John,
Introducing another dependency (the tokenizer app) in the build process introduces another point of failure in the build script. It's not hard to write the app that produces what I want (I've already done that to verify that the process works), but I'd prefer to do it in a DOS/CMD script (i.e. bare metal) that's part of the existing build script.
Just downed several cups of coffee in quick succession... I think I've got it to work! Will post a (hopefully positive) reply soon!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
So why are you asking here? Try some DOS shell conferences
Robert-Antonio
"Science is a differerntial equation.
Religion is a boundary condition."
|
|
|
|
|
I have a problem with mapping keys to buttons on the dialog.
I tried by catching WM_CHAR message like this
void CDialogbasedDlg::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch(nChar)
{
case '1': //do sth
break;
//...
}
CDialog::OnChar(nChar, nRepCnt, nFlags);
}
but it didn't work. The application just beeps when I press '1'.
|
|
|
|
|
Does the dialog have keyboard focus ? Did you set a breakpoint ? Your code WILL do nothing when a '1' is pressed.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I put SetFocus() in OnInitDialog(), but I don't know anything about setting a breakpoint. Could you please, just in a few steps, explain me what I need to do?
|
|
|
|
|
You shouldn't have to call SetFocus, try removing it. A breakpoint is set with F9 ( from memory ), it's a little black circle on the left of your code. Then if you're in debug mode, when you run your program and it gets to the point where the circle is, it will stop and you can examine the state of memory/variables/etc. and step through code. The point here would just be to see if the code is being reached.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Ok I see what you mean. I know what debugging breakpoint is. I thought you ment it was some kind of a function or something similar. It doesn't work though. The code doesn't get executed.
I did manage, however, to trap keysrokes with PreTranslateMessage() like this
<br />
BOOL CDialogbasedDlg::PreTranslateMessage(MSG* pMsg) <br />
{<br />
if(pMsg->message==WM_CHAR)<br />
{<br />
switch(pMsg->wParam)<br />
{<br />
case '1':
break;<br />
case '2':
break;<br />
}<br />
return TRUE;<br />
} <br />
else<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}<br />
and it works. But I guess this is not how it should be done. Is there a better way of trapping keystrokes in dialog?
|
|
|
|
|
This plainly means that the message is not getting through to your onChar handler. The question is, why ? Did you remove the SetFocus call ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Yes, i did. But how can I set focus to dialog so it can receive WM_CHAR?
I put TRACE macro in OnChar, but I dont get any results in the debug screen.
|
|
|
|
|
hi everybody,
i've got a strange error while trying to use va_start() macro.
i wrote the following :
va_list ap;
<font style="color:green;">
va_start(ap, 0); <font style="color:green;"></font> and the compiler gave me an error C2101: '&' on constant
when i looked at the MSDN, the example is that one :
int average( int first, ... )
{
va_list marker;
va_start( marker, first ); <font style="color:green;"></font>
<font style="color:green;">
}
it seems to be similar with my code, so i don't understand where i fail...
can anyone help please ?
TOXCCT >>> GEII power
|
|
|
|
|
The second argument must be the name of an argument in your function.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
but where is the difference ???
if the argument is an integer, its value will be passed... no ?
va_start() need a reference ?
does it need a reference to the first argument of the list ?
TOXCCT >>> GEII power
|
|
|
|
|
The difference is the fact that va_start() is a *macro*. The word "first" is literally passed to it, and it is then used.
va_start() uses it's second argument by doing &MySecondArg, this is why you get the "& on constant" error (0 in your case).
This is because va_start() needs to know where from the stack to read next. Since the second argument you pass to it is one of your function's arguments, taking it's address returns a place on the stack. From there, va_arg() keeps moving.
The va_list is simply a pointer to the next place, and this is what gets updated every time you use va_arg().
-- Calius
|
|
|
|
|
ok, well i can now say that, you are right for some points, but some other are wrong.
first (for precision), i've already said in my first post that va_start() was a macro ; knowing whatever it means.
in fact, va_start() get a reference to the argument preceding the first of the optional parameter... (so, you're right on this). i so now understand the compiler error (C2101).
but va_list is not a pointer to the next place as you say. it points only one argument (the current), and at the next call of va_arg() , this one will increment the pointer to the next argument in the list. that's why va_start() argument must be the preceding...
anyway, thanks, i apreciate your answer.
i'm now ok with that point...
TOXCCT >>> GEII power
|
|
|
|