I am trying to call a Multimedia Function:
MMRESULT mixerGetID(
HMIXEROBJ hmxobj,
UINT_PTR * puMxId,
DWORD fdwId
);
Where puMxId is described as a 'Pointer to a variable that receives the
mixer device identifier.'
If I understand this correctly, 'UINT_PTR *' is just a pointer to a uint.
I base this on:
typedef DWORD LPVOID;
typedef LPVOID UINT_PTR;
So is the correct parameter call of the form 'ref uint'?
Mattias Sj?gren - 07 Dec 2004 22:40 GMT
>If I understand this correctly, 'UINT_PTR *' is just a pointer to a uint.
Not quite, it's a pointer to an unsigned pointer-sized integer.
>I base this on:
>
>typedef DWORD LPVOID;
>typedef LPVOID UINT_PTR;
Where did you find that? They aren't correct.
>So is the correct parameter call of the form 'ref uint'?
I'd use "out IntPtr".
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
HarveyB - 08 Dec 2004 22:45 GMT
I got the typdefs out of Windows.h in Visual Studio 6. Are these definitions
obsolete? They are contemporaneous with the most recent release of the
Platform SDK from which I am implementing some low level Audio functions.
"Mattias Sjögren" wrote:
> >If I understand this correctly, 'UINT_PTR *' is just a pointer to a uint.
>
[quoted text clipped - 12 lines]
>
> Mattias
Lau Lei Cheong - 09 Dec 2004 02:10 GMT
There is usually two suitation where an API will try to accept pointer to
primitive type as parameter:
1) the parameter is an array of the primitive type; or
2) the parameter is to be a by-reference type variable that the function
will write data in.
Obviously the puMxId should not be an array so your assumption is correct.
LPVOID just states that the pointer is to be a 32-bit pointer and nothing
else, it can be pointed to anything.
> Not quite, it's a pointer to an unsigned pointer-sized integer
it's correct but the "ref uint" will do too.
> I am trying to call a Multimedia Function:
>
[quoted text clipped - 14 lines]
>
> So is the correct parameter call of the form 'ref uint'?