|
I don't know how to fix your problem with __declspec but the link error goes away when you don't __declspec and do inline because the code now resides in the EXE not in the DLL. The inline has asked the compiler to compile the code into the current compilation unit which is the EXE's source file. The compiler has obviously honored your inline request (it has the option not to). Since the compiled code is now in the EXE (not the DLL), the linker can find it successfully. If you change your DLL implementation, the EXE will not be using the new implementation since it has its own copy of the code compiled into itself.
Judy
|
|
|
|
|
I appreciate your point and totally agree with it, but following the rules, no function or class in a dll (not static library) would be available to any other application or other dll, if ,and unless if, the function or class is exported using either of the two exporting methods available. In my case, the class is not exported but is available to my exe.
Love is the illusion that one kiss is different from another. - e.m
|
|
|
|
|
Maybe the inconsistency is in your thoughts:
Do you really think a DLL can export a template class (without specializations)?
See, for instance, here [^].
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
|
|
|
|
|
Hi, folks!
I've built a library file, but it does not seems to have all of what I want in it. How can I view what function names are exported from my library?
TIA!
'til next we type...
HAVE FUN!! -- Jesse
|
|
|
|
|
Have a look at C/C++ Build Tools [^], LIB and DUMPBIN look promising.
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
|
|
|
|
|
Iain,
Thanks for the pointers. I figured out what my problem was: it's been too long since i've built a library and I forgot to mark the exportable functions as __declspec(dllexport). My bad!
'til next we type...
HAVE FUN!! -- Jesse
|
|
|
|
|
BTW: I'm not Iain (and neither Alfonso the Wise... )
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
|
|
|
|
|
Oh it seems that somebody doesnt like of your reply that you are not Iain.
|
|
|
|
|
Oh I don't bother about down voting: I've a lot of friends
BTW I'm sorry, but no Vivaldi in my (very poor indeed) classical music collection.
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
|
|
|
|
|
Not problem,thanks.
|
|
|
|
|
Hamid. wrote: that somebody doesnt like of your reply that you are not Iain
then he can respond to me directly
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
You may have a superb reason why you are not Iain, but that went on his arrogant assumptions.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Right.
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
|
|
|
|
|
CPallini wrote: and neither Alfonso the Wise...
Ok, from now on I will call you Alfonso. Do you agree with that Alfonso ?
|
|
|
|
|
All or nothing: Alfonso the Wise!
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
|
|
|
|
|
I am bit late to collect a vote , I am your friend alfonso , may be thats going on my arrogant assumptions.
|
|
|
|
|
Rajkumar R wrote: I am bit late to collect a vote
It's (almost ) never too late.
Rajkumar R wrote: I am your friend alfonso [Rose] , may be thats going on my arrogant assumptions.
Well, if you like to be my friend don't use my friendly name alfonso , use instead the fully-featured one: Alfonso the Wise.
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
|
|
|
|
|
I think "Pallini the wise" best match.
|
|
|
|
|
I am trying to use a CFrameWnd in my code and I keep getting an assertion error when I try to ShowWindow(SW_SHOW);
CWnd * tempWnd = new CWnd();
tempWnd->Attach(p_adsw_hwndAcad);
CFPLvlLyrWnd *mWnd = (CFPLvlLyrWnd*)(RUNTIME_CLASS(CFPLvlLyrWnd))->CreateObject();
RECT sizze = CFrameWnd::rectDefault;
DWORD dwStyle = WS_OVERLAPPEDWINDOW;
if (mWnd->Create(NULL, "Levels/Layers", dwStyle, sizze, tempWnd, MAKEINTRESOURCE(0) ))
{
mWnd->m_parentWHandle = p_adsw_hwndAcad;
tempWnd->BeginModalState();
mWnd->ShowWindow(SW_SHOW);
}
else
{
AfxMessageBox("LoadFrame failed!");
}
HWND tempHandle = tempWnd->Detach();
delete(tempWnd);
This will run in VS 6.0 but in VS 2005 I get an assertion error and the program crashes. What could be the problem?
Help me Obi-Wan Kenobi, you're my only hope!
|
|
|
|
|
LeonardLay wrote: ...I get an assertion error...
What line of what file is asserting?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The assertion error is in
File: f:\rtm\vctools\vc7libs\ship\atlmfc\src\mfc\winfrm.cpp
Line: 942
|
|
|
|
|
|
mWnd->ShowWindow(SW_SHOW);
When it gets to this point, the assertion error appears. I stepped into the code for ShowWindow and when it calls the AfxGetThread() it returns a NULL then it gives the assertion error because the return should not be NULL.
|
|
|
|
|
Show us the code that contains the ASSERT !
Steve
|
|
|
|
|
LRESULT CFrameWnd::OnActivateTopLevel(WPARAM wParam, LPARAM lParam)
{
CWnd::OnActivateTopLevel(wParam, lParam);
ExitHelpMode();
#ifndef _AFX_NO_OLE_SUPPORT
if (m_pNotifyHook != NULL)
{
m_pNotifyHook->OnActivate(
LOWORD(wParam) != WA_INACTIVE && !HIWORD(wParam));
}
#endif
CWinThread *pThread = AfxGetThread();
ASSERT(pThread);
if (pThread->m_pMainWnd == this)
{
CView* pActiveView = GetActiveView();
if (pActiveView == NULL)
pActiveView = GetActiveFrame()->GetActiveView();
if (pActiveView != NULL)
pActiveView->OnActivateView(FALSE, pActiveView, pActiveView);
}
|
|
|
|