|
|
|
|
Hello All,
I have problem with Accessing the HDC variable.
I am using MFC Application.(Dialog Based)
When i am going to use that variable like..........
/////////////////////////////////////
if (!m_hrootdc)
m_hrootdc = ::GetDC(NULL);
///////////////////////////////////////
Error shows at the line of If Condition like below.............
//////////////////////////////
TestRTMP.exe: 0xC0000005: Access violation reading location 0xccccccdc.
////////////////////////////////
I have declared this HDC variable in the class header file(RTMPDesk.h) and I have used it in the file (RTMPDesk.cpp) and CTestRTMP is the main Dialog Class.
so plz help me .
Thanks in Advanced.
Ashish Bhatt
|
|
|
|
|
I highly doubt the code you posted is the cause of your problem. Your code is trying to read a variable that has not been initialized 0xCCCCCCCC and because there is a 0xDC at the end of that hex, I am guessing that the instance of your class has not been initialized.
You can verify this by placing a breakpoint on the code and checking the value of the this pointer.
Waldermort
|
|
|
|
|
Thank you All
I have have got the Solution. I did not initialize the object of class.
|
|
|
|
|
Did you initialize m_hrootdc?m_hrootdc=NULL;
|
|
|
|
|
when i use this link to customize the title bar..........<b>http://www.codeproject.com/gdi/customcaption.asp</b>.Its demo was working fine but there is a bug,when first time click the minimize button it works fine but after that its not working and what we saw when i click the half left part of the maximize button,the window will minimize and when i click the right half part of the maximize button then the window will maximize.how to fix that bug.plz anybody fix the bug. i am a novice programmer.
Anurag Gupta
Sofware Engg.
NetStudio pvt. ltd.
|
|
|
|
|
Without looking at any code it's kinda hard to say. But to hazard a guess, I would say the NCHITTEST message is being handled incorrectly and that the rectangles of the buttons are improperly positioned.
Waldermort
|
|
|
|
|
sir i give the link in my problem statement.if possible plz check the link
|
|
|
|
|
anuragguptartm wrote: sir i give the link in my problem statement
but why didn't you asked directly the forum at the bottom of the article ?
the author should be a better replier to your problem...
|
|
|
|
|
int numPaths;
bool bVisited;
vector<int> adjacent; // Contains the adjacent nodes in the INVERSE graph
};
sNode * nodes;
vector<int> topological; // Contains the REVERSED topological ordering of the nodes
int numNodes, bottomNode, numEdges;
void dfs(int);
void countPaths();
void printResults();
FILE * file;
FILE * outFile = NULL;
int main(int argc, char ** argv) {
int n, a, b;
char buf[256];
file = stdin;
if (argc == 2) {
file = fopen(argv[1], "r");
printf("Opening %s\n", argv[1]);
if (isdigit(argv[1][1]))
sprintf(buf, "%c%c.out", argv[1][0], argv[1][1]);
else
sprintf(buf, "%c.out", argv[1][0]);
printf("Opening %s\n", buf);
outFile = fopen(buf, "w");
}
fscanf(file, "%d%d%d", &numNodes, &bottomNode, &numEdges);
printf("%d nodes, %d edges\n", numNodes, numEdges);
nodes = new sNode [numNodes];
for (n = 0; n < numNodes; ++ n) {
nodes[n].numPaths = 0;
nodes[n].bVisited = false;
nodes[n].adjacent.clear();
}
for (n = 0; n < numEdges; ++ n) {
fscanf(file, "%d%d", &a, &b);
nodes[b].adjacent.push_back(a);
}
dfs(bottomNode);
if (topological.size() != numNodes) {
printf("ERROR: Not all nodes are reachable from the bottom\n");
return 0;
}
countPaths();
printResults();
system("PAUSE");
return 0;
}
void dfs(int current) {
int n;
queue<int> q;
vector<int> v;
if (nodes[current].bVisited)
return;
nodes[current].bVisited = true;
for (n = 0; n < nodes[current].adjacent.size(); ++ n)
dfs(nodes[current].adjacent[n]);
topological.push_back(current);
}
void countPaths() {
int n, i;
sNode * currentNode;
nodes[topological[numNodes - 1]].numPaths = 1;
for (n = numNodes - 1; n >= 0; -- n) {
currentNode = &nodes[topological[n]];
for (i = 0; i < currentNode->adjacent.size(); ++ i) {
if (INT_MAX - currentNode->numPaths < nodes[currentNode->adjacent[i]].numPaths)
printf("ERROR: OVERFLOW!\n");
nodes[currentNode->adjacent[i]].numPaths += currentNode->numPaths;
}
}
}
void printResults() {
int max, n;
max = nodes[0].numPaths;
for (n = 1; n < numNodes; ++ n)
if (nodes[n].numPaths > max)
max = nodes[n].numPaths;
printf("Node list: ");
for (n = 0; n < numNodes; ++ n) {
if (nodes[n].numPaths == max) {
printf(" (%d)", n);
if (outFile)
fprintf(outFile, "%d\n", n);
}
}
printf("\nPath count: %d\n", max);
if (outFile) {
fprintf(outFile, "%d\n", max);
fclose(outFile);
}
}
|
|
|
|
|
what do you exactly want us to do here?
you have pasted your whole code here
no description?
no comments of the code?
no proper indentation?
and that too incomplete code.
where exactly your problem is?
please put some write up before your code
and keep the code as simple as possible.
and before posting, read the post "How to get an answer to your question" by chris maunder above your post.
|
|
|
|
|
this guy is acting like a troll... but strangely, he is not, because it happened to him to answer to some questions we've been asking to him.
but anyway, this guy deserves once again to be flammed for this post
|
|
|
|
|
donot get discouraged.
just repost your query with some better clarity.
gud luck.
|
|
|
|
|
Do you want the short answer or the long answer?
"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
|
|
|
|
|
after Waleed has asked his question, related to intellisense, i have got one more question on that topic.
iam using vc++ 6.0.
in my code editor,
say if i use a variable for example,
CString str;
and if i type "str" and then ".", the functions/members of the CString class are supposed to pop up.
but sometimes, this is working and sometimes not.
any ideas like, how and where to enable it if possible.
gud luck to Waleed for his post and hope for the solution.
-- modified at 9:07 Tuesday 9th October, 2007
|
|
|
|
|
You could try deleting the .ncb file (which is the intellisense database). This works for me most of the time .. good luck and thanks for your nice words...
Wal
http://www.waleedeissa.com
|
|
|
|
|
thanks waleed for your reply.
i shall implement your advice, the next time i face the same problem.
and by the way i attempted your post. kindly reply it.
|
|
|
|
|
Hello,
I'm using __declspec(property) to access get/set methods as properties (like in C# and VB.NET). Now, the problem is that both the property name and the get/set methods show in the intellisense list. Is there anyway to remove the names of the get/set methods from the intellisense list?
Here's an example, I have two methods, one is a get method with the name getText and another set method with the name setText, the name of the property is Text. I only want Text to show in the intellisense list, I don't want either getText or setText to show up in the list.
Thanks for any suggestions...
Wal
http://www.waleedeissa.com
|
|
|
|
|
did you face this problem in COMponent?
if so, then i have some more questions, before arriving to the solution.
see you tomorrow morning.
|
|
|
|
|
No, I'm just trying to use properties in a normal c++ class
Wal
http://www.waleedeissa.com
|
|
|
|
|
|
Hello all,
In a project I am currently working on, I would like to have some functions (like for example the logging) running as a server that can be addressed by all modules that may simultaneously be running. Does anyone have a link to articles or examples of how to build such server software and how to interact with it from the other modules?
Thanks in advance,
William
|
|
|
|
|
Maybe this[^]can help you a little?
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|