Problem with tlbimp

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
 
N

Nicholas Paldino [.NET/C# MVP]

Tim,

Why not declare the interface in code? You don't have to use TLBIMP to
create an interface. If you know the definition and the IID of the
interface, then it is quite easy.

Can you post or reference the IDL file? Then we can probably give you a
definition you can use.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top