|
CK938 wrote: Do I use the **
A pointer to a pointer does not make much sense (when communicating with VB).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Using the calling convention to function temp1 [temp1(A1:C3)]...how should I go about writing my DLL?
I know that calling the function that takes in a 1D array works, but I'm not sure how to work about a 2D. I only know how to create a 2D array in C++ by:
int **temp = new int*[3];
for (int i = 0; i < 3; i++)
{
temp[i] = new int[3];
}
|
|
|
|
|
Does anyone know how to programmatically clear the debug output window in Visual C++ 2003.
Is there some sort of command or Macro to clear it before a TRACE for example?
|
|
|
|
|
I don't think there's a C macro for this, but you might check out some sort of VC add-in.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
or use a bunch of these:
TRACE(_T("\n"));
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Not quite what I had in mind but I guess that technically covers what I asked for.
I was hoping for some funcky escape sequence in TRACE that would "clrscr" or whatever that old DOS command was.
|
|
|
|
|
It gets cleared each time you start the program via F5. And, at least for me, all new text is added to the bottom and scrolled up accordingly (i.e., I always see newly added text).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Same here.
I just occasionally come up with trace sequences that kinda get out of hand and in some unique circumstances, it would help to have the debug window "reset" to help my eyes track the start of the sequence better/faster.
Right now I put a trace in with a hiddeous, jumps out at you, string to help me find the start of the last iteration of trace sequences.
Thought I'd check with the rest of you to see if someone had ever come across something like that before.
Thanks for the input.
|
|
|
|
|
Heh I tried a formfeed - no love there.
I haven't dug into the internals of how these messages get routed to a debug window,
but I always assumed the messages are just written and it's up to the receiver to deal
with them.
Therefore, even if there was an extension to the IDE that did this, I'm not sure how it
could be used programmatically at runtime.
I'm interested in seeing a solution though.
Good luck,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
No luck here either.
However, Hans Dietrich brought up "SysInternals DebugView" in another post in the thread. It doesn't do the clear screen thingy but it has a highlighting feature that is pretty cool. I had been meaning to dig through all those Sysinternal utilities someday. So far, the regmon (I think that's what it's called) has been the only one I've found I can't live without.
Thanks for the help.
|
|
|
|
|
You should give DebugView a try. You can set filters on lines with specific words - like 'ERROR' or 'WARN' - and DebugView will colorize those lines according to the colors you set.
|
|
|
|
|
That's sweet.
It's picking up traces from any debug exe run on the machine with Visual Studio running.
I downloaded the whole sysinternals collection right after MS bought them in case they were going to remove them from circulation but I never noticed that one before.
thanks for the heads up.
|
|
|
|
|
You can use the "exclude filter" option to exclude any unwanted lines. Sometimes, when you are reading lines in DebugView, the cursor will suddenly junp to bottom, because some other app has written debug output. I just add exclude filter to stop cursor from jumping around.
I also have a number of "5 character" filters defined - for example, '~~~~~', '-----', '=====', etc. - each with a different background color. I add 5-character sequence to end of TRACE string, for lines I want to watch for. It makes it very easy to see that line in TRACE output.
I once tried to add '*****' as filter, but everything turned that color! DebugView uses it as wildcard character. LOL!
|
|
|
|
|
Thanks for the advice and guidance.
|
|
|
|
|
Thanks Hans!!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am writing an event handler for the menu bar. In response to the WM_COMMAND message, my WndProc is supposed to send wParam to the function like this:
...<br />
case WM_COMMAND:<br />
guiObject->OnMenuSelection((UINT) wParam);<br />
...
Here is the code for the menu handler:
void GuiObject::OnMenuSelection(UINT menuID)<br />
{<br />
switch(menuID)<br />
{<br />
case ID_FILE_QUIT:<br />
break;<br />
default:<br />
break;<br />
}<br />
}
So why is the compiler giving me this error? How do I fix it?
|
|
|
|
|
What is ID_FILE_QUIT defined as?
Mark
<br />
<br />
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It's defined in the resource file. Visual Studio's resource builder made it.
#define ID_FILE_QUIT 40001
Right now, it's the only menu item there is.
|
|
|
|
|
Hmm I can't reproduce that.
resource.h is included somewhere?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well this is strange... Resource.rc is #included in the header. When I hover over it with the mouse, it even tells me the #define'd value. But now I see that I am also getting a "error C2065: 'ID_FILE_QUIT' : undeclared identifier". When I #include the resource.h file in this particular .cpp file, now it suddenly works. How is it that the compiler can look up it's value on a mouse-over, but somehow can't find it unless I #include it in the .cpp file as well?
|
|
|
|
|
Kevin Strickland wrote: How is it that the compiler can look up it's value on a mouse-over, but somehow can't find it unless I #include it in the .cpp file as well?
Subtle difference between the way info is gathered to build the intellisense database and the way the compiler parses through
the code.
I hate when that happens
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Subtle difference
That is not even close to subtle. LostYourSense is NOT A COMPILER, period.
Perhaps he can get a good trade on ebay ... compiler for filet-o-fish
|
|
|
|
|
led mike wrote: That is not even close to subtle.
I forgot the facetious tags
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I forgot the facetious tags
I don't think Visual Studio supports those.... yet
|
|
|
|
|
Kevin Strickland wrote: So why is the compiler giving me this error?
If we are to assume that the error is pertaining to the case ID_FILE_QUIT statement, then you need to verify that it is an integer constant. Otherwise, please note the line that is in error.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|