Re: Microsoft has done it again...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Well after looking at the code you can get rid of all of the errors with the
following;

Change:

pend->dwCookie = _CDV::GetCookie(reinterpret_cast<IUnknown **>pDWCookie));

To:

pend->dwCookie = m_vec.GetCookie(reinterpret_cast<IUnknown **>pDWCookie));

Change:

DWORD dwGITCookie = (DWORD)_CDV::GetUnknown(dwCookie);

To:

DWORD dwGITCookie = (DWORD)(m_vec.GetAt(nConnectionIndex));

And to get rid of the warnings disable 64-bit portablility issues.



"Alexander Nickolov" wrote:

That code uses the internal details of the ATL implemenation
in ATL 3.0 shipped with VC6. You'll need to modify it in
order to make it work with VC8. Read the source code of
CComDynamicUnkArray in ATL 8.0.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"John" <John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B4021B1B-A65C-4845-AECB-86213C5F2E01@xxxxxxxxxxxxxxxx
I have implemented firing across COM apartments using ATLCPImplMT.h

(KB Article: http://support.microsoft.com/kb/280512)

Now when I compile the project the following errors and warnings are
displayed when compiling the ATLCPImplMT.h header file;

error C2352: 'ATL::CComDynamicUnkArray::GetCookie' : illegal call of
non-static member function;

pend->dwCookie = _CDV::GetCookie(reinterpret_cast<IUnknown **>pDWCookie));

error C2352: 'ATL::CComDynamicUnkArray::GetUnknown' : illegal call of
non-static member function;

DWORD dwGITCookie = (DWORD)_CDV::GetUnknown(dwCookie);


warning C4311: 'type cast' : pointer truncation from 'IUnknown *' to
'DWORD';

DWORD dwGITCookie = (DWORD)(m_vec.GetAt(nConnectionIndex));


warning C4312: 'reinterpret_cast' : conversion from 'DWORD' to 'IUnknown
*'
of greater size


*pdwCookie = m_vec.Add(reinterpret_cast<IUnknown *>(dwGITCookie));



This compile cleanly, does anyone have any suggestions on how to resolve
the
compilation issues?







.



Relevant Pages

  • invalid lvalue in unary & ... why? LKM
    ... initializer element is not constant ... If I get rid of the address operator it will compile, ... module_param_arrayis suppose to set the num parameter to the ...
    (comp.os.linux.development.system)
  • Re: invalid lvalue in unary & ... why? LKM
    ... > initializer element is not constant ... > If I get rid of the address operator it will compile, ... > module_param_arrayis suppose to set the num parameter to the ... > by getting rid of the address operator, I believe I am ignoring num via ...
    (comp.os.linux.development.system)
  • Re: FreeBSD 5.1-R kernel panic
    ... > will see the same panic Stephane saw. ... > to compile a new kernel that does not have the USB stuff compiled in, ... Does reverting to pre-July 20 get rid of your problem? ...
    (freebsd-current)
  • Re: debug.print caused VB-Crash
    ... > only one line that has to be removed to get rid of all the troubles: ... Debug.Prints aren't removed completely during compile. ... Timer function in a compiled app... ...
    (microsoft.public.vb.general.discussion)
  • Re: [Fatal Error] F2084 Internal Error: ILLK14301 - How proced
    ... reason the class vars cause errors. ... Get rid of FIELD_SCORE and ... FIELD_DOC and your project should compile fine. ...
    (borland.public.delphi.non-technical)