473,226 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

Export a generic Class from a DLL - linker error

I want to export a generic Class from a DLL.

I Created two MFC shared dlls. I want to use a class declared in 2nd DLL
from 1st DLL.
1st DLL is created using mfc wizard as MFC shared dll.
Added a class:
class CTestDll2
virtual ~CTestDll();


2nd DLL:
Created using mfc wizard as MFC shared dll. I included the .lib file from
1st DLL in to my 2nd DLL at LINK\INPUT section of the project settings.

I created the instance of the class 'CTestDll2' in 2nd dll.

When I compile, I am getting error (LNK2001: unresolved external symbol
"public:) for the class 'CTestDll2'.

If I add AFX_EXT_CLASS macro to the class, no linker errors.

class AFX_EXT_CLASS CTestDll2
virtual ~CTestDll();


Is it needs to export the class even linking statically?
Is there any way to use the class with qualifying AFX_EXT_CLASS?

Test in .net 2003 and VC++6.0

Thanks in advance.

Jul 21 '05 #1
0 1100

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Edward Diener | last post by:
This has occurred in MC++, but since there is very little response on that NG, I am also reporting it here in the hope that someone can find me a workaround, and report it to MS. If a __value...
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
by: SKC | last post by:
Hi! I want to export a generic Class from a DLL. I Created two MFC shared dlls. I want to use a class declared in 2nd DLL from 1st DLL. 1st DLL is created using mfc wizard as MFC shared...
by: Robert Bogue [MVP] | last post by:
I've got a test harness I've been building and playing with to manage ASP.NET web parts. One thing I've noticed is that I do not seem to be able to reimport the webparts I've exported back on to...
by: steve yee | last post by:
i think c should adapt c++ template standard, as well as namespace. if so, c can replace c++ in many cases.
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
by: Steven T. Hatton | last post by:
<quote url="http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=53&rl=1"> exported Templates Last updated Sep 6, 2006. exported Templates The separate compilation model enables...
by: michael | last post by:
Hi All, Not sure if this is a c++ issue or a compiler issue. I have the following in a class: template<class T> bool Utility::getInput(T& i, T low, T up){ bool result = false; if(cin >i){
by: Jeffrey Walton | last post by:
Hi All, Sorry about dropping thish on M.P.D.L.CSharp. There is no M.P.D.L.VC. So I hope someone has come across the issue... How does one export a function (not a class) in a managed Dll? ...
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.