Click here to Skip to main content
15,885,278 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: in fo needed on Gradient fill Pin
sarat22-Jan-08 4:04
sarat22-Jan-08 4:04 
GeneralRe: in fo needed on Gradient fill Pin
sarat22-Jan-08 18:56
sarat22-Jan-08 18:56 
GeneralRe: in fo needed on Gradient fill Pin
sarat22-Jan-08 20:38
sarat22-Jan-08 20:38 
GeneralTypedef nightmare! [modified] Pin
Lea Hayes22-Jan-08 1:47
Lea Hayes22-Jan-08 1:47 
QuestionRe: Typedef nightmare! Pin
CPallini22-Jan-08 2:04
mveCPallini22-Jan-08 2:04 
GeneralRe: Typedef nightmare! Pin
Lea Hayes22-Jan-08 2:28
Lea Hayes22-Jan-08 2:28 
GeneralRe: Typedef nightmare! Pin
CPallini22-Jan-08 2:38
mveCPallini22-Jan-08 2:38 
GeneralRe: Typedef nightmare! Pin
Lea Hayes22-Jan-08 3:02
Lea Hayes22-Jan-08 3:02 
I think that I have found the root of the problem...

The template class has an enum inside it:

template<typename _Ty> class TemplateClass<br />
{<br />
public:<br />
   enum ConstantValue<br />
   {<br />
       constant_value = 17<br />
   };<br />
};


The type definition works when the enum is taken out of the template class. So the following works:

enum ConstantValue { constant_Value = 17 };<br />
<br />
template<typename _Ty> class TemplateClass<br />
{<br />
public:<br />
   ...<br />
};<br />
<br />
...<br />
<br />
typedef Root::Nested::TemplateClass<int> NESTED_CLASS;



I still do not understand why this is, but at least I have a solution now. I found a BUG report on the Microsoft website which addresses this very issue with template functions, the remedee there is to typedef the enum...typedef'ing the enum within the template class didn't improve the situation for me though.

http://support.microsoft.com/kb/125495[^]">

I thought it was worth posting the solution in case somebody else has a similar issue. It would be interesting if someone was able to give a reason as to why this problem occurs.

Thanks for your advice.
QuestionRe: Typedef nightmare! Pin
CPallini22-Jan-08 3:21
mveCPallini22-Jan-08 3:21 
GeneralRe: Typedef nightmare! Pin
Lea Hayes22-Jan-08 3:28
Lea Hayes22-Jan-08 3:28 
GeneralRe: Typedef nightmare! Pin
Luc Pattyn22-Jan-08 2:12
sitebuilderLuc Pattyn22-Jan-08 2:12 
GeneralRe: Typedef nightmare! Pin
Lea Hayes22-Jan-08 2:17
Lea Hayes22-Jan-08 2:17 
GeneralRe: Typedef nightmare! Pin
CPallini22-Jan-08 2:18
mveCPallini22-Jan-08 2:18 
GeneralRead Data from Serial Port Pin
Susanmat22-Jan-08 1:28
Susanmat22-Jan-08 1:28 
GeneralRe: Read Data from Serial Port Pin
Cedric Moonen22-Jan-08 1:32
Cedric Moonen22-Jan-08 1:32 
JokeRe: Read Data from Serial Port Pin
CPallini22-Jan-08 1:57
mveCPallini22-Jan-08 1:57 
GeneralRe: Read Data from Serial Port Pin
Cedric Moonen22-Jan-08 3:12
Cedric Moonen22-Jan-08 3:12 
JokeRe: Read Data from Serial Port Pin
CPallini22-Jan-08 3:21
mveCPallini22-Jan-08 3:21 
GeneralRe: Read Data from Serial Port Pin
Cedric Moonen22-Jan-08 3:51
Cedric Moonen22-Jan-08 3:51 
GeneralRe: Read Data from Serial Port Pin
Susanmat22-Jan-08 18:30
Susanmat22-Jan-08 18:30 
GeneralRe: Read Data from Serial Port Pin
Cedric Moonen22-Jan-08 20:25
Cedric Moonen22-Jan-08 20:25 
GeneralTry-catch works with structured exception Pin
George_George22-Jan-08 0:11
George_George22-Jan-08 0:11 
GeneralRe: Try-catch works with structured exception Pin
CPallini22-Jan-08 2:17
mveCPallini22-Jan-08 2:17 
GeneralRe: Try-catch works with structured exception Pin
Stephen Hewitt22-Jan-08 12:47
Stephen Hewitt22-Jan-08 12:47 
GeneralRe: Try-catch works with structured exception Pin
George_George22-Jan-08 14:19
George_George22-Jan-08 14:19 

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.