467,154 Members | 949 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,154 developers. It's quick & easy.

Mixing C++/CLI and managed extensions for C++

Our company has a mix of users with VS2003 & VS2005. I'm am having
difficulty working out how components written with these 2 tools can
be written together. I want to be able to a) incorporate a C++/CLI DLL
written in VS2005 into a managed extensions app written with VS2003
and b) use a managed extensions DLL written with VS2003 in a C++/CLI
app written in VS2005.

How can I do this?

Immediate problems I found:

1) If I try to include the header from a C++/CLI DLL in a managed
extensions app then it doesn't recognise the new syntax 'public ref
class'.

2) If I do Activator::CreateInstanceFrom on a C++/CLI DLL from a
managed extensions app then it throws a bad format exception.

3) If I try to include the header from a managed extensions DLL in a C+
+/CLI app then if doesn't like the old syntax 'public __gc class'
unless I turn on the oldsyntax switch which presumably means doing
everything with the old syntax.

Thanks for any help you can give.
KK
Jan 8 '08 #1
  • viewed: 2058
Share:
2 Replies

<ke***********@googlemail.comwrote in message
news:60**********************************@i3g2000h sf.googlegroups.com...
Our company has a mix of users with VS2003 & VS2005. I'm am having
difficulty working out how components written with these 2 tools can
be written together. I want to be able to a) incorporate a C++/CLI DLL
written in VS2005 into a managed extensions app written with VS2003
and b) use a managed extensions DLL written with VS2003 in a C++/CLI
app written in VS2005.
(a) = not happening. The VS2003 compiler can't understand the newer
assembly format, and you can't use COM because only one version of the CLR
can be loaded.

(b) Just add the old assembly as a managed reference, no header files are
involved.
>
How can I do this?

Immediate problems I found:

1) If I try to include the header from a C++/CLI DLL in a managed
extensions app then it doesn't recognise the new syntax 'public ref
class'.

2) If I do Activator::CreateInstanceFrom on a C++/CLI DLL from a
managed extensions app then it throws a bad format exception.

3) If I try to include the header from a managed extensions DLL in a C+
+/CLI app then if doesn't like the old syntax 'public __gc class'
unless I turn on the oldsyntax switch which presumably means doing
everything with the old syntax.

Thanks for any help you can give.
KK

Jan 8 '08 #2
I can't help you with a technical solutions, but... given the history of
Managed Extensions vs C++/CLI (i.e., that Managed Extensions were recognized
as a mistake by Microsoft and that they redesigned from scratch for C++/CLI),
you might want to consider just moving the 2003 code to 2005 as soon as
possible. There are bugs in 2003 that won't even be addressed since Managed
Extensions is abandoned (and rightly so).
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
C++ to Ruby
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB or C# to C++/CLI
"ke***********@googlemail.com" wrote:
Our company has a mix of users with VS2003 & VS2005. I'm am having
difficulty working out how components written with these 2 tools can
be written together. I want to be able to a) incorporate a C++/CLI DLL
written in VS2005 into a managed extensions app written with VS2003
and b) use a managed extensions DLL written with VS2003 in a C++/CLI
app written in VS2005.

How can I do this?

Immediate problems I found:

1) If I try to include the header from a C++/CLI DLL in a managed
extensions app then it doesn't recognise the new syntax 'public ref
class'.

2) If I do Activator::CreateInstanceFrom on a C++/CLI DLL from a
managed extensions app then it throws a bad format exception.

3) If I try to include the header from a managed extensions DLL in a C+
+/CLI app then if doesn't like the old syntax 'public __gc class'
unless I turn on the oldsyntax switch which presumably means doing
everything with the old syntax.

Thanks for any help you can give.
KK
Jan 8 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Rudolf | last post: by
reply views Thread by kaalus | last post: by
22 posts views Thread by Alper AKCAYOZ | last post: by
7 posts views Thread by Ekim | last post: by
2 posts views Thread by BCC | last post: by
1 post views Thread by Steve Marsden | last post: by
2 posts views Thread by andy6 via DotNetMonster.com | last post: by
3 posts views Thread by frank | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.