Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Getting CMainFrame members from CView Pin
BlackDice23-Oct-04 10:04
BlackDice23-Oct-04 10:04 
QuestionHow to switch between windows? Pin
missnazar23-Oct-04 8:00
missnazar23-Oct-04 8:00 
AnswerRe: How to switch between windows? Pin
Michael P Butler23-Oct-04 8:42
Michael P Butler23-Oct-04 8:42 
GeneralRe: How to switch between windows? Pin
missnazar23-Oct-04 21:06
missnazar23-Oct-04 21:06 
AnswerRe: How to switch between windows? Pin
BlackDice23-Oct-04 9:36
BlackDice23-Oct-04 9:36 
GeneralRe: How to switch between windows? Pin
missnazar23-Oct-04 20:36
missnazar23-Oct-04 20:36 
GeneralRe: How to switch between windows? Pin
BlackDice25-Oct-04 2:54
BlackDice25-Oct-04 2:54 
QuestionMemory leak?? Pin
Bob Stanneveld23-Oct-04 7:17
Bob Stanneveld23-Oct-04 7:17 
AnswerRe: Memory leak?? Pin
Yulianto.23-Oct-04 17:05
Yulianto.23-Oct-04 17:05 
GeneralRe: Memory leak?? Pin
Bob Stanneveld24-Oct-04 2:08
Bob Stanneveld24-Oct-04 2:08 
AnswerRe: Memory leak?? Pin
Tim Smith23-Oct-04 18:14
Tim Smith23-Oct-04 18:14 
GeneralRe: Memory leak?? Pin
Bob Stanneveld24-Oct-04 2:07
Bob Stanneveld24-Oct-04 2:07 
AnswerRe: Memory leak?? Pin
Neville Franks24-Oct-04 0:18
Neville Franks24-Oct-04 0:18 
GeneralRe: Memory leak?? Pin
Bob Stanneveld24-Oct-04 2:02
Bob Stanneveld24-Oct-04 2:02 
GeneralError closing dialog Pin
Larsson23-Oct-04 6:55
Larsson23-Oct-04 6:55 

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.