|
Hello, everyone!
I want to learn general debug technology and some debug tricks of VC 6.0. For example, how to use debug menu of VC 6.0.
Where can I find some on line tutorials about this topic?
Thanks in advance,
George
|
|
|
|
|
Check out MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vcoriDebuggingTechniquesForVisualC.asp
Kuphryn
|
|
|
|
|
Thanks, kuphryn buddy!
George
|
|
|
|
|
hi..i have a menu in my Dlg....
an i want to diable it from my Data class...
so i add a member variable for the menu
void CGoServerDlg::OnUpdateListenListenforclients(CCmdU
I* pCmdUI)
{
}
in the dlg.....
now i want to disable it from the data class...
i have a member var in my data class pointing to the Dlg m_pSvrData
can any one pls help???
tks
in my data class if i do this....
m_pSvrData->OnUpdataListenListenforclients(???????)
tks
With Regards
Joseph R. Thomas
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
|
|
|
|
|
There are severa solutions. One solution is to call a member function of the dialog window. Have it disable the item. Another solution is messages.
Kuphryn
|
|
|
|
|
One solution is to call a member function of the dialog window
wont that involve lotsa passing the control around and making some flags.. and taking care of the flags everytime anything ahppens to the menu....
i am willing to do that...but is it correct to do that way??is there a straight forward answre??
tks
With Regards
Joseph R. Thomas
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
|
|
|
|
|
Hi,
Can anyone tell me what is this exception?
Unhandled exception in mytest.exe(mfc42.dll):0xc00000096 privileged Instruction.
Regards
Neaha
|
|
|
|
|
I believe it usually happens when you are passing invalid parameters to the base classes or you are trying to access data when it hasn't been created yet (invalid data).
|
|
|
|
|
But it is happening at
m_str=new double[256*256];
where m_str is double *
|
|
|
|
|
That line of code looks fine. without looking at the rest of the code around it I don't know for sure.
|
|
|
|
|
By the way, if the array is always made up of 65536 doubles, then why not,
double m_str[65536];
It's much faster and you don't have to worry about freeing it later.
Regards,
Alvaro
Can I ask you a question?
|
|
|
|
|
Yum. A 512Kb allocation. Hope that sucker isn't on the stack....
Steve S
|
|
|
|
|
Are you using SSE or SSE2 by any chance? If you are, I might answer your question.
|
|
|
|
|
When we capture an image, it goes to clipboard. I heard that clipboard accepts DIB and TIFF format(but I'm not sure). If I send JPEG image to clipboard, does clipboard transform JPEG image to DIB or TIFF?
|
|
|
|
|
CF_BITMAP , CF_DIB , and CF_TIFF are three of the standard formats. To register others such as JPEG, you'll need to call RegisterClipboardFormat() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I have an array:int amounts[]
How do I define size of arrays as an enumeration literal
Num in an anonymous enumeration?
|
|
|
|
|
Typically when I need to do this I have:
enum Test
{
Item 1
Item 2
.
.
.
Item N
TestEnd
}
then I just use (TestEnd - Item 1) for the size on the array. Just make sure that if you add to the enumeration that TestEnd or whatever you call it is always the last item. This will create a proper sized array.
|
|
|
|
|
Here is my code:
Can you help me?
#include <iostream>
using namespace std;
const NUM = 2;
int volumes[NUM], volume;
int count=0;
int amounts[NUM],amount;
const double price=0.05;
const double fee=12.0;
int main()
{
do
{
cout<<"Please enter the volume of water used by a customer ";
cout<< "during a month (in gallons).(Zero to end):";
cin>>volume;
if (volume==0.0)
break;
if (count==NUM)
break;
volumes[count++]=volume;
amount=(volume*price)+fee;
amounts[count++]=amount;
}
while(true);
return 0;
}
|
|
|
|
|
// include <float.h> and <iostream> in stdafx.h
#include "stdafx.h"
using namespace std;
const NUM = 2;
// changed int to double because volume usually isn't in whole numbers
//int volumes[NUM], volume;
double volumes[NUM], volume;
int count=0;
// use double for amounts because you are using doubles to multiply
double amounts[NUM],amount;
const double price=0.05;
const double fee=12.0;
int main()
{
do
{
cout<<"Please enter the volume of water used by a customer ";
// cout won't get you the value must use cin
//cout<volume;
cin="">> volume;
// with doubles never check for equality, check for greater or
// less than
if (volume < DBL_MIN )
break;
// move this check to the end of the while loop
// and make it check for >= instead of ==
//if (count==NUM)
// break;
// also you are incrementing count twice. only do it once
//volumes[count++]=volume;
amount=(volume*price)+fee;
//amounts[count++]=amount;
volumes[count] = volume;
amounts[count] = amount;
count++;
if( count >= NUM )
break;
}
while(true);
return 0;
}
|
|
|
|
|
Thanks for the comments. It helps a lot.
One more question:
I am trying to display all values after user enters 0. I wrote the following code. I can't see what is incorrect in this code.
displayArray();
void displayArray(const int volumes[NUM];const int NUM)
{
count<<"\n";
int count=0;
while (count
|
|
|
|
|
Also don't forget to predefine the function unless you put the fuction code before main.
displayArray( volumes, count);
// First the Function declaration is incorrect.
// you have a semicolon where there should be a comma
// and you have volumes declared as int when it should be
// double but that was covered previously
// also you don't need NUM as a variable because it is a
// program constant. Instead pass Count
//void displayArray( const int volumes[NUM]; const int NUM)
void displayArray( const double volumes[NUM], const int Count)
{
cout<<"\n";
int nCount=0;
while ( nCount < Count)
{
cout<< volumes[nCount] << " ";
nCount++;
}
int nPause;
cin >> nPause;
}
|
|
|
|
|
Thank you for comments it explains a lot (I am in school )
|
|
|
|
|
Hello, everyone!
How to dump some debug information (I mean the information of my special program information, for example, the value of a variable which I am interested in) to VC 6.0's debug window in a MFC project? Who can show me an example?
Thanks in advance,
George
|
|
|
|
|
afxDump << nVar;
afxDump is the stream that outputs to the debug window in the Visual Studio IDE. It works in both 5.0, 6.0 and .NET.
|
|
|
|
|
Thanks, Adam buddy!
George
|
|
|
|