[postgis-users] Help with WKB and VC++

Gary Sherman sherman at mrcc.com
Sat Nov 8 09:12:03 PST 2003


> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net] On 
> Behalf Of Christoph Spoerri
> Sent: Saturday, November 08, 2003 6:36 AM
> To: PostGIS Users Discussion
> Subject: [postgis-users] Help with WKB and VC++
> 
> 
> While things move along nicely, I came across the following 
> stumbling block: 
> after retrieving the geometries from the database in WKB 
> format, I need to 
> assign them to a IUnknown* object. Now, I have the following 
> two questions: 1. How to I cast from char* to IUnknown* ? 2. 
> If I need to copy the returned binary data (as suggested in 
> the postgresql 
> docs), what's an easy (and quick) way to do this?
Its been a while since I did any COM work but..

To quote the MS docs:
"The IUnknown interface lets clients get pointers to other interfaces on
a given object through the QueryInterface method, and manage the
existence of the object through the IUnknown::AddRef and
IUnknown::Release methods. All other COM interfaces are inherited,
directly or indirectly, from IUnknown. Therefore, the three methods in
IUnknown are the first entries in the VTable for every interface."

So you can't really cast from char * to IUnknown*.  Your COM object
should implement the methods needed to manipulate the WKB data.

-gary





More information about the postgis-users mailing list