Click here to Skip to main content
15,902,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: #include problems Pin
Cedric Moonen7-Nov-04 22:46
Cedric Moonen7-Nov-04 22:46 
GeneralRe: #include problems Pin
vilmer7-Nov-04 23:00
vilmer7-Nov-04 23:00 
GeneralRe: #include problems Pin
Sreekanth Muralidharan7-Nov-04 23:24
Sreekanth Muralidharan7-Nov-04 23:24 
GeneralRe: #include problems Pin
vilmer8-Nov-04 3:09
vilmer8-Nov-04 3:09 
GeneralLinked list headache in VC++. Please help Pin
Sreekanth Muralidharan7-Nov-04 22:03
Sreekanth Muralidharan7-Nov-04 22:03 
GeneralRe: Linked list headache in VC++. Please help Pin
Uwe Keim7-Nov-04 22:35
sitebuilderUwe Keim7-Nov-04 22:35 
GeneralRe: Linked list headache in VC++. Please help Pin
Sreekanth Muralidharan7-Nov-04 23:17
Sreekanth Muralidharan7-Nov-04 23:17 
GeneralRe: Linked list headache in VC++. Please help Pin
FearlessBurner7-Nov-04 23:37
FearlessBurner7-Nov-04 23:37 
Firstly, I would offer the same advice, don't write your own linked lists or collections etc, use STL or the MFC CList etc.

The problem in your code appears to be a confusion in the pointers, and the code is littered with such problems, eg in AddToQueue(), you have set temp to be of type struct questlist **, but your call to malloc (btw why are you not using new???), will create a pointer to a single queuelist (i.e. (struct queuelist *)). So you should change the code to something like

struct queuelist *temp = NULL;
.............
temp = (struct queuelist *)malloc( sizeof(struct queuelist) );
if ( temp == NULL )
{
// Not enough memory etc
}
else
{
temp->intData = data;
temp->next=NULL;
temp->valid=1;
*q = temp;
}

The function call to AddToQueue() in your main part should read AddToQueue( &queue ) else the wrong type is being passed to the function.

I must admit that I am surprised that your compiler did not generate warning messages with your code? I think that you would be best of revisiting all of your code, and checking all your pointers and paraeters. Remember that malloc will only return a pointer to a section of memory that you have allocated.

Better still, use STL or perhaps the MFC CList template.
GeneralThanks to all... Pin
Sreekanth Muralidharan8-Nov-04 18:04
Sreekanth Muralidharan8-Nov-04 18:04 
GeneralRe: Linked list headache in VC++. Please help Pin
John R. Shaw8-Nov-04 12:40
John R. Shaw8-Nov-04 12:40 
GeneralMy Own Linked List Pin
Sreekanth Muralidharan8-Nov-04 19:35
Sreekanth Muralidharan8-Nov-04 19:35 
GeneralRe: My Own Linked List Pin
Sreekanth Muralidharan8-Nov-04 22:33
Sreekanth Muralidharan8-Nov-04 22:33 
GeneralRe: My Own Linked List Pin
John R. Shaw9-Nov-04 5:57
John R. Shaw9-Nov-04 5:57 
GeneralDisabling Toolbar Buttons Pin
Bernhard7-Nov-04 22:00
Bernhard7-Nov-04 22:00 
GeneralRe: Disabling Toolbar Buttons Pin
ThatsAlok7-Nov-04 22:06
ThatsAlok7-Nov-04 22:06 
GeneralRe: Disabling Toolbar Buttons Pin
Uwe Keim7-Nov-04 22:23
sitebuilderUwe Keim7-Nov-04 22:23 
GeneralQuestion about programatically created CListCtrl with WS_BORDER Pin
Uwe Keim7-Nov-04 21:54
sitebuilderUwe Keim7-Nov-04 21:54 
GeneralRe: Question about programatically created CListCtrl with WS_BORDER Pin
Uwe Keim7-Nov-04 22:14
sitebuilderUwe Keim7-Nov-04 22:14 
GeneralXP versions ... Pin
smack_2k27-Nov-04 21:53
smack_2k27-Nov-04 21:53 
GeneralRe: XP versions ... Pin
ThatsAlok7-Nov-04 22:13
ThatsAlok7-Nov-04 22:13 
QuestionHow to program same MSN popup ? Pin
guy20047-Nov-04 21:41
guy20047-Nov-04 21:41 
GeneralCombo Box Error Pin
vc-programmer-7-Nov-04 21:39
vc-programmer-7-Nov-04 21:39 
GeneralRe: Combo Box Error Pin
vc-programmer-7-Nov-04 23:16
vc-programmer-7-Nov-04 23:16 
GeneralRe: Combo Box Error Pin
BlackDice8-Nov-04 3:54
BlackDice8-Nov-04 3:54 
Generalconst_cast Pin
Jerome Conus7-Nov-04 21:29
Jerome Conus7-Nov-04 21:29 

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.