Click here to Skip to main content
15,910,211 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Sorry I didnt see the post before I posted my last message and I tried to fix my program using the advice. I am still receiving the same runtime problem which stops at while (tmpRoom->Next!=0) Node shouldn't be NULL because Node would be a pointer to Room *RoomHead. Which is a global object. RoomHead->Next should = 0 because in the room constructure Next = 0; So FindEndObject should just return the value of tmpRoom because their is only one object in the link list. I tried every way to use the static_cast and I still cant get it to work. I am not even sure if I am doing it 100% correct. I dont want anyone to give me the code for the function because I will like to learn exactly how to do it my self. But if anyone could give me a little more detail hints I would appreciate it alot because right now I am not 100% sure how to implement the advice I am getting to my code. I guess because of the fact I never used void pointer or used any form of cast.
This is how my program looks so far

#include <stdlib.h>
#include <iostream>

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

Room::Room()
{
Next = 0;
}

using namespace std;
Room *RoomHead;

template <class X> X *FindEndObject(X * Node)
{
X* tmpRoom = Node;

while (tmpRoom->Next!=0)
{
cout << "We Got Here" << endl;
tmpRoom = static_cast<X*>(tmpRoom->Next);

}
return Node;
}

void main()
{
void *NewRoom = FindEndObject(RoomHead);
system("PAUSE");
}
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 
GeneralRe: Stop removal of null characters Pin
Rick York25-Aug-04 10:41
mveRick York25-Aug-04 10:41 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 11:20
Tom Wright25-Aug-04 11:20 
GeneralRe: Stop removal of null characters Pin
David Crow25-Aug-04 10:43
David Crow25-Aug-04 10:43 
GeneralRe: Stop removal of null characters Pin
Tom Wright25-Aug-04 11:21
Tom Wright25-Aug-04 11:21 
GeneralRe: Stop removal of null characters Pin
David Crow25-Aug-04 11:27
David Crow25-Aug-04 11:27 

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.