Click here to Skip to main content
15,912,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Word Automation Pin
l a u r e n20-Nov-03 13:29
l a u r e n20-Nov-03 13:29 
Generalvisual layering Pin
halblonious20-Nov-03 13:01
halblonious20-Nov-03 13:01 
GeneralRe: visual layering Pin
l a u r e n20-Nov-03 13:28
l a u r e n20-Nov-03 13:28 
GeneralRe: visual layering Pin
halblonious20-Nov-03 21:01
halblonious20-Nov-03 21:01 
Generalto confinning users for del,rename & format Pin
Mahmoud Komeily20-Nov-03 10:30
Mahmoud Komeily20-Nov-03 10:30 
GeneralRe: to confinning users for del,rename & format Pin
John R. Shaw20-Nov-03 12:33
John R. Shaw20-Nov-03 12:33 
GeneralRe: to confinning users for del,rename & format Pin
Peter Molnar20-Nov-03 13:29
Peter Molnar20-Nov-03 13:29 
QuestionQuestion of scope? Pin
dave@home20-Nov-03 9:50
dave@home20-Nov-03 9:50 
When using int's, CString's, etc in my MFC app's I have declared the ones required for the life of the object in my class header file and then used them where needed in helper functions. Now I am tring to use CList templates (read newbie) in the following way

#include <afxtempl.h>

class whatever
{
public
void AddWords();
.
CList<cstring, cstring&=""> wordList;
.
.
};


whatever::AddWords
{
CString temp;
//CList<cstring, cstring&=""> wordList;
.
.
wordList.AddTail(temp);
.
.
}

when I do this I get an assertion error stating
if (!AfxIsValidAddress(pOb, sizeof(CObject)))
{
TRACE0("ASSERT_VALID fails with illegal pointer.\n");
if (AfxAssertFailedLine(lpszFileName, nLine))
AfxDebugBreak();

BUT, when I create wordList in the AddWords helper function (ie uncomment here and comment there) my code works fine.

I have trawled through books and websites to no avail for an answer so now think this must be a really stupid question. Never the less, I need an answer and would appreciate any help.

Thanks in advance.

Dave
AnswerRe: Question of scope? Pin
dave@home20-Nov-03 9:56
dave@home20-Nov-03 9:56 
Generalneed help with fread Pin
ns20-Nov-03 9:47
ns20-Nov-03 9:47 
Generalcheck for tab Pin
Vancouver20-Nov-03 9:53
Vancouver20-Nov-03 9:53 
GeneralRe: check for tab Pin
ns20-Nov-03 10:02
ns20-Nov-03 10:02 
GeneralRe: need help with fread Pin
Antti Keskinen20-Nov-03 10:44
Antti Keskinen20-Nov-03 10:44 
GeneralRe: need help with fread Pin
nss20-Nov-03 10:59
nss20-Nov-03 10:59 
GeneralRe: need help with fread Pin
John R. Shaw20-Nov-03 12:17
John R. Shaw20-Nov-03 12:17 
GeneralCreateDC failure in Citrix 2003 Pin
Fred Eckertson20-Nov-03 9:24
Fred Eckertson20-Nov-03 9:24 
GeneralReading Windows data into unix Pin
Anonymous20-Nov-03 9:03
Anonymous20-Nov-03 9:03 
GeneralRe: Reading Windows data into unix Pin
Antti Keskinen20-Nov-03 9:33
Antti Keskinen20-Nov-03 9:33 
GeneralRe: Reading Windows data into unix Pin
JWood20-Nov-03 9:37
JWood20-Nov-03 9:37 
GeneralRe: Reading Windows data into unix Pin
Johnny ²20-Nov-03 11:12
Johnny ²20-Nov-03 11:12 
General__in64 and DWORD strange size Pin
Anonymous20-Nov-03 8:34
Anonymous20-Nov-03 8:34 
GeneralAlignment Pin
Vancouver20-Nov-03 8:53
Vancouver20-Nov-03 8:53 
GeneralRe: __in64 and DWORD strange size Pin
JWood20-Nov-03 8:54
JWood20-Nov-03 8:54 
GeneralRe: __in64 and DWORD strange size Pin
cmk20-Nov-03 9:01
cmk20-Nov-03 9:01 
Generalcmk is right Pin
Vancouver20-Nov-03 9:11
Vancouver20-Nov-03 9:11 

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.