|
When i run the application read from excel file and add values in CListCtrl.That time i am getting this message.
Yes you are right i have memory leak problem in application.
Please help me
|
|
|
|
|
As I said in my previous answer, please show us the exact message you receive, it is impossible for us to guess what it might be. You should also show an extract of the code where the error occurs.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
hello sir
i am getting this "A required resource was" nothing more.
|
|
|
|
|
This is like trying to get blood out of a stone!
State exactly where you get this message, in a popup window, from your application, from the compiler, from some other program ... If it is in a popup window then show both the title of the window and the message.
If it comes from your program then show the code where the error occurs.
Remember, we cannot see your screen when you get this problem so we have absolutely no way of knowing where this message is coming from.
OK I did some research myself and found this:
He doesn't run out of memory, but of GDI resources. It is possible to encounter a situation, where (let's say) 500 MB of memory are free, but no further GDI objects (icons, fonts, brushes, DCs, etc.) can be allocated. At this point it's possible that menus don't open anymore, icons disappear, toolbars disappear, texts are written with wrong fonts, etc. ...or even worse...
This is usually due to an application which allocates GDI objects, but doesn't free them correctly. Because GDI objects are limited and managed globally (not locally for each application), a buggy application can affect the whole system.
Given that you have admitted you have a memory leak in your program I suspect you may also have an issue with unreleased GDI objects. I suggest you go back and inspect your code to see if this is the problem.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Thanks for your vital information.
Can you tell how can i check GDI resources leak?Please help me
|
|
|
|
|
Take a look at your program and see what resources you are using (Fonts, Brushes, Bitmaps etc) and whether you are correctly disposing of them when finished. This is basic Windows programming that you really need to study and understand.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Was what?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
MsmVc wrote: Application show "A required resource was" this message.
When exactly does it do this? Note: A response such as, "When the app is running." is not a useful answer.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
David, I Googled that exact message and found a few hits, strangely enough. See my last response to the OP.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I am very new to putting inheritance into practice, so please treat me gently ! I am trying to create a new class CTimeEx to provide extra functions to CTime. The problem is that from the client’s point of view, the derived class doesn’t seem to be initialised.
My derived class definition is :-
class CTimeEx : public CTime
{
public:
CTimeEx();
CTimeEx(const CTime& TimeIn) : CTime(TimeIn) {};
….
And my client invocation is :-
CTime timeCurrent(CTime::GetCurrentTime());
CTimeEx timeExTest(timeCurrent);
When I trace through the calls, I see the base class contructor being called with timeCurrent, but when initialisation of the derived class completes, the time value for the CTimeEx object is still in it’s uninitialised state.
I’m sure that I’m probably doing something very stupid, but, having struggled with it for quite some time, I now need someone elses advice !! Thanking you in advance !
Doug
|
|
|
|
|
Could you please post the complete code of your class, using the 'code block' button?
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]
|
|
|
|
|
Hi, I've found the reason for my original problem, but let me explain. I was originally trying to get operator= function coded, but was floundering and trying various things. For some daft reason, at some stage, I included a private variable m_time of type time in the derived class and this (of course !) was causing the initialisation problem. However, I am still left with the problem of how to deal with operator= !!
I've included my class below (hopefully in a code block - never done this before !)
<pre>// TimeEx.h: interface for the CTimeEx class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_TIMEEX_H__48005666_3D56_42ED_8ADD_8F9B119E194D__INCLUDED_)
#define AFX_TIMEEX_H__48005666_3D56_42ED_8ADD_8F9B119E194D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CTimeEx : public CTime
{
public:
CTimeEx();
CTimeEx& CTimeEx::operator=(const CTimeEx& timeSource);
CTimeEx(const CTime& TimeIn) : CTime(TimeIn) {};
virtual ~CTimeEx();
};
#endif // !defined(AFX_TIMEEX_H__48005666_3D56_42ED_8ADD_8F9B119E194D__INCLUDED_)
// TimeEx.cpp: implementation of the CTimeEx class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Test_Inhehitancy.h"
#include "TimeEx.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CTimeEx::CTimeEx()
{
}
CTimeEx::~CTimeEx()
{
}
CTimeEx& CTimeEx::operator=(const CTimeEx& timeSource)
{
// ?????????
}
</pre>
Doug
|
|
|
|
|
Are you looking for:
CTimeEx & CTimeEx::operator=(const CTimeEx & timeSource)
{
CTime::operator=(timeSource);
return *this;
}
?
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]
|
|
|
|
|
Thank you so much !!
I now ask myself WHY I couldn't see this !! (It always seems obvious after someone has showed you, doesn't it !)
Thanks again !
Doug
|
|
|
|
|
You are welcome.
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]
|
|
|
|
|
Where do you save the time value that you send to your constructor?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi Richard, As you can see from an earlier message on the thread, I had accidently tripped myself up ! I'm all sorted now - thanks anyway !
Doug
|
|
|
|
|
Hi all,
i execute my application when it run for some time i found the icon of message box not display.
if i execute it again after stop its works fine.
now what can i do.
thanks in advance.
|
|
|
|
|
Le@rner wrote: what can i do
either fix your bug yourself, or provide sufficient information so somebody can actually help you.
|
|
|
|
|
Le@rner wrote: now what can i do.
Be a little clearer in your explanation. For example, how are you calling MessageBox() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
like this
MessageBox(_T("Hello"),_T("Message"),MB_ICONINFORMATION);
|
|
|
|
|
There one c++ project call a web service(WAR package), the WAR package call a JNI DLL(java native code, write by c++) I want to debug this JNI dll. But I donot know how to goto the debug code.
|
|
|
|
|
Hi,
I have only vc++ project file(.dsp). i want all cpp file function name in this project(.dsp) file. It is possible?
if possible please give sample code or url
Regards,
M.Mathivanan
|
|
|
|
|
if you would have opened .dsp file in a notepad or something like that, probably you would have understood what all you can get from it.
|
|
|
|
|
In my case, I want to create one interface class and use it to employee the drived class implementation. The sample codes are as follows.
CInterfaceClass
{
public:
CInterfaceClass(){};
virtual ~CInterfaceClass(){};
virtual int Func1() = 0;
virtual int Func2() = 0;
virtual int Func3() = 0;
}
And the interface class will be used the DLL project and the client project.
Here the drived class in the DLL project and it will be exported and be used by the client project:
CMyDLLClass1 : public CInterfaceClass
{
public:
CMyDLLClass1 (){};
virtual ~ CMyDLLClass1 (){};
virtual int Func1();
virtual int Func2();
virtual int Func3();
private:
vector<...> ....
map<...> ....
}
And another DLL project may like this...
CMyDLLClass2 : public CInterfaceClass
{
public:
CMyDLLClass2 (){};
virtual ~ CMyDLLClass2 (){};
virtual int Func1();
virtual int Func2();
virtual int Func3();
private:
vector<...> ....
map<...> ....
}
In the client project, I want to use the exported class like this.
CInterfaceClass* pMyDllClass1 = new CMyDLLClass1();
pMyDllClass1->Func1();
pMyDllClass1->Func2();
pMyDllClass1->Func3();
CInterfaceClass* pMyDllClass2 = new CMyDLLClass2();
pMyDllClass2->Func1();
pMyDllClass2->Func2();
pMyDllClass2->Func3();
It seems that I can enter the functions. But many errors come out with STL members. I am confused on this usage of DLL.
Could you pls give your help on this ?
modified on Monday, November 22, 2010 7:57 PM
|
|
|
|