#import and embedded_idl

D

Dirk

Hello

I use the #import directive to get the type information and smart pointers
for a com object. To enable the event_receiver attribute on classes in the
client I have to use the embedded_idl attribute on the #import directive.
However it seems that now I can only use raw property accessors with get_
prefix and with exceptions. I can reproduce the problem with a wizard
generated win32 console application in vs.net 2003.
In stdafx.h I just use #import for the com dll and I can access property
with this syntax pFoo->Property. Then I simply add embedded_idl to #import
and now only pFoo->get_Property(...) works.
pFoo->Property // C2039 Property is not a member of IFoo

How can use the property wrappers and event handling at the same time?

Thanks
 
K

Keiji Oenoki

Then I simply add embedded_idl to #import
and now only pFoo->get_Property(...) works.

pFoo->Property works if Property is declared with __declspec(property).
Unfortunately specifying embedded_idl causes the compiler to use attributes
([propget] and [propset]) instead of __declspec(property).
 

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