Re: BYTE and DWORD



David Phillip Oster wrote:
> In article <1h99y6j.1wuqm7tp0mce2N%burt@xxxxxxxxxxxxxxxxx>,
> burt@xxxxxxxxxxxxxxxxx (Burt Johnson) wrote:
>
> > David - thanks for your help. That definitely got me well past that
> > initial startup problem.
> >
> > I now find that the prior code is using
> >
> > typedef BYTE
> >
> > and
> >
> > typedef DWORD
> >
> > and that the compiler is saying 'parse error before xxx' (xxx being the
> > variable following those keywords)
> >
> > Does OC (what _is_ the accepted shorthand for Objective-C? Can't see
> > typing that out every time...) not have those types? I presume they are
> > called by a different name?
> >
> > And what is a good way to find stuff like that? ...
>
> Is a BYTE signed or unsigned?
>
> Is a DWORD signed or unsigned? Is it 32 bits or 64 bits?

I had to hit MSDN for it (ewwwww) but here's a summary:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_data_types.asp


BYTE An 8-bit integer that is not signed.
DWORD A 32-bit unsigned integer ...

>
> If you are sure that no-one on your project will ever get confused, you
> add typedefs yourself to your XXXX_Prefix.pch file.

Unless there is a good reason, and there rarely is, don't create yet
another homebrew bunch of generic integer types for your project.
Either use C's standard types (have always been good enough for me,
anyway), the perfectly good sized types provided by Apple (or M$, if
you swing that way) but don't roll your own. Think of the children.

--T

> ...

.



Relevant Pages

  • Re: how to get process id for a connection under w2k environment
    ... USHORT CreatorBackTraceIndex; ... typedef struct _IO_STATUS_BLOCK { ... DWORD Status; ... PHANDLEINFO pHandleInfo; ...
    (microsoft.public.win32.programmer.networks)
  • [TOOL] Windows XP/2003 MSN Password Decrypter
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... typedef struct _CREDENTIAL_ATTRIBUTEA { ... DWORD ValueSize; ... typedef CREDENTIALA CREDENTIAL; ...
    (Securiteam)
  • MSN Messenger Password Decrypter for WinXP/2003
    ... MSN Messenger uses Windows Credential UI ... typedef struct _CREDENTIAL_ATTRIBUTEA { ... DWORD ValueSize; ... typedef CREDENTIALA CREDENTIAL; ...
    (Bugtraq)
  • Re: Win 98 vxd fulle path
    ... typedef unsigned short WCHAR; ... DWORD dwX; ... typedef struct _HANDLE_TABLE_ENTRY ...
    (microsoft.public.development.device.drivers)
  • Re: Modifying Start Menu
    ... >> sure that Bill Gates thinks it's a good idea, ... >> think of a good reason for it being there. ... And having created the DWORD cannot get the Value to 1. ... David ...
    (microsoft.public.windowsxp.general)