realbasic-nug
[Top] [All Lists]

Re: Win32 struct -> RB struct translation

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Win32 struct -> RB struct translation
From: Norman Palardy <npalardy at great-white-software dot com>
Date: Sun, 30 Sep 2007 22:19:28 -0600
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <C3E6B1C5-19AD-45AD-88AE-EEA00F58E2F4 at sonicamigos dot com>
On 30-Sep-07, at 9:26 PM, E. Tejkowski wrote:

> I don't have a Win32 C compiler handy at the moment, otherwise I
> could check this stuff myself… but I need a little help translating a
> Win32 struct to an RB struct.
>
> 1. In the struct below, how should I handle the GUID type? (e.g. how
> many bytes is it?)
> 2. Is the BOOL type equivalent to RB's Boolean type?
> 3. And, what does the gobbledy-gook in front of "BYTE
> *pbFormat" (i.e. [size_is(cbFormat)]) mean?
>
> typedef struct  _MediaType {
> GUID      majortype;
> GUID      subtype;
> BOOL      bFixedSizeSamples;
> BOOL      bTemporalCompression;
> ULONG     lSampleSize;
> GUID      formattype;
> IUnknown  *pUnk;
> ULONG     cbFormat;
> [size_is(cbFormat)] BYTE *pbFormat;
> } AM_MEDIA_TYPE;
>

1) GUID's are 16 bytes (128 bits)
2) it's been a while but I believe they should be an int (16 or 32  
bits I don't recall)
3) you'd have to look up what size_is does but I expect it's a  
compile time macro that expands out to get you some specific kind of  
pointer based on architecture



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>