Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC and its BOOL type... Pin
Henry miller26-Aug-04 7:53
Henry miller26-Aug-04 7:53 
GeneralStatically Link ActiveX control Pin
Aaron Schaefer25-Aug-04 13:27
Aaron Schaefer25-Aug-04 13:27 
Generalcscrollview snaps back to zero when you scroll past 32760 pixels Pin
mickelliot25-Aug-04 12:35
mickelliot25-Aug-04 12:35 
GeneralRe: cscrollview snaps back to zero when you scroll past 32760 pixels Pin
mickelliot25-Aug-04 12:41
mickelliot25-Aug-04 12:41 
GeneralRe: cscrollview snaps back to zero when you scroll past 32760 pixels Pin
Joaquín M López Muñoz25-Aug-04 13:03
Joaquín M López Muñoz25-Aug-04 13:03 
GeneralRe: cscrollview snaps back to zero when you scroll past 32760 pixels Pin
mickelliot29-Aug-04 8:44
mickelliot29-Aug-04 8:44 
Generalsolution to this problem Pin
mickelliot31-Aug-04 11:08
mickelliot31-Aug-04 11:08 
GeneralAccessing a Class Variable Using A Void Pointer Pin
Anonymous25-Aug-04 10:47
Anonymous25-Aug-04 10:47 
Basically I want to loop through a link list that I have. It wouldnt be hard if in the link list their might be classes with different data types. So I am trying to use the void pointer. Because I dont know the data type of the class and I want to try and make a function that returns the address of the last class in the link list. I am able to use templates but everything works well until I try to get the void pointer in a class to equal the void pointer of the next class in the link list. I dont see why it doesnt work because I keep getting the error error C2227: left of '->NextObject' must point to class/struct/union. I am pointing to a class void pointer and Node is suppose to be a class so I dont understand why I am getting the error. I tried casting to fix this problem either I dont know how to do it well or it doesnt work to fix this.If anyone can help I would be extremly greatful.


#include <stdlib.h>
#include <windows.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <conio.h>
#include <windows.h>


class Room
{
public:
void *NextObject;
Room();
};

Room::Room()
{
NextObject = 0;
name = "blue";
}

using namespace std;
Room *RoomHead;

template <class X> X *FindEndObject(X * Node)
{
void *Temp = Node;
while (Temp!=0)
{
Temp = Temp->NextObject;
cout << "MOo" << endl;
}
return Node;
}

void main()
{
void *NewRoom = FindEndObject(RoomHead);
system("PAUSE");
}



GeneralRe: Accessing a Class Variable Using A Void Pointer Pin
Doug Mitchell25-Aug-04 11:21
Doug Mitchell25-Aug-04 11:21 
GeneralRe: Accessing a Class Variable Using A Void Pointer Pin
Joaquín M López Muñoz25-Aug-04 12:40
Joaquín M López Muñoz25-Aug-04 12:40 
GeneralRe: Accessing a Class Variable Using A Void Pointer Pin
Anonymous25-Aug-04 12:42
Anonymous25-Aug-04 12:42 
GeneralRe: Accessing a Class Variable Using A Void Pointer Pin
Joaquín M López Muñoz25-Aug-04 12:49
Joaquín M López Muñoz25-Aug-04 12:49 
GeneralRe: Accessing a Class Variable Using A Void Pointer Pin
Anonymous25-Aug-04 14:12
Anonymous25-Aug-04 14:12 
GeneralRe: Accessing a Class Variable Using A Void Pointer Pin
DRHuff25-Aug-04 17:14
DRHuff25-Aug-04 17:14 
GeneralRe: Accessing a Class Variable Using A Void Pointer Pin
Anonymous25-Aug-04 18:11
Anonymous25-Aug-04 18:11 
GeneralButting in... Pin
palbano25-Aug-04 18:06
palbano25-Aug-04 18:06 
Generaldumb command line question Pin
kfaday25-Aug-04 9:55
kfaday25-Aug-04 9:55 
GeneralRe: dumb command line question Pin
David Crow25-Aug-04 10:10
David Crow25-Aug-04 10:10 
GeneralRe: dumb command line question Pin
DRHuff25-Aug-04 10:13
DRHuff25-Aug-04 10:13 
GeneralBolding dates in CDateTimeCtrl Pin
DRHuff25-Aug-04 9:42
DRHuff25-Aug-04 9:42 
GeneralRe: Bolding dates in CDateTimeCtrl Pin
David Crow25-Aug-04 10:17
David Crow25-Aug-04 10:17 
GeneralRe: Bolding dates in CDateTimeCtrl Pin
DRHuff25-Aug-04 10:38
DRHuff25-Aug-04 10:38 
GeneralStop removal of null characters Pin
Tom Wright25-Aug-04 9:18
Tom Wright25-Aug-04 9:18 
GeneralRe: Stop removal of null characters Pin
David Crow25-Aug-04 10:14
David Crow25-Aug-04 10:14 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 10:26
Tom Wright25-Aug-04 10:26 

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.