|
Output window is like this
‘Test.exe’: Loaded 'C:\Windows\System32\ntdll.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\kernel32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\user32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\gdi32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\advapi32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\rpcrt4.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msimg32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\comdlg32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msvcrt.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\shlwapi.dll'
‘Test.exe’: Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18005_none_5cb72f96088b0de0\comctl32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\shell32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\winspool.drv'
‘Test.exe’: Loaded 'C:\Windows\System32\oledlg.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\ole32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\oleaut32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\winmm.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\oleacc.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\imm32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msctf.dll'
‘Test.exe’: Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.6002.18005_none_9e50b396ca17ae07\GdiPlus.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\lpk.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\usp10.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\uxtheme.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\dwmapi.dll'
Detected memory leaks!
here i found Detected memory leaks!,but i dont know how can get the location of this memory leak,
how can get at which porint or on wich function memory leaks.
please help me for this.
thanks.
|
|
|
|
|
Usually the line "Detected memory leaks!" is not last... Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
like this.
‘Test.exe’: Loaded 'C:\Windows\System32\ntdll.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\kernel32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\user32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\gdi32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\advapi32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\rpcrt4.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msimg32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\comdlg32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msvcrt.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\shlwapi.dll'
‘Test.exe’: Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18005_none_5cb72f96088b0de0\comctl32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\shell32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\winspool.drv'
‘Test.exe’: Loaded 'C:\Windows\System32\oledlg.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\ole32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\oleaut32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\winmm.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\oleacc.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\imm32.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\msctf.dll'
‘Test.exe’: Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.6002.18005_none_9e50b396ca17ae07\GdiPlus.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\lpk.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\usp10.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\uxtheme.dll'
‘Test.exe’: Loaded 'C:\Windows\System32\dwmapi.dll'
‘Test.exe’: Unloaded 'C:\Windows\System32\dwmapi.dll'
The thread 'Win32 Thread' (0x16fc) has exited with code 1 (0x1).
Detected memory leaks!
Dumping objects ->
{235} normal block at 0x00F66728, 145 bytes long.
Data: < d > C0 15 9D 01 64 00 00 00 80 00 00 00 01 00 00 00
{227} normal block at 0x00F666D8, 20 bytes long.
Data: < > C0 15 9D 01 03 00 00 00 03 00 00 00 01 00 00 00
{226} normal block at 0x00F66640, 85 bytes long.
Data: < D D > C0 15 9D 01 44 00 00 00 44 00 00 00 01 00 00 00
{225} normal block at 0x00F66598, 103 bytes long.
Data: < V V > C0 15 9D 01 56 00 00 00 56 00 00 00 01 00 00 00
Object dump complete.
The program '[4540] Test.exe: Native' has exited with code 0 (0x0).
|
|
|
|
|
Just double click at {XXX} Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
you mean double click on {235},
nothing happen when i double click on this.
|
|
|
|
|
Please include:
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
at the beginning of each *.cpp in you project, after their "iclude section" Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
|
The sources will be presented in the output window (to double click)
only if it (see above) is included
Please check other sources Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
Hi Experts.
I'm new in Mfc.
In c# I cloud easily add new form to my application and show it.
At first step in Mfc I need to add some dialog to my application and then from some menu or button command display it.
But I mixed to how do it?
Thanks for your kinds.sepel
|
|
|
|
|
From 'View' Menu Choose to see Resource 'View Panel' in your IDE
In the Resource View Panel Expand Items and right click the Dialog Branch and Choose 'Add Resource' and press New Button of add Resource Dialog.
After your dialog has created you can see it in Resource Designer when ever you want by Double Clicking on it in Resource View Panel.
After You do all these Right Click on your Dialog in Resource Designed and choose 'Add Class'
fill the class field with a name (e.g. "CTemp1Dlg")and before Finishing the wizard attention the names of .Cpp File and .h file which is created for you through wizard (here : Temp1Dlg.h and Temp1Dlg.cpp)
now include the Temp1Dlg.h File created in previous step in your Code which you want to Modal your Dialog.
in the method you want to Modal your Dialog write the below code:
CTemp1Dlg dlgMyDialog(this);
dlgMyDialog.DoModal();
|
|
|
|
|
It works !.
Thanks Amir.
Dear Amir,I have some expert in C# and now I migrate to mfc for some interesting and some works !.
Can I ask you guide me to some books or another resource to help me learn mfc better( and quick)?
Best Regardssepel
|
|
|
|
|
Ok Please Don't hesitate to ask any question ,But I could not promise if I could answer them all.
Here is a list of update books you may like to use, How ever mostl of MFC guide books found in the net are old ones but they could be useful too because the bases are the same:
http://msdn.microsoft.com/en-us/visualc/dd721903.aspx[^]
By the way for those who are new to MFC, How Do I? Video Series[^] would be interesting.
|
|
|
|
|
So Helpful.
Thanks again.sepel
|
|
|
|
|
Can I design application like no debugger gets the information from it.
|
|
|
|
|
1- build in RELEASE more
2- don't waste time on that issue because if your application is worthy enough, crackers/hackers will break it.
other than that, can you explain what you want, or what information you do not want people to see ?Watched code never compiles.
|
|
|
|
|
I'm working a _little bit_ with Visual C++ (Visual Studio 2005) but it is not a language I'm familiar with! I have a funtion that needs to take a char* parameter (non unicode) but inside that function I need to work with the data passed in as LPCSTR. I have found quite a few options to convert from LPCSTR to char* but not the other way around.
I have:
myfunction (char* param1)
{
LPCSTR p1;
}
How do I get the value of param1 into p1?
Thanks in advance
Best regards,Arnor Baldvinsson
|
|
|
|
|
I believe that LPCSTR is just const char *, so there is no conversion necessary. Just try:
LPCSTR p1 = param1;
Now, since p1 is a pointer to const, what it points to can not be changed through it.
Going the other way is an issue because what is being pointed to is presumably const, so you should not point a pointer-to-non-const to it. That would break the do not alter rule. So conversion isn't really the issue, but rather making an alterable copy of the original.
Now, if unicode was involved on one side but not the other, ... but that's not your question. Please do not read this signature.
|
|
|
|
|
Thank you Avi for a very quick response. I think I have this under control now
Best regards,
|
|
|
|
|
Hi,
How could I change the CMFCPropertyGridCtrl Property Column or Value column width?
a sample code would be more useful
|
|
|
|
|
How do you do a extern type declaration for this. At link time I get unresolved external symbol "public: static void__cdecl etc. etc.
I'm trying to expand my use of C++ to envelop static functions inside of classes as a way to help organize the code a bit better.
|
|
|
|
|
this worked for me:
class A
{
public:
static void g(int)
{
int i = 0;
}
};
typedef void (*fp)(int);
int _tmain(int argc, _TCHAR* argv[])
{
fp p = A::g;
p(1);
return 0;
}
|
|
|
|
|
class MyClass
{
static INT m_i;
};
__declspec(selectany) INT MyClass::m_i;
or
INT MyClass::m_i;
cheers,
ARWhen the wise person points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
Static member functions usage:
MyClass.h:
class MyClass
{
public:
static int fcn( int param );
static int inlineFcn( int param) )
{
};
};
MyClass.cpp:
#include "Myclass.h"
int MyClass::fcn( int param )
{
}
Client.cpp:
#include "Myclass.h"
void clientFcn( int a, int b )
{
int c = MyClass::fcn( a );
int d = MyClass::inlineFcn( b );
}
It sounds to me that another approach might be more suitable for your purposes. I'll post that next.Please do not read this signature.
|
|
|
|
|
Alan Kurlansky wrote: a way to help organize the code a bit better
It sounds to me like you want the organization, but what you are doing is not truly about classes and object orientation. There is another facility in C++, namespaces, that may be more appropriate for your current use. It organizes things in groups and helps avoid naming conflicts, but does not raise the "object" expectations of someone reading your code.
In some ways using namespaces looks a lot like what I posted for static member functions.
This is how you might use namespaces:
Group.h:
namespace Group
{
int fcn( int param );
inline int inlineFcn( int param) )
{
};
}
Group.cpp:
#include "Group.h"
namespace Group
{
int fcn( int param )
{
}
}
Client.cpp:
#include "Group.h"
void clientFcn( int a, int b )
{
int c = Group::fcn( a );
int d = Group::inlineFcn( b );
}
AlternateClient.cpp:
#include "Group.h"
using namespace Group;
void altClientFcn( int a, int b )
{
int c = fcn( a );
int d = inlineFcn( b );
} Please do not read this signature.
|
|
|
|
|
Yes, organization is what I'm looking to do in this case. This looks good. I'll give this a try. Thanks
|
|
|
|