Click here to Skip to main content
15,915,048 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralTimecode Ruler Problem Pin
chen11-Jul-02 22:47
chen11-Jul-02 22:47 
GeneralRe: Timecode Ruler Problem Pin
benjymous12-Jul-02 2:45
benjymous12-Jul-02 2:45 
GeneralSetting Account name and password for accessing a remote PC Pin
Shibu.V.Nair11-Jul-02 22:21
Shibu.V.Nair11-Jul-02 22:21 
GeneralRe: Setting Account name and password for accessing a remote PC Pin
Prem Kumar11-Jul-02 23:12
Prem Kumar11-Jul-02 23:12 
QuestionHow to use MFC CDialog in a DLL ? Pin
Yo Yo~~11-Jul-02 21:31
sussYo Yo~~11-Jul-02 21:31 
AnswerRe: How to use MFC CDialog in a DLL ? Pin
Rage11-Jul-02 23:07
professionalRage11-Jul-02 23:07 
GeneralRe: How to use MFC CDialog in a DLL ? Pin
Yo Yo~~11-Jul-02 23:47
sussYo Yo~~11-Jul-02 23:47 
GeneralRe: How to use MFC CDialog in a DLL ? Pin
KaЯl12-Jul-02 3:35
KaЯl12-Jul-02 3:35 
GeneralRe: How to use MFC CDialog in a DLL ? Pin
Mel Stober12-Jul-02 7:32
Mel Stober12-Jul-02 7:32 
GeneralRe: How to use MFC CDialog in a DLL ? Pin
Yo Yo~~15-Jul-02 22:26
sussYo Yo~~15-Jul-02 22:26 
GeneralUnix crypt() under windows. Pin
Franz Granlund11-Jul-02 21:30
Franz Granlund11-Jul-02 21:30 
GeneralRe: Unix crypt() under windows. Pin
Martin Ziacek11-Jul-02 23:25
Martin Ziacek11-Jul-02 23:25 
GeneralRe: Unix crypt() under windows. Pin
Franz Granlund12-Jul-02 1:31
Franz Granlund12-Jul-02 1:31 
GeneralRe: Unix crypt() under windows. Pin
Martin Ziacek12-Jul-02 1:46
Martin Ziacek12-Jul-02 1:46 
GeneralRe: Unix crypt() under windows. Pin
Franz Granlund12-Jul-02 2:00
Franz Granlund12-Jul-02 2:00 
GeneralRe: Unix crypt() under windows. Pin
Martin Ziacek12-Jul-02 2:33
Martin Ziacek12-Jul-02 2:33 
GeneralRe: Unix crypt() under windows. Pin
Chris Losinger12-Jul-02 3:20
professionalChris Losinger12-Jul-02 3:20 
GeneralRe: Unix crypt() under windows. Pin
Ravi Bhavnani12-Jul-02 13:50
professionalRavi Bhavnani12-Jul-02 13:50 
GeneralNeed HTML Syntax Hilighting Class Pin
Alex Cramer11-Jul-02 21:03
Alex Cramer11-Jul-02 21:03 
GeneralUser defined C++ template implementations in Windows DLLs using implicit linking Pin
tgeraldino11-Jul-02 18:23
tgeraldino11-Jul-02 18:23 
GeneralRe: User defined C++ template implementations in Windows DLLs using implicit linking Pin
Joaquín M López Muñoz11-Jul-02 20:32
Joaquín M López Muñoz11-Jul-02 20:32 
GeneralRe: User defined C++ template implementations in Windows DLLs using implicit linking Pin
Anonymous11-Jul-02 21:13
Anonymous11-Jul-02 21:13 
GeneralRe: User defined C++ template implementations in Windows DLLs using implicit linking Pin
tgeraldino11-Jul-02 21:16
tgeraldino11-Jul-02 21:16 
I truly appreciate your investigation on the problem #1.

Problem #2: You wanted an sample:

//->TemplateSingleton.hpp

#if !defined( __TEMPLATE_SINGLETON_H_INCLUDED__ )
#define __TEMPLATE_SINGLETON_H_INCLUDED__ )

template< typename BUILD_TYPE >
class TemplateSingleton {
public:
static BUILD_TYPE * build() {
if ( m_builtTYPE == 0 ) {
m_builtTYPE = new BUILD_TYPE;
}
return m_builtTYPE;
}
//->more STATIC API below
protected:
TemplateSingleton() { }
~TemplateSingleton() { }
private:
static BUILD_TYPE * m_builtTYPE; //->Initialized how?->1
};

->1: Like below in the same header file, because it is a template and not a non-template, but outside the class definition?

template < typename BUILD_TYPE >
BUILD_TYPE * TemplateSingleton< BUILD_TYPE >::m_builtTYPE = 0;

OR

->2: Like all static variables defined in the C++ class they must be initialized explicitly in the corresponding .cpp file as such:


//->TemplateSingletonImpl.cpp

#include "TemplateSingleton.hpp"

template < typename BUILD_TYPE >
BUILD_TYPE * TemplateSingleton< BUILD_TYPE >::m_builtTYPE = 0;


By the way could you give a small sample for the first question I posed to you about designing user defined template classes in DLLs for example with a trivial class named Foo<>?

By the way, how can I say make a DLL named DLL_X that depends on DLL_Y for functions it needs to call on and have DLL_Y depend on DLL_X for functions it needs to call on from ? In other words mutually dependent DLLs, do I need to write a DEF file? Or can I still use the extern "C" __declspec( dllexport/dllimport ) syntax as you stated in reply numero uno? Are there any small samples here as well that you can show me, since these questions are NOT documented clearly in even the best Windows books like Ricthers.
GeneralRe: User defined C++ template implementations in Windows DLLs using implicit linking Pin
tgeraldino11-Jul-02 21:19
tgeraldino11-Jul-02 21:19 
QuestionWhat should I do when I want add OLE server to my MDI software? Pin
neilxp11-Jul-02 17:43
neilxp11-Jul-02 17:43 

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.