Click here to Skip to main content
15,886,110 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Ms Word Automation PageWidth HiMetric Pin
Braulio Dez30-Jun-02 21:56
Braulio Dez30-Jun-02 21:56 
Generalcrypted CFile, used with CArchive Pin
eXplodus27-Jun-02 20:51
eXplodus27-Jun-02 20:51 
GeneralVERY urgent(VC++) !!!!!!!! Pin
shanker27-Jun-02 20:48
shanker27-Jun-02 20:48 
GeneralSource of spreadsheet program Pin
ivex27-Jun-02 20:06
ivex27-Jun-02 20:06 
GeneralSet Title in MDIChildFrame Pin
27-Jun-02 20:04
suss27-Jun-02 20:04 
GeneralRe: Set Title in MDIChildFrame Pin
Bill S27-Jun-02 20:18
professionalBill S27-Jun-02 20:18 
GeneralRe: Set Title in MDIChildFrame Pin
louise27-Jun-02 21:21
louise27-Jun-02 21:21 
GeneralWhy is this not 512 bytes! Pin
clintsinger27-Jun-02 18:09
clintsinger27-Jun-02 18:09 
I have some code to read the partition table. The structure is supposed to be 512 bytes to read from the disk and I have translated from the Pascal code the following structure to c++:

(The pascal code works fine as it is 512 bytes)
TPartEntry = record
	boot_ind    : Byte;		// 0x80 - active
	head        : Byte;		// starting head
	sector      : Byte;		// starting sector
	cyl         : Byte;		// starting cylinder
	sys_ind     : Byte;		// What partition type
	end_head    : Byte;		// end head
	end_sector  : Byte;	   // end sector
	end_cyl     : Byte;		// end cylinder
	start_sect  : UINT;	   // starting sector counting from 0
	nr_sects    : UINT;  	// nr of sectors in partition
  end;

  TDiskTable = record
   Data  : array[1..446] of Char;
   Table : array[1..4] of TPartEntry;
   Signature : WORD;
  end;

... to get this...
typedef struct tagPARTENTRY
{
	BYTE		bBoot;	 	// 0x80
	BYTE		bHead;	 	// starting head
	BYTE		bSector; 	// starting sector
	BYTE		bCyl;	 	// starting cylinder
	BYTE		bSysInd; 	// What partition type
	BYTE		bEndHead; 	// end head
	BYTE		bEndSector;     // end sector
	BYTE		bEndCyl; 	// end cylinder
	UINT		unStartSect;    // start sector starting from 0
	UINT		unNumSects;     // number of sectors in partition
} PARTENTRY;

typedef struct tagDISKTABLE
{
	CHAR		cData[446];
	PARTENTRY 	tTable[4];
	WORD		wSignature;
} DISKTABLE;


When I do a sizeof(DISKTABLE) it returns a size of 516 bytes. When I manually add up the values I get 512 bytes. Where are the other 4 bytes coming from and what am I doing wrong? WTF | :WTF:

Cheers,
Clint
GeneralRe: Why is this not 512 bytes! Pin
Joaquín M López Muñoz27-Jun-02 20:03
Joaquín M López Muñoz27-Jun-02 20:03 
GeneralRe: Why is this not 512 bytes! Pin
clintsinger28-Jun-02 6:46
clintsinger28-Jun-02 6:46 
GeneralGot it! Pin
clintsinger28-Jun-02 7:28
clintsinger28-Jun-02 7:28 
Questionhow to handle HANDLE from CreateEvent() after used it? Pin
zecodela27-Jun-02 18:07
zecodela27-Jun-02 18:07 
AnswerRe: how to handle HANDLE from CreateEvent() after used it? Pin
Prem Kumar27-Jun-02 19:43
Prem Kumar27-Jun-02 19:43 
GeneralRe: how to handle HANDLE from CreateEvent() after used it? Pin
zecodela28-Jun-02 16:17
zecodela28-Jun-02 16:17 
QuestionHow to return a COM Obj from ATL Pin
27-Jun-02 16:55
suss27-Jun-02 16:55 
AnswerRe: How to return a COM Obj from ATL Pin
Prem Kumar27-Jun-02 19:44
Prem Kumar27-Jun-02 19:44 
AnswerRe: How to return a COM Obj from ATL Pin
A.A.28-Jun-02 17:13
A.A.28-Jun-02 17:13 
GeneralRe: How to return a COM Obj from ATL Pin
29-Jun-02 7:45
suss29-Jun-02 7:45 
GeneralRe: How to return a COM Obj from ATL Pin
A.A.29-Jun-02 14:02
A.A.29-Jun-02 14:02 
Generalwriting a dll Pin
Steve L.27-Jun-02 14:24
Steve L.27-Jun-02 14:24 
GeneralRe: writing a dll Pin
Navin27-Jun-02 15:47
Navin27-Jun-02 15:47 
GeneralRe: writing a dll Pin
Alexandru Savescu27-Jun-02 18:06
Alexandru Savescu27-Jun-02 18:06 
GeneralSet Check and CTreeCtrl Pin
Mr. Bill27-Jun-02 13:34
Mr. Bill27-Jun-02 13:34 
GeneralRe: Set Check and CTreeCtrl Pin
Mr. Bill28-Jun-02 6:37
Mr. Bill28-Jun-02 6:37 
GeneralAccelerator Keys for dynamic created Context Menus Pin
27-Jun-02 11:24
suss27-Jun-02 11:24 

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.