|
As Rajesh mentioned, message queue is associated with the thread. Not with the window.
|
|
|
|
|
i am working with an MFC application which handles images using an imaging library.
the application works fine for any image operation with small size images but for large size images, the application crashes.
if i try to debug in the visual studio 2008 then the application breaks with an heap corrupt message:
Heap block at 062E0E18 modified at 062FF378 past requested size of 1e558
Windows has triggered a breakpoint.
i tried for handling the exception using CMemoryException but it doesnt throw this kind so i am catching it this way:
try
{
}
catch(...)
{
}
now in the catch block i want to know the kind of exception which caused the problem.
is there a way to know this?
thanks
|
|
|
|
|
Whether memory allocation of huge size taking place inside the try block? Величие не Бога может быть недооценена.
|
|
|
|
|
One of the problems with this issue is that you have a memory leak in your code that is possibly not diagnosed until some time after the event. This means that even if you catch this exception it may only tell you what you see above: the heap is corrupt. You have allocated a buffer of 1E558 bytes (124248 decimal) but written in the heap somewhere beyond the end. You probably need to trace through your code as you load and process the image to ensue your index values are not corrupt. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
|
hai,
I want to create an application which will run 24 hrs a day & it should call a fn in every x minutes.
|
|
|
|
|
You can use a timer to do that.
|
|
|
|
|
Hello,
How can i access class member variable directly without creating object of that class.
I think there are two way, one way is declaring member variable as static.
What is the other way to access it?Abhijit
|
|
|
|
|
Abhijit D. Babar wrote: I think there are two way, one way is declaring member variable as static.
What is the other way to access it?
There isn't another way.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
learn about the class concept. A member makes only sence if have an instance.
if it is a global values (as computer name) use a static variable.Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hello,
Why MFC application create two resource file ".rc" and ".rc2" or What is the difference between .rc and .rc2 files.
.rc2 file does not contain anything, then why it use or created by MFC.Abhijit
|
|
|
|
|
In the *.rc2 file it is said:
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Ok, it is having something in file, but what is use of that.
What it indicates.Abhijit
|
|
|
|
|
Take a look on documentation[^]Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
you can include resources, which will not be editable in the Resource editor of the VS. Interesting for constant stuff as error messages or data as images. Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hello,
In my MFC application, i added one Dialog resource and give class name as CSample.
I can invoke this dialog through;
CSample obj;
obj.DoModal();
Can i create user defined constructor for dialog class CSample.
If i want to pass some parameter to this class through constructor, can i pass it?Abhijit
|
|
|
|
|
Yes, you can. Just declare the type in the header file and add the definition in the cpp file.
I wonder why haven't you tried?!
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I just want to pass the parameter for dialog class before dialog get invoke.
|
|
|
|
|
Abhijit D. Babar wrote: I just want to pass the parameter for dialog class before dialog get invoke.
Go ahead.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Abhijit D. Babar wrote:
Can i create user defined constructor for dialog class CSample.
Yes.
Abhijit D. Babar wrote: If i want to pass some parameter to this class through constructor, can i pass it?
Yes.If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes, you can create user defined constructor, and yes, you can pass parameters through the constructor to the dialog, but as the CDialog already gets a CWnd* as constructor parameter, NULL if nothing else is said.
CSample (CWnd* pParent = NULL);
I would use Set/Get methodes to pass parameters, because if you overload the constructor parameters, it may be that the MFC (if you use it) gives you problems if you have an error overloading the constructor. After just use the contructor to initialize the member variables/pointers
I mean:
CSample obj;
obj.SetParam1(value1);
obj.SetParam2(value2);
...
obj.DoModal ();
So you are passing the parameters before it gets invoked as you said in an answer to RajeshRegards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Nelek wrote: I would use Set/Get methodes to pass parameters, because if you overload the constructor parameters, it may be that the MFC (if you use it) gives you problems if you have an error overloading the constructor. After just use the contructor to initialize the member variables/pointers
Well, it looks to me a super-defensive approach.
[added]
Actually, I suppose I didn't get you. You are right, error handling in class constructor is troublesome.
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hello,
I want to know datatype for "this" pointer in C++.
Can you explain with small example.Abhijit
|
|
|
|
|
There are two ways to look at it:
1. this is a pointer and all pointers are of type ptrdiff_t.
2. Since this is defined for a particular class, its type is the pointer to that class.
-Saurabh
|
|
|
|