T
Tim Haughton
I'm trying to use the IThumbnailCache COM interface to query Vista's system
thumbnail cache. Unfortunately there's no type library for it. Here's what
I've done so far:
- Created thumbcache.tlb from thumbcache.idl using midl
- Created thumbcachelib.dll from thumbcache.tlb using tlbimp
- Tried to use it.
There were a multitude of errors when I used tlbimp, but everything seemed
to work until...
A method on the SharedBitmap had the wrong signature. We had:
void GetSharedBitmap(IntPtr phbm);
Instead of
void GetSharedBitmap(out IntPtr phbm);
So we checked the idl, which was correct, then we looked at tlbimp's
output -
TlbImp : warning TI0000 : At least one of the arguments for
'ISharedBitmap.GetSharedBitmap' cannot be marshaled by the runtime
marshaler. Such arguments will therefore be passed as a pointer and may
require unsafe code to manipulate.
So, I'm thinking this is the problem I'm seeing. Obviously, I still need to
get a hold of the IntPtr so I can construct the bitmap on the .Net end. Any
suggestions?
Cheers,
Tim
thumbnail cache. Unfortunately there's no type library for it. Here's what
I've done so far:
- Created thumbcache.tlb from thumbcache.idl using midl
- Created thumbcachelib.dll from thumbcache.tlb using tlbimp
- Tried to use it.
There were a multitude of errors when I used tlbimp, but everything seemed
to work until...
A method on the SharedBitmap had the wrong signature. We had:
void GetSharedBitmap(IntPtr phbm);
Instead of
void GetSharedBitmap(out IntPtr phbm);
So we checked the idl, which was correct, then we looked at tlbimp's
output -
TlbImp : warning TI0000 : At least one of the arguments for
'ISharedBitmap.GetSharedBitmap' cannot be marshaled by the runtime
marshaler. Such arguments will therefore be passed as a pointer and may
require unsafe code to manipulate.
So, I'm thinking this is the problem I'm seeing. Obviously, I still need to
get a hold of the IntPtr so I can construct the bitmap on the .Net end. Any
suggestions?
Cheers,
Tim