Click here to Skip to main content
15,922,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to save the drawing as a bitmap? Pin
stanley guan3-Jun-03 3:16
stanley guan3-Jun-03 3:16 
QuestionHow do I read file until 0 bytes left. Pin
IrishSonic3-Jun-03 3:02
IrishSonic3-Jun-03 3:02 
AnswerRe: How do I read file until 0 bytes left. Pin
David Crow3-Jun-03 3:05
David Crow3-Jun-03 3:05 
AnswerRe: How do I read file until 0 bytes left. Pin
Trollslayer3-Jun-03 4:05
mentorTrollslayer3-Jun-03 4:05 
GeneralRe: How do I read file until 0 bytes left. Pin
IrishSonic3-Jun-03 4:28
IrishSonic3-Jun-03 4:28 
Questionhow to add Mouse Buttons in C++.NET Pin
mr20033-Jun-03 2:29
mr20033-Jun-03 2:29 
AnswerRe: how to add Mouse Buttons in C++.NET Pin
MemLeak3-Jun-03 2:44
MemLeak3-Jun-03 2:44 
AnswerRe: how to add Mouse Buttons in C++.NET Pin
Xander803-Jun-03 2:47
Xander803-Jun-03 2:47 
GeneralCFormView key control Pin
doctorpi3-Jun-03 2:26
doctorpi3-Jun-03 2:26 
GeneralRe: CFormView key control Pin
Rage3-Jun-03 3:40
professionalRage3-Jun-03 3:40 
GeneralRe: CFormView key control Pin
doctorpi3-Jun-03 4:13
doctorpi3-Jun-03 4:13 
GeneralRe: CFormView key control Pin
Roger Allen3-Jun-03 6:11
Roger Allen3-Jun-03 6:11 
GeneralDelphi to C++ on 2 machines via TCPIP Pin
Bigsteiny3-Jun-03 1:56
Bigsteiny3-Jun-03 1:56 
GeneralUsing IDiscMaster and related objects Pin
Wolfram Steinke3-Jun-03 1:30
Wolfram Steinke3-Jun-03 1:30 
GeneralRe: Using IDiscMaster and related objects Pin
FlyingDancer3-Jun-03 2:34
FlyingDancer3-Jun-03 2:34 
GeneralScroll Bars in List control Pin
Prasanna_b_r3-Jun-03 1:21
Prasanna_b_r3-Jun-03 1:21 
GeneralRe: Scroll Bars in List control Pin
Rage3-Jun-03 3:12
professionalRage3-Jun-03 3:12 
GeneralRe: Scroll Bars in List control Pin
Prasanna_b_r3-Jun-03 19:35
Prasanna_b_r3-Jun-03 19:35 
GeneralGrid control Pin
AlenCk3-Jun-03 1:08
AlenCk3-Jun-03 1:08 
GeneralRe: Grid control Pin
Anonymous3-Jun-03 3:23
Anonymous3-Jun-03 3:23 
GeneralRe: Grid control Pin
Rage3-Jun-03 3:29
professionalRage3-Jun-03 3:29 
GeneralRe: Grid control Pin
AlenCk3-Jun-03 20:33
AlenCk3-Jun-03 20:33 
GeneralProblem with templates<> and classes Pin
Zibar2-Jun-03 23:53
sussZibar2-Jun-03 23:53 
Problem with templates<> and classes


I have this kind of class (first of all - I use VC++.NET)

class XMLParser
{
struct Scene
{
LinkedList< SceneObject > objectList;
}

struct SceneObject
{
}

LinkedList< Scene > sceneList;

XMLParser
~XMLParser();

//
static void StartElementHandler(void * data,
const char * element,
const char ** attribute);
static void EndElementHandler( void *data,
const char *el );
}

I'm using the expat library for XML parsing. This class should parse an .xml file and create a list of scenes.
XMLParser constructor initializes the expat XML parser and the StartElementHandler and EndElementHandler are callbacks that handle the parsing needed by expat.

The problem is the templated LinkeList class. I want to "new LinkedList< Scene >()". I can't do it inside the class decalration and I can't do it outside of the class declaration. In the first case I get a compiler error (obviously) and in the second one a linker error.

If I do:
XMLMovieParser::sceneList = new LinkedList< Scene >();
I get C2512 no appropriate default constructor available
and C2955 use of class template requires template list

If I do inside the constructor:
sceneList = new LinkedList< Scene >();
I get an unresolved external symbol errors: LNK2001 and LNK2019

etc.

the full class is too long to post
GeneralRe: Problem with templates&lt;&gt; and classes Pin
Joaquín M López Muñoz3-Jun-03 0:27
Joaquín M López Muñoz3-Jun-03 0:27 
GeneralRe: Problem with templates&lt;&gt; and classes Pin
Zibar3-Jun-03 0:30
sussZibar3-Jun-03 0:30 

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.