Re: invalid conversion from void* to void**
Re: invalid conversion from void* to void**
- Subject: Re: invalid conversion from void* to void**
- From: Chris Hanson <email@hidden>
- Date: Sat, 7 Oct 2006 21:09:18 -0700
On Oct 6, 2006, at 8:58 PM, Alfred Van Hoek wrote: Might be trivial, but what used to compile does not anymore:
Given:
IOFireWireAVCLibUnitInterface** avcUnit;
// ask for the AVC unit interface result = (*interface)->QueryInterface( interface, CFUUIDGetUUIDBytes( kIOFireWireAVCLibUnitInterfaceID ), (LPVOID)&avcUnit );
The compiler chokes on (LPVOID)&avcUnit. This is how it should be called though, (LPVoid)avcUnit will lead to a crash. Any pointers? Your declaration of avcUnit is incorrect. QueryInterface returns a void* (in COM terms, an LPVOID) by reference. Thus you need to pass it a pointer to a void* like so:
IOFireWireAVCLibUnitInterface *avcUnit;
// ask for the AVC unit interface result = (*interface)->QueryInterface( interface, CFUUIDGetUUIDBytes( kIOFireWireAVCLibUnitInterfaceID ), (LPVOID)&avcUnit ); Now — assuming there was no error returned — avcUnit is a pointer to an IOFireWireAVCLibUnitInterface that you can interact with.
-- Chris
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden