473,388 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

COM component in Managed C++

Hi All,

Currently we have COM component(dll) implemented using ATL.
Because of the current business requirements, we would like to rewrite
the COM component in Managed C++ and the clients will be unmanaged C++
and C# .

I have been searching net to find some sample code and but could not
get it.

Please give me some pointers on how to implement COM component in
Managed C++.

Thanks a lot.
Shesh

Jul 16 '07 #1
3 1722
Hi,
>
Currently we have COM component(dll) implemented using ATL.
Because of the current business requirements, we would like to rewrite
the COM component in Managed C++ and the clients will be unmanaged C++
and C# .

I have been searching net to find some sample code and but could not
get it.

Please give me some pointers on how to implement COM component in
Managed C++.
Why would you want to do that? If you want to create COM objects in VC++ and
use them also in C# then write unmanaged COM objects and have tlbimp produce
the .Net COM wrappers.
What would be the benefit of using Managed C++ here? At least I guess you
wanted C++/CLI the successor of Managed C++?
If you want to use the .Net framework to implement the component then just
use C# and make it COM-visible. That COM component can then be used with
#import in VC++.

--
SvenC

Jul 17 '07 #2
On Jul 17, 11:35 am, "SvenC" <Sv...@community.nospamwrote:
Hi,
Currently we have COM component(dll) implemented using ATL.
Because of the current business requirements, we would like to rewrite
the COM component in Managed C++ and the clients will be unmanaged C++
and C# .
I have been searching net to find some sample code and but could not
get it.
Please give me some pointers on how to implement COM component in
Managed C++.

Why would you want to do that? If you want to create COM objects in VC++ and
use them also in C# then write unmanaged COM objects and have tlbimp produce
the .Net COM wrappers.
We would like to modify the current component to use a new C# Parser
library and this
component shall be used by a new framework(managed). Along with this,
we need to
support existing clients without making any changes to them.
So, we thought we could avoid a lot of marshaling by rewriting the
code in managed world.
(current component uses safearrays, bstr...)
What would be the benefit of using Managed C++ here? At least I guess you
wanted C++/CLI the successor of Managed C++?
Initially we thought a lot of code in the COM component can be reused.
If you want to use the .Net framework to implement the component then just
use C# and make it COM-visible. That COM component can then be used with
#import in VC++.
Currently the COM interfaces and their implementations are in separate
dlls.
Would it be possible, to implement those interfaces in C# by importing
the types
in the tlb file, so that we can keep the interfaces separate? (current
clients
depends on these interfaces and we don't want to change them).
Does it makes sense to you? Please suggest me.
Thanks a lot for helping me.
>
--
SvenC
Jul 19 '07 #3
Hi,
Currently the COM interfaces and their implementations are in separate
dlls.
That was a very good decision which should pay back now.
Would it be possible, to implement those interfaces in C# by importing
the types in the tlb file, so that we can keep the interfaces separate?
(current
clients depends on these interfaces and we don't want to change them).
Does it makes sense to you? Please suggest me.
Yes, that should be possible. Just leave all interface definitions in a
separate dll, where you control the COM interfaces in an IDL file.
That should give you enough control not to break anything for older clients.

--
SvenC

Jul 19 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: brazilnut52 | last post by:
I am going to outline the steps I go through to produce the problem. Hopefully this will help you understand the problem better I have created a simple COM DLL in .NET by using the COM class...
2
by: Mark Broadbent | last post by:
Please guys save me from throwing my laptop throught the window grrr. No one answered my original post so here is a reworded version. I am working through some study material but have hit a brick...
4
by: JoeZ | last post by:
Hi, Can some one point some samples of calling managed code from unmanaged code. Here is basically what I need: I have an MFC application with several MFC dlls, and I have a new .net...
2
by: Edward Diener | last post by:
How does one specify in a component that a property is a pointer to another component ? How is this different from a property that is actually an embedded component ? Finally how is one notified in...
2
by: Phil Atkin | last post by:
Hi, I'm currently wrapping my "legacy" COM component with a managed layer, to create a dual-mode component. The structure is very like the JrnlPost sample and the "Exploring COM...
3
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has...
4
by: tsutton | last post by:
I developed my application on my PC using a referenced Control component (which was analysed by Aximp.exe and give me a dll). It runs fine on my PC but when I place it on the network and run it...
3
by: Bernie Yaeger | last post by:
I am having trouble using a component - I believe a managed component, but that's part of the problem. I have to source, as it is freely available on the internet. I have communicated with the...
0
by: shama | last post by:
Hi, When we create shared add-in in visual studio .net 2005 with VC++/ATL as a language, then it creates managed com component or unmanaged com component? In MSDN they had said that "creating...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.