atlcom

Building Proxy/Stub dll in VS 2008

江枫思渺然 提交于 2019-12-10 20:45:51
问题 I have a ATLCOM project migrated from VC6 to VS2008. My question is, how do I build the ps dllon VS 2008? New ATL projects in VS2008 have a separate PS project which builds the ps dll. But the migration from VC6 did not create this project. I tried to invoke nmake on the ps mk file but that gives a redefinition error for an enum type which exists in both our source file as well as an automatically included windows header file. In the solution we fixed this by defining the WIN32_LEAN_AND_MEAN

VS 2008 atlcom.h ClassesAllowedInStream not defined (cannot convert parameter)

不羁的心 提交于 2019-12-02 17:19:36
问题 I am trying to build a project in VC++2008 and it is giving the following error: error C2664: 'HRESULT ATL::CComVariant::ReadFromStream (IStream *,VARTYPE,ATL::ClassesAllowedInStream,DWORD)' : cannot convert parameter 3 from 'const int' to 'ATL::ClassesAllowedInStream' c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlcom.h 6054 Can anyone help? 回答1: This is an error that stems from a bug in the VS2008 Service Pack 1 installation. I had the same problem. A workaround for

VS 2008 atlcom.h ClassesAllowedInStream not defined (cannot convert parameter)

家住魔仙堡 提交于 2019-12-02 08:35:44
I am trying to build a project in VC++2008 and it is giving the following error: error C2664: 'HRESULT ATL::CComVariant::ReadFromStream (IStream *,VARTYPE,ATL::ClassesAllowedInStream,DWORD)' : cannot convert parameter 3 from 'const int' to 'ATL::ClassesAllowedInStream' c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlcom.h 6054 Can anyone help? This is an error that stems from a bug in the VS2008 Service Pack 1 installation. I had the same problem. A workaround for me was to reinstall VS 2008 (setup option "repair/clean new install") and then immediately install SP1. The

dynamic_cast of a COM object to a COM interface doesn't bump the reference count, does it?

喜欢而已 提交于 2019-12-02 05:46:43
问题 If I have a C++ class, X, which implements the COM interfaces IY and IZ, and I have a pointer y to the IY interface of an object of type X, and I do this: IZ *z = dynamic_cast<IZ *> ( y ); That doesn't bump the object's reference count, does it? I don't have to do a Release() to account for it, right? If it matters, I'm using ATL/COM. I'm guessing the answer is "no it doesn't bump the reference count, and no you don't have to Release()", but I want to make sure. Thanks in advance. 回答1:

dynamic_cast of a COM object to a COM interface doesn't bump the reference count, does it?

荒凉一梦 提交于 2019-12-02 02:16:27
If I have a C++ class, X, which implements the COM interfaces IY and IZ, and I have a pointer y to the IY interface of an object of type X, and I do this: IZ *z = dynamic_cast<IZ *> ( y ); That doesn't bump the object's reference count, does it? I don't have to do a Release() to account for it, right? If it matters, I'm using ATL/COM. I'm guessing the answer is "no it doesn't bump the reference count, and no you don't have to Release()", but I want to make sure. Thanks in advance. Reference counts for COM objects are incremented when someone calls IUnknown::AddRef(). QueryInterface(),