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

C / C++ / MFC

 
AnswerRe: resource leak in this case? Pin
Maxwell Chen12-Mar-08 22:54
Maxwell Chen12-Mar-08 22:54 
GeneralRe: resource leak in this case? Pin
George_George12-Mar-08 23:01
George_George12-Mar-08 23:01 
AnswerRe: resource leak in this case? [modified] Pin
Maxwell Chen12-Mar-08 23:11
Maxwell Chen12-Mar-08 23:11 
GeneralRe: resource leak in this case? Pin
George_George13-Mar-08 0:52
George_George13-Mar-08 0:52 
QuestionRe: resource leak in this case? Pin
Maxwell Chen13-Mar-08 8:47
Maxwell Chen13-Mar-08 8:47 
GeneralRe: resource leak in this case? Pin
George_George13-Mar-08 14:55
George_George13-Mar-08 14:55 
Generalincompatbilties between C and C++ ins aignment Pin
ForNow12-Mar-08 14:52
ForNow12-Mar-08 14:52 
GeneralRe: incompatbilties between C and C++ ins aignment Pin
Blake Miller13-Mar-08 11:25
Blake Miller13-Mar-08 11:25 
Yes, the #pragma pack should be around EVERY structure.

Something like this could be 4, 8, or 16 bytes, depending upon the project settings:

typedef struct _MyTinyStruct {<br />
  unsigned short a;<br />
  unsigned short b;<br />
} SMyTinyStruct ;


But THIS will always be 4 bytes:

#pragma pack( push, packSMyTinyStruct, 2  )<br />
<br />
typedef struct _MyTinyStruct {<br />
  unsigned short a;<br />
  unsigned short b;<br />
} SMyTinyStruct ;<br />
<br />
#pragma pack( pop, packSMyTinyStruct )


It is up to you how much pain you want to endure. Using #pragma to me is always less painful.

extern "C" controls naming connnention and has nothign to do with the total size of a data structure.
GeneralRe: incompatbilties between C and C++ ins aignment Pin
ForNow13-Mar-08 12:51
ForNow13-Mar-08 12:51 
GeneralCListCtrl Prevent Column Resizing Pin
JBAK_CP12-Mar-08 7:08
JBAK_CP12-Mar-08 7:08 
GeneralRe: CListCtrl Prevent Column Resizing Pin
David Crow12-Mar-08 7:42
David Crow12-Mar-08 7:42 
GeneralRe: CListCtrl Prevent Column Resizing Pin
sheshidar12-Mar-08 18:17
sheshidar12-Mar-08 18:17 
GeneralUDP socket Pin
nahitan12-Mar-08 5:53
nahitan12-Mar-08 5:53 
GeneralRe: UDP socket Pin
Mark Salsbery12-Mar-08 5:57
Mark Salsbery12-Mar-08 5:57 
GeneralRe: UDP socket Pin
Eytukan12-Mar-08 6:25
Eytukan12-Mar-08 6:25 
GeneralRe: UDP socket Pin
Moak13-Mar-08 15:05
Moak13-Mar-08 15:05 
GeneralRe: UDP socket Pin
nahitan17-Mar-08 5:20
nahitan17-Mar-08 5:20 
GeneralRe: UDP socket Pin
Moak17-Mar-08 6:36
Moak17-Mar-08 6:36 
Generalbehavior of strlen() [modified] Pin
koumodaki12-Mar-08 5:27
koumodaki12-Mar-08 5:27 
GeneralRe: behavior of strlen() modified Pin
Rajkumar R12-Mar-08 5:33
Rajkumar R12-Mar-08 5:33 
GeneralRe: behavior of strlen() Pin
koumodaki12-Mar-08 5:36
koumodaki12-Mar-08 5:36 
GeneralRe: behavior of strlen() Pin
Rajkumar R12-Mar-08 5:37
Rajkumar R12-Mar-08 5:37 
GeneralRe: behavior of strlen() Pin
David Crow12-Mar-08 5:43
David Crow12-Mar-08 5:43 
GeneralRe: behavior of strlen() modified Pin
koumodaki12-Mar-08 5:44
koumodaki12-Mar-08 5:44 
GeneralRe: behavior of strlen() modified Pin
David Crow12-Mar-08 5:47
David Crow12-Mar-08 5:47 

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.