Click here to Skip to main content
15,903,856 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: WMI in windows service - Access Denied Pin
Randor 17-Jul-09 9:21
professional Randor 17-Jul-09 9:21 
GeneralRe: WMI in windows service - Access Denied Pin
hackcrackvirus19-Jul-09 19:01
hackcrackvirus19-Jul-09 19:01 
QuestionCstrings and 64 bit conversions Pin
dasstar17-Jul-09 4:23
dasstar17-Jul-09 4:23 
AnswerRe: Cstrings and 64 bit conversions Pin
Chris Losinger17-Jul-09 4:26
professionalChris Losinger17-Jul-09 4:26 
GeneralRe: Cstrings and 64 bit conversions Pin
dasstar17-Jul-09 5:39
dasstar17-Jul-09 5:39 
QuestionProblem in call Bitmap::FromFile GDI function Pin
Shivanand Gupta17-Jul-09 4:19
Shivanand Gupta17-Jul-09 4:19 
AnswerRe: Problem in call Bitmap::FromFile GDI function Pin
ThatsAlok18-Jul-09 7:44
ThatsAlok18-Jul-09 7:44 
GeneralRe: Problem in call Bitmap::FromFile GDI function Pin
Shivanand Gupta19-Jul-09 18:48
Shivanand Gupta19-Jul-09 18:48 
GeneralRe: Problem in call Bitmap::FromFile GDI function Pin
snailbchen17-Mar-12 5:09
snailbchen17-Mar-12 5:09 
QuestionProblem in call Bitmap::FromFile GDI function Pin
Member 417071117-Jul-09 4:18
Member 417071117-Jul-09 4:18 
QuestionProblem in call Bitmap::FromFile Gdi function Pin
Member 417071117-Jul-09 4:12
Member 417071117-Jul-09 4:12 
QuestionCRect Pin
kumar sanghvi17-Jul-09 3:35
kumar sanghvi17-Jul-09 3:35 
AnswerRe: CRect Pin
Iain Clarke, Warrior Programmer17-Jul-09 3:37
Iain Clarke, Warrior Programmer17-Jul-09 3:37 
QuestionConversion from Cstring to LPSTR Pin
Pardhu_M17-Jul-09 3:18
Pardhu_M17-Jul-09 3:18 
AnswerRe: Conversion from Cstring to LPSTR Pin
Cedric Moonen17-Jul-09 3:23
Cedric Moonen17-Jul-09 3:23 
GeneralRe: Conversion from Cstring to LPSTR Pin
Rajesh R Subramanian17-Jul-09 3:39
professionalRajesh R Subramanian17-Jul-09 3:39 
GeneralRe: Conversion from Cstring to LPSTR Pin
ThatsAlok18-Jul-09 7:45
ThatsAlok18-Jul-09 7:45 
AnswerRe: Conversion from Cstring to LPSTR Pin
Nemanja Trifunovic17-Jul-09 3:42
Nemanja Trifunovic17-Jul-09 3:42 
QuestionHow to disable CDockablePane context menu? Pin
eight17-Jul-09 1:37
eight17-Jul-09 1:37 
AnswerRe: How to disable CDockablePane context menu? Pin
Randor 17-Jul-09 2:26
professional Randor 17-Jul-09 2:26 
GeneralRe: How to disable CDockablePane context menu? Pin
eight19-Jul-09 17:02
eight19-Jul-09 17:02 
GeneralRe: How to disable CDockablePane context menu? Pin
eight19-Jul-09 17:54
eight19-Jul-09 17:54 
AnswerRe: How to disable CDockablePane context menu? Pin
severin09-Oct-09 8:17
severin09-Oct-09 8:17 
QuestionPragma pack, pointer, 32 vs 64 bits build Pin
Kochise17-Jul-09 0:55
Kochise17-Jul-09 0:55 
Hello folks, I'm encountering a problem. Doing message-passing, I'm sending/receiving buffers from various/mixed architectured machines (32 and 64 bits). I first tried to use this as a buffer skeleton :
typedef struct{ // size, offset 32 bits, offset 64 bits
  int   nCount;    //  4,  0,  0
  short nMode;     //  2,  4,  4 <- ???
  sHue  sColor;    //  8,  8,  8
  char* pTest;     //  4, 16, 16
  char  aData[10]; // 10, 20, 24
}sStack,*psStack;  // 28 (real) -> 32 (sizeof 32 bits), 40 (sizeof 64 bits)

On a 32 bits platform, if aData is grown to 12, it fits the whole struct size (12 bytes from offset 20 = 32), thus growing it to 13 push the struct's end to 36 (4 bytes alignment).
However I *NEED* the struct to be exactly the same size, whenever this code runs on a 32 bits machine or, you might have guessed it, a 64 bits one. So I tried :
#pragma pack(8)
  typedef struct{
[...].  }sStack,*psStack;
#pragma pack()

Yet it just doesn't works like expected on a 32 bits build. The struct's size is still 32 bytes, whereas I expected at least 36 (pTest pointer using 8 bytes, thus aData lying at offset 24, hence growing the struct to 34 bytes, aligned to 36 bytes).

stdcall or cdecl calls should remains set to 32 or 64 bits accordingly to the native platform, that means a ((psStack)buff)->pTest instruction shouldn't need to be casted for suiting 32 or 64 bits build. I just need the pointers in struct to be casted to the size of an __int64 (with the needed 4 padding bytes) !

Any luck someone to have a hint, a trick, or just the full answer ? Thanks anyway...

Kochise

In Code we trust !

AnswerRe: Pragma pack, pointer, 32 vs 64 bits build [modified] Pin
Kochise17-Jul-09 1:17
Kochise17-Jul-09 1:17 

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.