none
COM components interoperate with the .NET runtime RRS feed

  • Question

  • Hi,

    I used to use a windows application built under the framework 2 and this application is calling a COM object (ActiveX) and its working fine with no problems until I decided to rewrite the source code from scratch under the framework 4 using VS 2010 and VB.net 2010 where I started to get problems in the instance declaration and instantiating spatially in windows service application.

    So I'm really wandering what is exactly is happened here? The COM object is the same and its unmanaged code and it shouldn't be affected if I target a deferent framework in my opinion which could be right or wrong.

    I started few days ago to read about COM components interoperate with the .NET runtime trying to gain more knowledge and finding some answers.

    Please anyone can help me and give me some answers for the following points.

    1.     Is there is a deference in calling a COM object from the .NET runtime in framework 2, 3, 3.5 and 4?  

    2.     Is it passable that calling COM object from managed code which is targeting framework 2 will not work when the managed code changed to target other versions of the .NET framework?

    I needed some article links that can shed more lights on the subject.

    Thanks.

    Friday, September 2, 2011 11:54 PM

Answers

  • Hi,

    I hope there are no difference in calling as well as passing the com object.I have run thru the problems you are facing as result, i was answering you.

    Regards,

    A,Murugan.


    Please mark this post as answer if it solved your problem. Happy Programming!
    • Marked as answer by Sami2020 Tuesday, September 6, 2011 3:41 PM
    Saturday, September 3, 2011 8:21 AM

All replies

  • Hi,

    I hope there are no difference in calling as well as passing the com object.I have run thru the problems you are facing as result, i was answering you.

    Regards,

    A,Murugan.


    Please mark this post as answer if it solved your problem. Happy Programming!
    • Marked as answer by Sami2020 Tuesday, September 6, 2011 3:41 PM
    Saturday, September 3, 2011 8:21 AM
  • When we add reference to a COM component from the COM tab of Add Reference dialog, an interop assembly (which has "Interop" prefix) will be generated automatically. VS2008 and VS2010 use different versions of tool to finish this job, so you can re-add reference to the COM component in VS2010 and retry.
    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, September 6, 2011 3:26 AM
  • My problem finally has been resolved. There is no deference in calling a COM object from the managed code when the target framework changed, according to my experience during this problem.

    I really appreciated the help.

    Thanks.  

    Tuesday, September 6, 2011 3:40 PM