|
SehllExecute or CreateProcess are helpfuls for you.
|
|
|
|
|
I have created the dll project, this dll needs other two dll, and
I want to finally provide only one dll(the one generated from this dll project, and hopefully the other two dll can merge in this dll),how should I do?
It seems the directly genrated dll is not ok.
|
|
|
|
|
Do you have source code for all the dlls??
Regards,
Sandip.
|
|
|
|
|
no.
this problem really make me annoying.
do you have any suggestions.?
|
|
|
|
|
No then you cant merge them in to one dll no sugessitions also
you have to distribute three dlls.
Just check incase if these dlls support static linking like MFC then you wont need to distribute all dlls.
Regards,
Sandip.
|
|
|
|
|
But I think its better you dont merge them.
|
|
|
|
|
//MFC Single doc Exe
#ifdef _DEBUG
CMemoryState oldMemState,
newMemState, diffMemState;
#endif
void CLeakTestView::OnDraw(CDC* pDC)
{
CLeakTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
//noting
#ifdef _DEBUG
newMemState.Checkpoint();
if(diffMemState.Difference(oldMemState,newMemState))
{
TRACE("Memory Is Leaking!!! \n\n");
diffMemState.DumpStatistics();
}
#endif
}
int CLeakTestView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
#ifdef _DEBUG
oldMemState.Checkpoint();
#endif
return 0;
}
output:(Total allocations are increasing when ondraw)
0 bytes in 0 Free Blocks.
434 bytes in 11 Normal Blocks.
0 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
672 bytes in 4 Client Blocks.
Largest number used: 1374 bytes.
Total allocations: 11950 bytes.
Memory Is Leaking!!!
0 bytes in 0 Free Blocks.
434 bytes in 11 Normal Blocks.
0 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
672 bytes in 4 Client Blocks.
Largest number used: 1374 bytes.
Total allocations: 12170 bytes.
Memory Is Leaking!!!
0 bytes in 0 Free Blocks.
434 bytes in 11 Normal Blocks.
0 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
672 bytes in 4 Client Blocks.
Largest number used: 1374 bytes.
Total allocations: 12390 bytes.
Memory Is Leaking!!!
0 bytes in 0 Free Blocks.
434 bytes in 11 Normal Blocks.
0 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
672 bytes in 4 Client Blocks.
Largest number used: 1374 bytes.
Total allocations: 12610 bytes.
The thread 0xD0C has exited with code 0 (0x0).
|
|
|
|
|
USE oldMemState.DumpAllObjectsSince(); to find which all objects are leaking.
Regards,
Sandip.
|
|
|
|
|
Dumping objects ->
strcore.cpp(118) : {119} normal block at 0x00375B58, 17 bytes long.
Data: < > 01 00 00 00 04 00 00 00 04 00 00 00 BE CD D0 F7
strcore.cpp(118) : {98} normal block at 0x00375838, 19 bytes long.
Data: < > 01 00 00 00 06 00 00 00 06 00 00 00 CE DE B1 EA
array_p.cpp(110) : {96} normal block at 0x003757E0, 20 bytes long.
Data: < xJ7 > 00 00 00 00 78 4A 37 00 00 00 00 00 CD CD CD CD
array_p.cpp(71) : {95} normal block at 0x00375798, 4 bytes long.
Data: < > 00 00 00 00
winfrm2.cpp(66) : The thread 0x23C has exited with code 0 (0x0).
|
|
|
|
|
If you use the debugging version of new then you can get file/line number
information that can help you find the line of code making the allocation(s)
that aren't being freed.
Add something like this to the top of all your source files...
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
In Visual Studio .Net ,Why we r using #using <mscorlib.dll> this dll ?Is there any advantages for using that DLL?
Thanks & Regards
Nisha.S
|
|
|
|
|
nisha00000 wrote: In Visual Studio .Net ,Why we r using #using this dll ?Is there any advantages for using that DLL?
What are you talking about?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Answering on National Day: you're addict (or possibly you're not Italian )!
More drugz plz plz!
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
|
|
|
|
|
Say what? There are actually Italians that are making posts too, on this National day! Talk about the C++ MFC addicted polyglot.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hey man, Wish you a very very Happy National Day.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thank you very much.
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 Wishes too.
|
|
|
|
|
Thanks Rajkumar
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
|
|
|
|
|
Well see this code
Mynamespace.Myclass.MyMythod a=new Mynamespace.Myclass.MyMythod();
but if you use of #using you will have this code:
#using Mynamespace
Myclass.MyMythod a=new Myclass.MyMythod();
|
|
|
|
|
I have created the Test SDI application with MfcAppWizard(exe).
I run the appication an it's showing me default window.
It has default window color as RGB(192,192,192). But I want to change it to some different color for better look.
How can I change it's defauld color for my application so that all window forms, dialog boxes, tool bars, menus, etc having some new default colors like sky blue or somthing else.
Please help me regarding this.
|
|
|
|
|
I guess you have to handle it separately for every window by handling WM_CTLCOLOR.
Regards,
Sandip.
|
|
|
|
|
You can use o WM_CTLCOLOR however you can use of WM_PAINT or WM_ERASEBK...
|
|
|
|
|
Hi all,
I want to write a xml file to send some data. What I tried is write data to a temporary file, then attach it to a buffer and do the processing.
long CCreateXML::CInitialElements(void)
{
TCHAR szTempFile[MAX_PATH];
HRESULT hr;
CComPtr<istream> pOutFileStream;
if(!::GetTempFileName("C:\\", "rf", 0, szTempFile))
{
return -1;
}
if(FAILED(hr = SHCreateStreamOnFile(szTempFile, STGM_CREATE | STGM_WRITE, &pOutFileStream)))
{
return -1;
}
return 0;
}
</ixmlwriter></ixmlwriteroutput></istream>
I got a link error at the beginning and wried it me. Can you guys tell me where I'm going wrong.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: I got a link error at the beginning
Providing the exact error message would be helpful
I would guess your project needs to link to shlwapi.lib to use
SHCreateStreamOnFile().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|