473,748 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\Mi crosoft SDK\include\Obj Base.h
398
Error 11 error C2146: syntax error : missing ';' before
identifier 'IRpcStubBuffer ' I:\Programme\Mi crosoft SDK\include\Obj Base.h
398
Error 19 error C2146: syntax error : missing ';' before
identifier 'IClassFactory' I:\Programme\Mi crosoft SDK\include\Unk nwn.h
60
Error 17 error C2146: syntax error : missing ';' before
identifier 'AsyncIUnknown' I:\Programme\Mi crosoft SDK\include\Unk nwn.h
54
Error 15 error C2146: syntax error : missing ';' before
identifier 'IUnknown' I:\Programme\Mi crosoft SDK\include\Unk nwn.h 48
Error 116 error C2146: syntax error : missing ';' before
identifier 'IMarshal2' I:\Programme\Mi crosoft SDK\include\Obj Idl.h
54
Error 114 error C2146: syntax error : missing ';' before
identifier 'IMarshal' I:\Programme\Mi crosoft SDK\include\Obj Idl.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 1969
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.nos pam>
schrieb im Newsbeitrag news:ue******** ******@TK2MSFTN GP11.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
1616
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
1663
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++. And to those few "wise" "educated" "elite" c++ programmer lifers out there who get their thrills on Saturday nights ripping apart some nOOb vc++ programmer for posting to the wrong group, go out and get a date or something. At least they are...
12
5340
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 VC++.net the same as 7.0 or 7.1 or something else? Anyone got a clue, I lost it when they started with the .net notation :-( Regards, Ron AF Greve.
12
1775
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
3334
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: overwrite of charcter in constatnt string like char *str="Hi all"; str='A'; the result of this str points to the string "Hi All"
11
1917
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
3613
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 codes will be automatically modified to add corresponding objects. However, in VC++, in order to design any forms/dialogs, resources must to be created first, then we need manually
2
1308
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 view that dialog and how can i compile that program.vc.net using namespace syntax, but while compile in vc++6.0, it shows error.please tell me a good solution for this project.i am really needed these helpo from microsoft technologies.thanking....
4
1362
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? I want to know this because there is client/server application that i want to build. Now the server side has to be very fast in processing request and efficient in all other server related issues. I searched on internet(including the google...
1
2591
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 MFC6.0 statically and after I imported it to vc++ 8.0 I set the linkage of MFC8.0 to "shared". However when I try to compile and link the project in vc++ 8.0 in release mode (debugmode works fine) I get an acess violation in afxcomctl32.inl. This...
0
8996
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9333
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.