Click here to Skip to main content
15,909,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: initialization of variables in mfc dialog Pin
John M. Drescher26-Aug-03 3:53
John M. Drescher26-Aug-03 3:53 
Anonymous wrote:
I tried initializing in in OnInitDialog(); but it still gives me an unidentified error when I try to manipulate it in the function.

Did you declare the variable in the class? An unidentified error (in a member function) has nothing to do with where you initialize it but where you declare the variable.

Anonymous wrote:
I can't initialize it in the function itself because then each time the function is called it will be reinitialized to 0.

If you declare it in the function you can initialize it there also if you use the static keyword before your declaration but this is not used as much as a regular member variable. Making it static will only initialize it once for the life of the dialog class.

John
GeneralRe: initialization of variables in mfc dialog Pin
roel_26-Aug-03 3:53
roel_26-Aug-03 3:53 
GeneralRe: initialization of variables in mfc dialog Pin
Anonymous26-Aug-03 4:10
Anonymous26-Aug-03 4:10 
GeneralRe: initialization of variables in mfc dialog Pin
Bob Stanneveld26-Aug-03 5:34
Bob Stanneveld26-Aug-03 5:34 
GeneralRe: initialization of variables in mfc dialog Pin
John M. Drescher26-Aug-03 7:30
John M. Drescher26-Aug-03 7:30 
GeneralRe: initialization of variables in mfc dialog Pin
l a u r e n26-Aug-03 14:18
l a u r e n26-Aug-03 14:18 
GeneralRe: initialization of variables in mfc dialog Pin
John M. Drescher26-Aug-03 14:57
John M. Drescher26-Aug-03 14:57 
GeneralEdit box string Pin
Jay Hova26-Aug-03 3:02
Jay Hova26-Aug-03 3:02 
GeneralRe: Edit box string Pin
Maximilien26-Aug-03 3:11
Maximilien26-Aug-03 3:11 
GeneralRe: Edit box string Pin
Ravi Bhavnani26-Aug-03 3:11
professionalRavi Bhavnani26-Aug-03 3:11 
GeneralRe: Edit box string Pin
Andrew Walker26-Aug-03 3:12
Andrew Walker26-Aug-03 3:12 
GeneralRe: Edit box string Pin
Jay Hova26-Aug-03 3:16
Jay Hova26-Aug-03 3:16 
GeneralRe: Edit box string Pin
vcplusplus26-Aug-03 3:28
vcplusplus26-Aug-03 3:28 
GeneralRe: Edit box string Pin
Jay Hova26-Aug-03 3:35
Jay Hova26-Aug-03 3:35 
GeneralRe: Edit box string Pin
vcplusplus26-Aug-03 7:37
vcplusplus26-Aug-03 7:37 
GeneralRe: Edit box string Pin
David Crow26-Aug-03 7:13
David Crow26-Aug-03 7:13 
GeneralHelp me! Please! Pin
Member 50856726-Aug-03 2:55
Member 50856726-Aug-03 2:55 
QuestionHow to run a script (.vbs) in VC++, Please help .... Pin
Atif Bashir26-Aug-03 2:40
Atif Bashir26-Aug-03 2:40 
AnswerRe: How to run a script (.vbs) in VC++, Please help .... Pin
David Crow26-Aug-03 2:55
David Crow26-Aug-03 2:55 
Generaledit boxs in userdrawn list box control Pin
Chanda.com26-Aug-03 2:16
Chanda.com26-Aug-03 2:16 
QuestionIs is possible to make TransparentBlt without flickering ? Pin
vgrigor26-Aug-03 2:11
vgrigor26-Aug-03 2:11 
AnswerRe: Is is possible to make TransparentBlt without flickering ? Pin
roel_26-Aug-03 3:57
roel_26-Aug-03 3:57 
GeneralRe: Is is possible to make TransparentBlt without flickering ? Pin
vgrigor26-Aug-03 4:42
vgrigor26-Aug-03 4:42 
GeneralRe: Is is possible to make TransparentBlt without flickering ? Pin
l a u r e n26-Aug-03 14:20
l a u r e n26-Aug-03 14:20 
GeneralHelp Saving a drawing piece by piece in XML Pin
lxxrya00126-Aug-03 1:40
lxxrya00126-Aug-03 1:40 

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.