473,399 Members | 3,401 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,399 software developers and data experts.

VC++ COM-library compilation under .NET as managed code

I have a quite severe problem. I am trying to compile a C++ library
initially written for VC++ 6. To make the library available for .NET
languages I want to compile the library as managed C++ library. As the
library is utilizing DirectX 9 it bases on COM. This causes me quite some
troubles as I get compile errors caused by the include files included
through the DirectX 9 header file.
The errors occur in unknwn.h, objbase.h and ObjIdl.h.

For example:
Error 12 error C2079: 'IRpcStubBuffer' uses undefined
struct 'IRpcStubBuffer' I:\Programme\Microsoft SDK\include\ObjBase.h
398
Error 11 error C2146: syntax error : missing ';' before
identifier 'IRpcStubBuffer' I:\Programme\Microsoft SDK\include\ObjBase.h
398
Error 19 error C2146: syntax error : missing ';' before
identifier 'IClassFactory' I:\Programme\Microsoft SDK\include\Unknwn.h
60
Error 17 error C2146: syntax error : missing ';' before
identifier 'AsyncIUnknown' I:\Programme\Microsoft SDK\include\Unknwn.h
54
Error 15 error C2146: syntax error : missing ';' before
identifier 'IUnknown' I:\Programme\Microsoft SDK\include\Unknwn.h 48
Error 116 error C2146: syntax error : missing ';' before
identifier 'IMarshal2' I:\Programme\Microsoft SDK\include\ObjIdl.h
54
Error 114 error C2146: syntax error : missing ';' before
identifier 'IMarshal' I:\Programme\Microsoft SDK\include\ObjIdl.h 48
Overall the compiler throws about 200 error messages. I am compiling against
the include files contained in the VS.2005 Beta.
Strangely enough I once got it compiled under VS.NET 2002, but then I
missed generics which were not available then, which I hope work with VS2005
now. If someone could point me out a direction where to investigate for or
have an idea about how to solve this problem, that would be great.
Any help would be greatly appreciated.

Michael
Nov 17 '05 #1
2 1944
Michael Braitmaier wrote:
I have a quite severe problem. I am trying to compile a C++ library
initially written for VC++ 6. To make the library available for .NET
languages I want to compile the library as managed C++ library. As the
library is utilizing DirectX 9 it bases on COM. This causes me quite
some troubles as I get compile errors caused by the include files
included through the DirectX 9 header file.
The errors occur in unknwn.h, objbase.h and ObjIdl.h.


The first thing to check is the order of the include directories. Make sure
that the DX9 directory appears first, followed by a current PSDK, followed
by the VC++ directories. Usually that's all it takes when errors are
showing up in COM platform headers.

-cd
Nov 17 '05 #2
I did as you said. Ordered the include directories according to your answer,
but still I have the same problems.
Possibly I might miss some compiler option to set? Initially I just took the
C++ library created a .NET project, compiled it in standard C++ first which
worked and then activated the /CLR switch to enable managed C++.
I deactivated library internally used code parts by using "#pragma
unmanaged".
Do I have to activate something else considering COM compatibility under
managed C++?

Thanks so far.
Michael
"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
schrieb im Newsbeitrag news:ue**************@TK2MSFTNGP11.phx.gbl...
Michael Braitmaier wrote:
I have a quite severe problem. I am trying to compile a C++ library
initially written for VC++ 6. To make the library available for .NET
languages I want to compile the library as managed C++ library. As the
library is utilizing DirectX 9 it bases on COM. This causes me quite
some troubles as I get compile errors caused by the include files
included through the DirectX 9 header file.
The errors occur in unknwn.h, objbase.h and ObjIdl.h.


The first thing to check is the order of the include directories. Make
sure that the DX9 directory appears first, followed by a current PSDK,
followed by the VC++ directories. Usually that's all it takes when errors
are showing up in COM platform headers.

-cd

Nov 17 '05 #3

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

Similar topics

2
by: Nevyn | last post by:
Hi, i am developing a xplatform open source project using qt, and it did not compile out of the box on windows (VC 6.0 no SP) cos of some C++ 'errors' e.g. file.h class foo { ..
4
by: WL Gardner | last post by:
I've seen scores upon scores of vc++ messages posted to the c++ group. I just want to say how IRRITATED I am that whoever is in charge of developing Google groups doesn't create a group for VC++. ...
12
by: Moonlit | last post by:
Hi, Does anyone know the difference between vc7.0, vc7.1 and .net. On the microsoft site and online stores I only see visual C++.net, yet on the spirit site I see references to vc7.0 and 7.1. Is...
12
by: mysteron | last post by:
i have vc 2003 installed on my dev machine and was wondering if I can install 2005 beta 2 on the same machine and have both working perfectly and not interfering with each other? TIA
15
by: Ramaraj M Bijur | last post by:
Hi All, Could anyone help me to resolve following problem in C the IDE used is Microsoft VC++, Please let me know the which option in VC++ will do the needful The problem statement:...
11
by: Tatu Portin | last post by:
Have this kind of struct: typedef struct { char **user_comments; /* ... */ } vorbis_comment; /* prototype */ char * read_vorbis_string ( FILE *sc);
1
by: Jiang Yue Brandon | last post by:
I am very confused about the different ways of VC++ and C# for doing windows form/dialog design in Visual Studio.NET. In C#, after you drag & drop the components to the form, the underlying...
2
by: kuiens frank | last post by:
Dear Guys, I was sucessfully done a conversion in vc.net7.1 project to vc6.0, but i can't able to open vc.net project dialog window in vc++6 resource view. i needed help from microsoft how can i...
4
by: batista | last post by:
Hello to all, I want to know that wat's the future of vc++.net? I mean is it going to remain there or not, and if does then wud there be big changes to it or they'll stick with the current one?...
1
by: Robert Ludewig | last post by:
I have sucessfully imported and compiled a complex MFC 6.0 project from vc++6.0 (MFC6.0) into vc++ 8.0 (MFC 8.0). It contains several subprojects (libs and dlls). In vc++ 6.0 those project linked...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.