Click here to Skip to main content
15,921,606 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe Pin
yanping wang24-Oct-04 2:49
yanping wang24-Oct-04 2:49 
GeneralRe: Re Pin
Programmer_Chris24-Oct-04 3:23
Programmer_Chris24-Oct-04 3:23 
GeneralTough time with template syntax Pin
LynnJ23-Oct-04 19:04
LynnJ23-Oct-04 19:04 
GeneralRe: Tough time with template syntax Pin
Bob Stanneveld24-Oct-04 2:19
Bob Stanneveld24-Oct-04 2:19 
GeneralRe: Tough time with template syntax Pin
Andrew Walker24-Oct-04 4:34
Andrew Walker24-Oct-04 4:34 
GeneralRe: Tough time with template syntax Pin
Kevin McFarlane24-Oct-04 5:12
Kevin McFarlane24-Oct-04 5:12 
GeneralRe: Tough time with template syntax Pin
Kevin McFarlane24-Oct-04 5:10
Kevin McFarlane24-Oct-04 5:10 
QuestionUsing Flash Animations? Pin
dSolariuM23-Oct-04 18:12
dSolariuM23-Oct-04 18:12 
AnswerRe: Using Flash Animations? Pin
jan larsen26-Oct-04 4:02
jan larsen26-Oct-04 4:02 
GeneralASTL in visual C++ Pin
xmasglee23-Oct-04 17:52
xmasglee23-Oct-04 17:52 
Generaladding templates into visual C++ Pin
xmasglee23-Oct-04 17:51
xmasglee23-Oct-04 17:51 
GeneralRe: adding templates into visual C++ Pin
Bob Stanneveld24-Oct-04 2:27
Bob Stanneveld24-Oct-04 2:27 
General.Net Pro .VS. VC++ 6. Pin
thompsons23-Oct-04 14:13
thompsons23-Oct-04 14:13 
GeneralRe: .Net Pro .VS. VC++ 6. Pin
SuperTank23-Oct-04 14:35
SuperTank23-Oct-04 14:35 
GeneralRe: .Net Pro .VS. VC++ 6. Pin
burrifro7923-Oct-04 15:01
burrifro7923-Oct-04 15:01 
QuestionHow do I import a class? Pin
SuperTank23-Oct-04 13:30
SuperTank23-Oct-04 13:30 
AnswerRe: How do I import a class? Pin
ThatsAlok24-Oct-04 22:41
ThatsAlok24-Oct-04 22:41 
GeneralRe: Linking library Pin
BlackDice23-Oct-04 10:26
BlackDice23-Oct-04 10:26 
Generalconsole app closes Pin
jerrodab23-Oct-04 9:52
jerrodab23-Oct-04 9:52 
GeneralRe: console app closes Pin
SuperTank23-Oct-04 10:01
SuperTank23-Oct-04 10:01 
GeneralRe: console app closes Pin
Anonymous23-Oct-04 16:06
Anonymous23-Oct-04 16:06 
GeneralGrabbing images from Video Files Pin
AJ12323-Oct-04 9:18
AJ12323-Oct-04 9:18 
GeneralGetting CMainFrame members from CView Pin
Leyu23-Oct-04 8:00
Leyu23-Oct-04 8:00 
I am trying to store top score (CString and int) (name and score) values to the registry
They are declared in the CMainFrame Class and initialized with the default values and in OnCreate from the stored values from the registry i debugged it and seen that they are okay till the end of the OnCreate function;
Used WriteProfileInt & WriteProfileString In OnClose and
Used GetProfileInt &GetProfileString In OnCreate
I wanted to update the values when the game is over and when game is over i post a message using PostMessage in The CView and in the handler function i use

((CMainFrame*)AfxGetApp())->m_strTopScore => now this value is null
((CMainFrame*)AfxGetApp())->m_iTopScore => now this value is 512

But As I said earlier the m_strTopScore was assigned a default value of "New Player"
and the m_iTopScore=0;

and when i try assign the m_strTopScore with new value
((CMainFrame*)AfxGetApp())->m_strTopScore="New String";

i get an ASSERT in line that says

_AFX_INLINE CStringData* CString::GetData() const
{ ASSERT(m_pchData != NULL); return ((CStringData*)m_pchData)-1; }

I used regedit and seen the stored default values in OnCreate i.e "NewPlayer" and 0
Why is the Value of 0 changed to 512 and NewPlayer to null
There is no place this variables are modified ??????? Any Ideas???????
GeneralRe: Getting CMainFrame members from CView Pin
Michael P Butler23-Oct-04 8:47
Michael P Butler23-Oct-04 8:47 
GeneralRe: Getting CMainFrame members from CView Pin
BlackDice23-Oct-04 9:34
BlackDice23-Oct-04 9:34 

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.