Click here to Skip to main content
15,927,694 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalneed help coverting a char* to a unsigned short* Pin
15-Apr-02 17:06
suss15-Apr-02 17:06 
GeneralRe: need help coverting a char* to a unsigned short* Pin
Le centriste16-Apr-02 3:41
Le centriste16-Apr-02 3:41 
GeneralInitializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 15:39
valikac15-Apr-02 15:39 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 15:59
Diarrhio15-Apr-02 15:59 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 16:03
valikac15-Apr-02 16:03 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 16:17
Diarrhio15-Apr-02 16:17 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 16:24
valikac15-Apr-02 16:24 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 16:48
Diarrhio15-Apr-02 16:48 
Ok. I see what you are trying to do. You need to create a class for your dialog (by deriving from CDialog. Use Class Wizard), and do all of this in there. None of the controls for your dialog have been created when you are doing your loop. They don't get created until you call DoModal, and they get destroyed by the time DoModal returns. When I say created and destroyed, I don't mean the object gets destroyed. Rather, the Handle to the control that the progress control object wraps is destroyed. And you the functions that you are calling are thin wrappers to API calls using the Handle. Thus the crash.

So, as I said, create a class for your dialog. Add the control to the class using class wizard. Also add a button to the dialog, and add a button clicked handler. Then, when the button gets pushed, add your for loop in the button handler.

Hope that helps.
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 16:58
valikac15-Apr-02 16:58 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 17:08
Diarrhio15-Apr-02 17:08 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 17:30
valikac15-Apr-02 17:30 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 18:04
valikac15-Apr-02 18:04 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 18:50
Diarrhio15-Apr-02 18:50 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 18:48
Diarrhio15-Apr-02 18:48 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac16-Apr-02 4:50
valikac16-Apr-02 4:50 
GeneralRe: Before or After Pin
valikac16-Apr-02 12:46
valikac16-Apr-02 12:46 
GeneralBitBlt problem Pin
Jack Handy15-Apr-02 15:26
Jack Handy15-Apr-02 15:26 
GeneralRe: BitBlt problem Pin
Paul M Watt15-Apr-02 18:51
mentorPaul M Watt15-Apr-02 18:51 
GeneralRe: BitBlt problem Pin
Jack Handy15-Apr-02 19:12
Jack Handy15-Apr-02 19:12 
GeneralRe: BitBlt problem Pin
Paul M Watt15-Apr-02 20:08
mentorPaul M Watt15-Apr-02 20:08 
GeneralRe: BitBlt problem Pin
Jack Handy15-Apr-02 21:20
Jack Handy15-Apr-02 21:20 
GeneralRe: BitBlt problem Pin
Paul M Watt15-Apr-02 21:33
mentorPaul M Watt15-Apr-02 21:33 
Generallinker error cant find mfc42u.lib Pin
15-Apr-02 15:15
suss15-Apr-02 15:15 
GeneralRe: linker error cant find mfc42u.lib Pin
Matt Newman15-Apr-02 15:25
Matt Newman15-Apr-02 15:25 
GeneralRe: linker error cant find mfc42u.lib Pin
15-Apr-02 15:40
suss15-Apr-02 15: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.