Click here to Skip to main content
15,914,165 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCFileDialog stops me writing to log file Pin
ChrisBidmead21-Sep-04 4:36
ChrisBidmead21-Sep-04 4:36 
GeneralRe: CFileDialog stops me writing to log file Pin
David Crow21-Sep-04 5:45
David Crow21-Sep-04 5:45 
GeneralRe: CFileDialog stops me writing to log file Pin
ChrisBidmead21-Sep-04 6:21
ChrisBidmead21-Sep-04 6:21 
GeneralRe: CFileDialog stops me writing to log file Pin
David Crow21-Sep-04 8:34
David Crow21-Sep-04 8:34 
GeneralRe: CFileDialog stops me writing to log file Pin
ChrisBidmead21-Sep-04 10:20
ChrisBidmead21-Sep-04 10:20 
GeneralRe: CFileDialog stops me writing to log file Pin
David Crow21-Sep-04 10:24
David Crow21-Sep-04 10:24 
GeneralWindow not restoring from Task Bar Pin
LannieK21-Sep-04 4:04
LannieK21-Sep-04 4:04 
Generaltemplate question Pin
sandrineV21-Sep-04 4:02
sandrineV21-Sep-04 4:02 
Hello,

I am trying to create a function which will return different members of my class according to an enumeration. The thing is that the different members do not have the same type : one of them is a CArray<int,int>, the others are CArray<int*,int*>, and I might have other arrays later on.

So in the .h file for the class, I created a template function in the following way :
CMyDataClass{
template <typename t="">
CArray<t,t>* GetDataList(LIST_TYPE t){
switch(t){
case t1 :
return &m_1; (let's say m1 is a CArray<int,int>)
break;
case t2 :
return &m_2;
break;
case t3 :
return &m_3;
break;
}
};
}

Everything builds fine.

However, when in another class I try to call the template function, say to retrieve m_1 :

CArray<int,int>* datalist;
datalist=MyClass->GetDataList(CMyDataClass::t1);

I get the following compilation error :

>>>class CArray<t,t> *__thiscall CMyDataClass::GetDataList(enum >>>CMyDataClass::LIST_TYPE)' : could not deduce template argument for 'T'

I don't see whether I have badly written my template function, or if it is the call to this template function that is wrong.
Could anyone give me some advice please ?

Thanks in advance.
Generalsend text using serial comm Pin
mark18221-Sep-04 3:54
mark18221-Sep-04 3:54 
GeneralRe: send text using serial comm Pin
Nicholas Cardi21-Sep-04 5:15
Nicholas Cardi21-Sep-04 5:15 
GeneralRe: send text using serial comm Pin
ThatsAlok23-Sep-04 3:37
ThatsAlok23-Sep-04 3:37 
QuestionHow to add Integer type Member Variable to a ComboBox? Pin
pubududilena21-Sep-04 3:25
pubududilena21-Sep-04 3:25 
AnswerRe: How to add Integer type Member Variable to a ComboBox? Pin
mark18221-Sep-04 3:37
mark18221-Sep-04 3:37 
GeneralRe: How to add Integer type Member Variable to a ComboBox? Pin
pubududilena21-Sep-04 3:52
pubududilena21-Sep-04 3:52 
GeneralRe: How to add Integer type Member Variable to a ComboBox? Pin
David Crow21-Sep-04 5:37
David Crow21-Sep-04 5:37 
Generalexecute device manager Pin
mark18221-Sep-04 3:24
mark18221-Sep-04 3:24 
GeneralRe: execute device manager Pin
BlackDice21-Sep-04 6:55
BlackDice21-Sep-04 6:55 
GeneralRe: execute device manager Pin
Alexander M.,21-Sep-04 9:47
Alexander M.,21-Sep-04 9:47 
GeneralRe: execute device manager Pin
shiraztk22-Sep-04 0:02
shiraztk22-Sep-04 0:02 
Generalscheduler Pin
muharrem21-Sep-04 2:49
muharrem21-Sep-04 2:49 
GeneralRe: scheduler Pin
David Crow21-Sep-04 5:40
David Crow21-Sep-04 5:40 
Generalstatic and dynamic linking Pin
ns21-Sep-04 2:38
ns21-Sep-04 2:38 
GeneralSwitching problem between view and dialog attached Pin
ledallam21-Sep-04 2:19
ledallam21-Sep-04 2:19 
GeneralHeader File required Pin
Mythri.B.L21-Sep-04 2:07
Mythri.B.L21-Sep-04 2:07 
GeneralRe: Header File required Pin
David Crow21-Sep-04 2:46
David Crow21-Sep-04 2:46 

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.