Re: Converting event handling from VC++ 2005 to VC++ 2008

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



Boris,

I'm converting a software from VC++ 2005 to VC++ 2008. As VC++ 2008  
doesn't support attributes anymore I got rid of them everywhere. However I  
wonder if I need to get rid of the keywords __hook, __unhook and __raise,  
too. I guess I need to replace them with something else. Does anyone know  
a webpage with a short description of how to replace these keywords with  
code? I'm fine with a very simple description as the rest I can then  
hopefully figure out myself.

You can turn on generation of C++ source code for attributed source
and see yourself what code is substituted in place of __hook etc.

If you mean COM events, hook/unhook will be connecting to connection
point (IConnectionPoint::Advise explicit or wrapped into some class),
for a __raise you will need a helper class IDE typically [re-]
generates for a dispinterface through Class View and you inherit your
class from it. Then your ATLVERIFY(SUCCEEDED(__raise Event(123)));
will be ATLVERIFY(SUCCEEDED(Fire_Event(123)));

Roman
.



Relevant Pages

  • Re: Unicode build issues
    ... There were some differences with the compiler settings between the base ... classes and the host application such as how to use the C Runtime. ... I don't think I should really need to be doing), but one I cannot get rid ... source code of this method. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Cannot remove my previous device
    ... Microsoft MVP - Mobile Devices ... Got anew iPaq and my previous is broken, does not do anything anymore. ... Now connecting my new device, the wizard asks for a new name, as the ...
    (microsoft.public.pocketpc.activesync)
  • Re: Unicode build issues
    ... Just in case I done a full rebuild again but still I get the issues. ... I seem to be able to get rid of most of them by editing the code (which ... source code of this method. ... Trim & respond inline ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: hidden class code
    ... there is no need for the "source code" of the ... method to be included anymore. ... Even opening the class as a tble does not reveal the code behind the ...
    (microsoft.public.fox.programmer.exchange)
  • Cannot remove my previous device
    ... Got anew iPaq and my previous is broken, does not do anything anymore. ... Now connecting my new device, the wizard asks for a new name, as the ...
    (microsoft.public.pocketpc.activesync)