Orcas ATL attributes support

Jun 29, 2007 at 4:09 PM
Hello, I downloaded Atl server library and tried to use it to build my projects under Orcas Beta 1; these projects use ATL attributes such as soaphandler, soapmethod... but they seem to be not supported by Visual Studio 9.
Is there any work around?
Thank you
Coordinator
Jul 8, 2007 at 6:30 PM
Hi Marko,

ATL Server attributes are not supported by Orcas compiler. You have to remove attributes from your code and get non-attributed ATL Server code that used to be injected by the compiler. To do this, recompile your code with /FX with the current version of compiler you are using. Here is more information about what /FX does - http://msdn2.microsoft.com/en-us/library/d8ex062w(VS.80).aspx. After compiler generated .mrg files, make a backup copy of your old source files and replace them with .mrg. files generated by /FX build. Rebuild your app with the current version of Visual Studio and make sure everything works as expected. Then port the code to Orcas and version of ATL Server from this project. You can comment out attributes now and Orcas compiler should build new source just fine.

Regards,
Nikola
Jul 9, 2007 at 8:22 AM
Thank you very much for your exaustive reply; we still have one trouble: since our ATL server code is not static, but is dynamically generated by parsing some other .cpp files (and the tool that creates this code is also distributed to our ISV partners), is there a way to invoke the Visual2005 attribute provider so as to hide all the plumbing code generation details to out partners? (for example via COM calls?)
Thank you again
Marco Perasso
Coordinator
Jul 11, 2007 at 6:27 PM
I am not exactly sure what you are asking. If my reading is correct, you have your own tool that generates cpp code with ATL Server attributes and you want to use compiler to unroll those attributes. Unfortunately you cannot call into the compiler to do that. However it is quite deterministic what code compiler injects for an attribute. I have not looked into details fo this, but I have a feeling that it should not be hard to directly generate non-attributed cpp code from your tool. This is the best solution I can think of at this moment. I would try this first before thinking of a more complex solution.

Thanks,
Nikola
Dec 6, 2010 at 6:44 AM
atlsadmin wrote:
Hi Marko,

ATL Server attributes are not supported by Orcas compiler. You have to remove attributes from your code and get non-attributed ATL Server code that used to be injected by the compiler. To do this, recompile your code with /FX with the current version of compiler you are using. Here is more information about what /FX does - http://msdn2.microsoft.com/en-us/library/d8ex062w(VS.80).aspx. After compiler generated .mrg files, make a backup copy of your old source files and replace them with .mrg. files generated by /FX build. Rebuild your app with the current version of Visual Studio and make sure everything works as expected. Then port the code to Orcas and version of ATL Server from this project. You can comment out attributes now and Orcas compiler should build new source just fine.

Regards,
Nikola

 

May 26, 2011 at 9:47 AM

Hello atlsadmin

Its really a nice post!.am trying the same thing but all in vain.. :(

I just followed the walk through , but still I get those errors,

 

 and am not using  Orcas compiler..

I just have a ATL server project which is also a web service. which was built in vs 2005. Now I need to build the same project in VC9 VS2008 . I followed the walk through.

Got the .mrg.h and .mrg.cpp when compiled in Vs2005 with /Fx option. After I copied the code from the generated mrgs and replaced the code with the corresponding cpp and corresponding header,. When I rebuilrd it in Vs2008, am getting the above errors..

Could you please help me?

Thanks

 1>qig_deilmhprjr212\catplmimplipd\data.d\IPDWebService_inj.h(13) : warning C4684: 'no_injected_text' : WARNING!! attribute may cause invalid code gneration: use with caution

 1>NOTE: This merged source file should be visually inspected for correctness.

 1>qig_deilmhprjr212\catplmimplipd\data.d\IPDWebService_inj.h(318) : error C2337: 'request_handler' : attribute not found

1>qig_deilmhprjr212\catplmimplipd\data.d\IPDWebService_inj.h(318) : error C2337: 'soap_handler' : attribute not found

1>qig_deilmhprjr212\catplmimplipd\data.d\IPDWebService_inj.h(318) : fatal error C1903: unable to recover from previous error(s); stopping compilation