Click here to Skip to main content
16,011,870 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionmodem connection RAS or TAPI or ??? Pin
20-Mar-02 5:57
suss20-Mar-02 5:57 
AnswerI'm too Pin
dlhson20-Mar-02 6:07
dlhson20-Mar-02 6:07 
Questionhow to get a process name attached to a given udp port ? Pin
20-Mar-02 5:45
suss20-Mar-02 5:45 
Generala strange debug error Pin
Gérald Mercet20-Mar-02 5:04
Gérald Mercet20-Mar-02 5:04 
GeneralRe: a strange debug error Pin
Joaquín M López Muñoz20-Mar-02 7:34
Joaquín M López Muñoz20-Mar-02 7:34 
GeneralRe: a strange debug error Pin
Gérald Mercet21-Mar-02 3:06
Gérald Mercet21-Mar-02 3:06 
GeneralNeed HELP - Linking DLL with TEMPLATE Pin
20-Mar-02 5:04
suss20-Mar-02 5:04 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
Joaquín M López Muñoz20-Mar-02 7:30
Joaquín M López Muñoz20-Mar-02 7:30 
Hello Frederic.

The good news: You can use templates exported thru a DLL.
The bad news: You must know in advance for which particular types the template class is going to be used.

The procedure is as follows (I'll use your template class instantiated for ints): In some .cpp in your DLL, explicitly instantiate the template like this:
template class__declspec(dllexport) Element<int>;
This produces the actual code for Element<int>. Now, in the header file add this:
extern template class __declspec(dllimport) Element<int>;
which tells the linker that Element<int> is instantiated somewhere else (extern) and will be linked at run-time from a DLL (__declspec(dllimport)). I hope I haven't made any syntax error. Good luck.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
20-Mar-02 10:11
suss20-Mar-02 10:11 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
Joaquín M López Muñoz20-Mar-02 10:39
Joaquín M López Muñoz20-Mar-02 10:39 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
20-Mar-02 16:53
suss20-Mar-02 16:53 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
Joaquín M López Muñoz20-Mar-02 22:14
Joaquín M López Muñoz20-Mar-02 22:14 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
21-Mar-02 3:21
suss21-Mar-02 3:21 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
Joaquín M López Muñoz21-Mar-02 8:23
Joaquín M López Muñoz21-Mar-02 8:23 
Generalbmp on a dialog Pin
20-Mar-02 3:25
suss20-Mar-02 3:25 
GeneralRe: bmp on a dialog Pin
Rickard Andersson2020-Mar-02 3:31
Rickard Andersson2020-Mar-02 3:31 
GeneralRe: bmp on a dialog Pin
dlhson20-Mar-02 6:51
dlhson20-Mar-02 6:51 
Generalillegal vtable pointer Pin
albean20-Mar-02 3:23
albean20-Mar-02 3:23 
GeneralRe: illegal vtable pointer Pin
albean20-Mar-02 5:27
albean20-Mar-02 5:27 
Generalexecuting older version application in new version Pin
Bhikshapathi Gorantla20-Mar-02 3:13
Bhikshapathi Gorantla20-Mar-02 3:13 
GeneralRe: executing older version application in new version Pin
Bill Wilson20-Mar-02 6:59
Bill Wilson20-Mar-02 6:59 
GeneralRe: executing older version application in new version Pin
Bhikshapathi Gorantla20-Mar-02 18:28
Bhikshapathi Gorantla20-Mar-02 18:28 
GeneralRe: executing older version application in new version Pin
Bill Wilson21-Mar-02 5:25
Bill Wilson21-Mar-02 5:25 
GeneralIPicture Render Embedded Pin
Braulio Dez20-Mar-02 3:03
Braulio Dez20-Mar-02 3:03 
GeneralVisualStudio won't auto re-open files Pin
Steve Kearon20-Mar-02 2:51
Steve Kearon20-Mar-02 2:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.