|
Hello Richard,
Thanks for your input. I've include the headers in the DLL project
#include <map>
#include <vector>
#include <set>
#include <list>
using namespace std;
Is ther any error on my implementation on the DLL exporting? Is it a right way to make DLL proj to export derived class like what I do ? It is the first time that I do it like this.
Richard MacCutchan wrote: Well we will have to guess what they are. It may be that you are not adding a using statement in your client project before the inclusion of the class containing the STL members. Alternatively you could add the full definitions in your headers like this:
CMyDLLClass1 : public CInterfaceClass
{
public:
CMyDLLClass1 (){};
virtual ~ CMyDLLClass1 (){};
virtual int Func1();
virtual int Func2();
virtual int Func3();
private:
std::vector<...> ....
std::map<...> ....
}
Did you notice how I also used
tags to make the code snippet more readable?
|
|
|
|
|
This is fine but have you include all the correct headers (and reference to std namespace) in the class that is linking to the DLL, i.e the code that will be using the DLL. Remember that classes and methods exported from a DLL are visible to the linker not the compiler.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Thanks.
Yes. In the client project linking to the DLL, the client project include the DLL interface head file like this.
#include "MyExprotDllHead.h"
Now the issue is still pending. And so many new failure report and reported in STL allocation procedure.
I'm trying my best to find out the root cause.
Richard MacCutchan wrote: This is fine but have you include all the correct headers (and reference to std namespace) in the class that is linking to the DLL, i.e the code that will be using the DLL. Remember that classes and methods exported from a DLL are visible to the linker not the compiler.
|
|
|
|
|
Fantastic! And what does that include file contain?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Include all the STL head files which are shared by the DLL and the client proj. And all the data structure of the DLL proj and all the data struct will be used by the cilent proj too. I'm trying ...
|
|
|
|
|
It looks like you have problems with the STL library, not DLL issues.
You should post the errors and (as Richard pointed out) the relevant code for getting better help.
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, Cpallini
I am trying to find out some clue here... I am confused now... What's wrong with my code or proj? And the STL support headers are all included and employeed its namespace too.
CPallini wrote: It looks like you have problems with the STL library, not DLL issues.
You should post the errors and (as Richard pointed out) the relevant code for getting better help
|
|
|
|
|
We can't just guess based on your description, we need facts code and error messages, Watson!
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]
|
|
|
|
|
Oh... I am trying to catch the error. But I found it is uncertain and not repeatable..
Try to find more and report later ...
|
|
|
|
|
What about the code & error message?
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]
|
|
|
|
|
In order to use the CInterfaceClass in another DLL, as a base class, you need to export this class first.
|
|
|
|
|
Really? I've make the interface class as one interface class with all functions of pure virtual property. It says it is an abstract class only. It seems not required to export it with the DLL's derived class. Right?
Nisamudheen wrote: In order to use the CInterfaceClass in another DLL, as a base class, you need to export this class first.
|
|
|
|
|
hi
what's the best method to get the currently active child frame window/ currently active view/ or document?
consider we're in one of children of main frame or their children and have no access to any window.
|
|
|
|
|
Here is what use in my MDI applications:
CMDIFrameWnd* pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd* pChild = (CMDIChildWnd*)pFrame->GetActiveFrame();
CMyView* pView = (CMyView*)pChild->GetActiveView();
CMyDoc* pDoc = (CMyDoc*)pChild->GetActiveDocument();
|
|
|
|
|
oh thanks!
i was mistaking:
CFrameWnd *pFrameWnd = GetTopLevelFrame();
CView *pView = pFrameWnd->GetActiveView();
and i wondered why it returned NULL. now i changed it into:
Ct2View *AcToolCtrl::pr_getActiveView()
{
CView *pView = GetTopLevelFrame()->GetActiveFrame()->GetActiveView();
ASSERT_KINDOF(Ct2View, pView);
return (Ct2View *)pView;
}
and it worked.
|
|
|
|
|
Hi,
this message window pop up in my application.
and point out on free.c
on this location
retval = HeapFree(_crtheap, 0, pBlock);
if (retval == 0)
{
errno = _get_errno_from_oserr(GetLastError());
}
and the call stack is
ntdll.dll!77c90004()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!77d2cad0()
ntdll.dll!77ce7a57()
ntdll.dll!77cbb0cd()
ntdll.dll!77cbafd8()
ntdll.dll!77caa5a4()
kernel32.dll!764e3f01()
kernel32.dll!764e3f01()
> Test.exe!free(void * pBlock=0x3cba86c8) Line 110 C
Test.exe!CMemFile::Free(unsigned char * lpMem=0x3cba86c8) Line 118 + 0x8 bytes C++
Test.exe!ATL::CStringData::Release() Line 113 C++
Test.exe!ATL::CSimpleStringT<char,0>::operator=(const ATL::CSimpleStringT<char,0> & strSrc="10022*Socket Error") Line 300 C++
Test.exe!CSmtp_Mon_Thread::SmtpResponseThread(ATL::CStringT<char,StrTraitMFC<char,ATL::ChTraitsCRT<char> > > URL_Name="http://dofev.de", unsigned int Port=1018857688) Line 155 + 0x1d bytes C++
Test.exe!CSmtp_Mon_Thread::OnSmtpTimer(unsigned int idEvent=7843, long dwTime=15468593) Line 69 C++
Test.exe!CWinThread::DispatchThreadMessageEx(tagMSG * pMsg=0x083eb828) Line 771 C++
Test.exe!AfxInternalPreTranslateMessage(tagMSG * pMsg=0x083eb828) Line 227 + 0xd bytes C++
Test.exe!CWinThread::PreTranslateMessage(tagMSG * pMsg=0x083eb828) Line 777 + 0x8 bytes C++
Test.exe!AfxPreTranslateMessage(tagMSG * pMsg=0x083eb828) Line 255 C++
Test.exe!AfxInternalPumpMessage() Line 178 + 0xf bytes C++
Test.exe!CWinThread::Run() Line 629 + 0x7 bytes C++
Test.exe!_AfxThreadEntry(void * pParam=0x0033eef8) Line 126 C++
Test.exe!_callthreadstartex() Line 348 + 0x6 bytes C
Test.exe!_threadstartex(void * ptd=0x07e35898) Line 326 + 0x5 bytes C
kernel32.dll!764eeccb()
ntdll.dll!77cfd24d()
ntdll.dll!77cfd45f()
please help me.
|
|
|
|
|
Looks like something wrong is happen in a library, resulting in a multiple deletion of a block, of in an access to an already delete piece of memory.
Probably, upon a previous message handling, you deleted something the library still needs.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
please tell me how can i resolve it
|
|
|
|
|
The only thing I can see from your information is that HeapFree fails (what was the text of the message ???) when invoked by a number of library function that are in consequence to the OnSmtpTimer invocation, that -at certain point- assign and destroy a CMemFile that is no more there.
What does all that to happen, I don't know.
I don't see your code, your screen, your mind!
I can only suggest to investigate about what was OnSmtpTimer trying to assign and verify if (and where) something else destroyed it before. That's what debuggers are for.
Does "http://dofev.de" and "10022*Socket Error" means something to you?
Probably a CMemFile is attempted to be deleted after that point (look like after a socket connection failed). But ... it seems it is no more there. Probably it is something related a previous iteration of the message loop (so it is not on the stack anymore ...)
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Hi
i got function name and argument type from UnDecorateSymbolName() method using vc++ MAP file. But i want how to argument names with using VC++ MAP file?
any idea please?
Regards,
M.Mathivanan
|
|
|
|
|
|
Have you looked in a .map file to see what it contains? If you had you'd have found the following things:
- They're simple text files
- They contain the addresses of things assigned by the linker and (usually) the size of those things
- They don't contain (unless I completely missed it a couple of weeks ago when I last had to look in one) names of function parameters.
Information about parameter names is not generally available to the linker as the compiler sorts out the mapping of argument names to position on the stack/register assignment, the linker doesn't have to know it.
I've no idea what you need this information for but remember C++ is a compiled language that, unlike Java, doesn't support any sort of type reflection or introspection. If you want to find out names of parameters your best bet is to look in something that's generated for a debugger - e.g. a .pdb file under VC++ and use something like the Debug Information Access API (which I've only glanced at, it might be rubbish, I can't comment).
Cheers,
Ash
|
|
|
|
|
Thank you for your information
Regards,
M.Mathivanan
|
|
|
|
|
I want to use wxWidgets to develop UI,and use it in MFC.
Thank you gurus.
|
|
|
|
|