Click here to Skip to main content
15,885,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Getting Text from Seperate Dialog Pin
avenger_sb2525-May-04 18:10
avenger_sb2525-May-04 18:10 
GeneralVC++.NET compiler running in VC++6 Errors Pin
---Mark---25-May-04 13:31
---Mark---25-May-04 13:31 
GeneralRe: VC++.NET compiler running in VC++6 Errors Pin
Anonymous25-May-04 13:39
Anonymous25-May-04 13:39 
GeneralRe: VC++.NET compiler running in VC++6 Errors Pin
---Mark---25-May-04 13:43
---Mark---25-May-04 13:43 
GeneralRe: VC++.NET compiler running in VC++6 Errors Pin
Anonymous25-May-04 13:47
Anonymous25-May-04 13:47 
GeneralRe: VC++.NET compiler running in VC++6 Errors Pin
---Mark---25-May-04 13:53
---Mark---25-May-04 13:53 
GeneralExtracting files from resource Pin
Anonymous25-May-04 13:28
Anonymous25-May-04 13:28 
GeneralRe: Extracting files from resource Pin
gUrM33T25-May-04 18:04
gUrM33T25-May-04 18:04 
So where exactly are you facing problem in this code?

How are you going to know where the error occured as:
- Your code never calls GetLastError() to find out if a call to WIN32 Resource API succeeded or not.
- FindResource(), LockResource() and LoadResource() returns NULL in case of an error, you are not even performing any checks for that condition too.
- Are you sure the call to CreateFile() is succeeding, try using GetLastError() to know why it failed.
- You are not comparing the value of variable Written with the variable Size to know exactly if a call to WriteFile() succeeded or not.

Points regarding your code:
1. Please move UnlockResource() out of the if block.
2. It is not necessary for Win32-based applications to FreeResource. A resource is automatically freed when its module is unloaded.

Gurmeet
BTW, can Google help me search my lost pajamas?

My Articles: HTML Reader C++ Class Library, Numeric Edit Control

GeneralRe: Extracting files from resource Pin
Diddy26-May-04 0:20
Diddy26-May-04 0:20 
GeneralRe: Extracting files from resource Pin
Roger Allen26-May-04 2:41
Roger Allen26-May-04 2:41 
GeneralRe: Extracting files from resource Pin
David Crow26-May-04 3:33
David Crow26-May-04 3:33 
GeneralMake Window Stay On Top Pin
KingTermite25-May-04 12:56
KingTermite25-May-04 12:56 
GeneralRe: Make Window Stay On Top Pin
Christian Graus25-May-04 13:15
protectorChristian Graus25-May-04 13:15 
GeneralRe: Make Window Stay On Top Pin
KingTermite25-May-04 13:19
KingTermite25-May-04 13:19 
GeneralRe: Make Window Stay On Top Pin
Christian Graus25-May-04 13:22
protectorChristian Graus25-May-04 13:22 
GeneralVC7 compiler with VC6 IDE Pin
Jim A. Johnson25-May-04 8:19
Jim A. Johnson25-May-04 8:19 
GeneralRe: VC7 compiler with VC6 IDE Pin
Michael Dunn25-May-04 8:51
sitebuilderMichael Dunn25-May-04 8:51 
GeneralRe: VC7 compiler with VC6 IDE Pin
Jim A. Johnson25-May-04 11:55
Jim A. Johnson25-May-04 11:55 
GeneralRe: VC7 compiler with VC6 IDE Pin
Anonymous25-May-04 12:34
Anonymous25-May-04 12:34 
GeneralRe: VC7 compiler with VC6 IDE Pin
Jim A. Johnson25-May-04 15:08
Jim A. Johnson25-May-04 15:08 
GeneralRich Edit Control Pin
monrobot1325-May-04 7:29
monrobot1325-May-04 7:29 
GeneralRe: Rich Edit Control Pin
David Crow25-May-04 8:53
David Crow25-May-04 8:53 
GeneralRe: Rich Edit Control Pin
monrobot1325-May-04 10:47
monrobot1325-May-04 10:47 
GeneralRe: Rich Edit Control Pin
David Crow25-May-04 10:51
David Crow25-May-04 10:51 
GeneralRe: Rich Edit Control Pin
monrobot1325-May-04 12:13
monrobot1325-May-04 12:13 

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.