Click here to Skip to main content
15,901,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
General2 Dialog box problem Pin
Solero11-Jul-02 16:54
Solero11-Jul-02 16:54 
GeneralRe: 2 Dialog box problem Pin
Chris Losinger11-Jul-02 18:06
professionalChris Losinger11-Jul-02 18:06 
GeneralMacro doesn't work =\ Pin
Vitaly Belman11-Jul-02 16:36
Vitaly Belman11-Jul-02 16:36 
GeneralRe: Macro doesn't work =\ Pin
Chris Losinger11-Jul-02 16:52
professionalChris Losinger11-Jul-02 16:52 
GeneralRe: Macro doesn't work =\ Pin
Vitaly Belman12-Jul-02 2:12
Vitaly Belman12-Jul-02 2:12 
GeneralRe: Macro doesn't work =\ Pin
Chris Losinger12-Jul-02 3:15
professionalChris Losinger12-Jul-02 3:15 
GeneralAppending Wave files Pin
Brakanjan11-Jul-02 15:53
Brakanjan11-Jul-02 15:53 
GeneralRe: Appending Wave files Pin
KaЯl12-Jul-02 3:59
KaЯl12-Jul-02 3:59 
GeneralRe: Appending Wave files Pin
Jh313-Jul-02 22:35
Jh313-Jul-02 22:35 
QuestionHow to let childWindow have same focus as parent ? Pin
bisserke11-Jul-02 13:20
bisserke11-Jul-02 13:20 
AnswerRe: How to let childWindow have same focus as parent ? Pin
Nish Nishant11-Jul-02 14:51
sitebuilderNish Nishant11-Jul-02 14:51 
QuestionDo I need the latest Platform SDK? Pin
BigCaot11-Jul-02 12:40
sussBigCaot11-Jul-02 12:40 
AnswerRe: Do I need the latest Platform SDK? Pin
Anders Molin11-Jul-02 12:46
professionalAnders Molin11-Jul-02 12:46 
GeneralVC++ 6.0 interface question Pin
EBerlin11-Jul-02 12:14
EBerlin11-Jul-02 12:14 
GeneralRe: VC++ 6.0 interface question Pin
Christian Graus11-Jul-02 12:17
protectorChristian Graus11-Jul-02 12:17 

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.