First off this is what I have installed in regards to .NET, DirectX and Programming Software - all in their own directories.
- DirectX - October 2005 Edition
- DirectX - December 2005 Edition
- DirectX - February 2006 Edition
- Visual Studio 2005 Express (C#, C++ etc) - Net SDK 2.0, DX Feb2006
- Visual Studio 2003 C++ - Net SDK 1.1, DX Oct/Dec and Feb (separately)
- Visual Studio 6 C++ (Not used since 2003 installed last year)
- Net SDK 1.1
- Net SDK 2.0
Both before and after installing Feb 2006 DirectX I have found I could not compile a simple program in 2003 C++, just creating a device without receiving 3 or so error messages with the 2 codes in the subject heading. I have the 1.1 Net SDK setup for includes and libraries as well as using each of the directX assemblies individually. Normal C++ .NET programs compile but the moment I add the dev = new Device( ... ) line it fails to compile. Without that line it compiles fine. I have tried the Microsoft::DirectX::PrivateImplementationDetails workaround suggested but this just causes all sorts of other problems regardless of where I put it.
[code]
- Device * m_device;
- PresentParameters * m_pp;
[/code]
However, putting the identical code (well almost identical) in 2005 C++ with the .NET 2.0 or .NET 1.1 and any of the DirectX assemblies individually it compiles fine. Whether this is because I have 2.0 installed I don't know.
[code]
- Device^ m_device;
[/code]
So, all I can deduce from this is that you HAVE to use the latest software/SDK installed barring the DirectX. Can anyone confirm that this is the reason why so many of us are having problems. I will be testing further by getting my brother to compile my 2003 code on his 1.1 only system and see if it works. Of course the other option is that 2003 is not fully Managed yet. In which case can we expect at least that update before support finally finishes on it.
IE.
- Visual Studio 2003 (Version 7.x) - Only to be used if you DO NOT have .NET 2.0 SDK installed even if not linked to the software.
- Visual Studio 2005 (Version 8.x) - Can be used with .NET 1.1 and 2.0 SDK

Theory: Multiple SDK/DirectX Installations and the C3635/C3377 problems
gwc
But ^ doesn't correspond to *, it needs to be __gc *
wromee
Well finally got my brother to test on his non .NET 2.0 / Studio 2005 system and he is getting the same problems so nothing related to .NET 2.0 installation. So either 2003/DirectX/Net combo or the project as a whole. Even though the project works fine in 2005 with just changes to the pointer ..
Just having the DirectX libraries linked in and the one single line of directx code:
device* m_device; (2003 Version) Won't compile
device^ m_device; (2005 Version) Will compile
That line alone will trigger the error .. is there something wrong with what I did there.
Frustrated1689
Okay here goes with the code files. The following are the only files I have in the 2 projects. It was an Empty Project with the same or similar (if identical unavailable) settings and references added. I literally copied and pasted the code from the 2005 working program to the 2003 environment and set everything up and replace __gcnew with __gc new or just new when __gc new didn't want to work and replace ^ with *. And of course the litte problem with the PresentParameters in 2003. I am now down to a working 2005 program and a 2003 program that reports the errors as follows:
[error list start]
DirectXTestForm.cpp
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3377: 'Microsoft::DirectX::Direct3D::Device::.ctor' : cannot import method - a parameter type or the return type is inaccessible
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3377: 'Microsoft::DirectX::Direct3D::Device::get_UnmanagedComPointer' : cannot import method - a parameter type or the return type is inaccessible
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3377: 'Microsoft::DirectX::Direct3D::Device::UpdateUnmanagedPointer' : cannot import method - a parameter type or the return type is inaccessible
DXMain.cpp
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3377: 'Microsoft::DirectX::Direct3D::Device::.ctor' : cannot import method - a parameter type or the return type is inaccessible
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3377: 'Microsoft::DirectX::Direct3D::Device::get_UnmanagedComPointer' : cannot import method - a parameter type or the return type is inaccessible
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3377: 'Microsoft::DirectX::Direct3D::Device::UpdateUnmanagedPointer' : cannot import method - a parameter type or the return type is inaccessible
main.cpp
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3377: 'Microsoft::DirectX::Direct3D::Device::.ctor' : cannot import method - a parameter type or the return type is inaccessible
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3377: 'Microsoft::DirectX::Direct3D::Device::get_UnmanagedComPointer' : cannot import method - a parameter type or the return type is inaccessible
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) : error C3377: 'Microsoft::DirectX::Direct3D::Device::UpdateUnmanagedPointer' : cannot import method - a parameter type or the return type is inaccessible
[/error list end]First off is the main.cpp file.
[code from 2003]
[/code]
[code from 2005]
[/code]
Now the DirectXTestForm.h files
[code from 2003]
[/code]
[code from 2005]
[/code]
Now DirectXTestForm.cpp
[code from 2003]
[/code]
[code from 2005]
[/code]
2 More to go .. this time DXMain.h
[code from 2003]
[/code]
[code from 2005]
And finally DXMain.cpp
[code from 2003]
[/code]
[code from 2005]
[/code]
As you can see the code are almost identical. So if anyone can shed any light on why I get those errors I would be glad to test them out on those 2 projects.
Now reference wise the two projects both have the following:
However, I also had to add mscorlib 1.0 into the 2003 for it to understand the __gc command. Now the 1.0 .NET library is from 1.1.4322 installation and the 2.0 version is from 2.0.50727.
Hopefully this is enough for anyone that might want to check it out. Bear in mind that this wasn't a request for help just a possible theory as to the cause that perhaps others with the same problem could confirm or deny based on their setups.
Achelon
Sorry should have pointed out which lines the errors actually refer to . In the programmed code there are blank lines I put in to separate blocks of code which this forum spaces together when I paste it in and make it readable.
Line 32 actually points to the end of the class meaning something in the class as a whole is the problem usually as far as I know. And that class holds all my DirectX code.
Went through and remvoed all Include directories in 2003 until I only had DirectX Feb 2006 and .NET SDK 1.1 directories listed. Similarly for the Library list. Still the same error when built.
Hmm interesting .. I removed all the DirectX specific elements to the code and rebuilt and got one error.
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'
Obviously because I removed an important directory from the includes and libraries path listings that including directx doesn't notice due to their error being more important.
Added path for PlatformSDK include and library which I took out before and the following error appears:
LINK : fatal error LNK1104: cannot open file 'LIBCMTD.lib'
Aha finally .. added path to v7 include and libraries and it now compiles fine .. now added the dxmain.h and dxmain.cpp into the application and the references and built it .. the errors are back ..
Like I said .. its just a curious theory so I'm not going to waste time trying to figure out why the basic code I have just won't compile when 2005 is working just fine .. until I have tested it on another computer that doesn't have the 2.0 libraries installed and retrieved the same problem I will just assume its the version thats at fault.
Thanks for your assistance on this .. I know I've been pulling my hair out regarding it the last 6 months :D
... Got Home from work and created another project in 2003 and copied the code out of the old multi file class project into a single file ... here it is ..
[code]
[/code]
I remmed and re-remmed and unremmed out code to see which code added will cause the error ..
This project setup causes the following messages (Line 83 is the closing brace for the class, just before the namespace close brace) :
AllInOne.cpp
AllInOne.cpp(83) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
AllInOne.cpp(83) : error C3377: 'Microsoft::DirectX::Direct3D::Device::.ctor' : cannot import method - a parameter type or the return type is inaccessible
AllInOne.cpp(83) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
AllInOne.cpp(83) : error C3377: 'Microsoft::DirectX::Direct3D::Device::get_UnmanagedComPointer' : cannot import method - a parameter type or the return type is inaccessible
AllInOne.cpp(83) : error C3635: 'Microsoft.DirectX.PrivateImplementationDetails::IDirect3DDevice9': undefined native type used in 'Microsoft::DirectX::Direct3D::Device'; imported native types must be defined in the importing source code
did you forget to include a header file
AllInOne.cpp(83) : error C3377: 'Microsoft::DirectX::Direct3D::Device::UpdateUnmanagedPointer' : cannot import method - a parameter type or the return type is inaccessible
As you can see from this code the only directx specific code is the two variable setups .. If I rem out those 2 lines it compiles with no problems .. I have tried this using the October and February files set up in the directory list (only one at a time though of course).
Naokazu Tsukada
> d:\My Documents\Visual Studio .NET Projects\DirectX C++ .NET 2003 Step By Step\CreateDevice_2003\DXMain.h(33) :
You will notice that it references line 33 of file DXMain.h. The file DXMain.h you posted above only has 26 lines. Thus, it seems as if you're picking up some file other than what you think you're picking up.
Check the include path options for both your project (C++ options) and for visual studio (Options -> project settings -> Visual studio directories -> Included files)
; you'll probably see some paths that shouldn't be there.
David_W
In fact, if you can create a 20-line file that generates the error, then please post the contents of that file, as well as a copy-and-paste of the error messages you are getting. Then someone might have a chance of figuring out what you're doing wrong (which possibly might have something to do with references, paths for finding them, or something totally different).
helpmeimstupid
I wasn't asking for help as such, I have pretty much given up on 2003 as a .NET programming environment. I was just wondering if everyone else having the problem had a similar multiple install of software.
Also, the project isn't just a 20 line file. Its just that those 20 lines of code are the only difference between the code I added and not generated by the Project Creator for Windows Forms in 2003 and 2005. I'm in the process of making a minimalised project to use as little code as possible and will post them up here once I have done both versions of code.
The directory and reference settings are identical as they are in the same place barring the 1.1 and 2.0 .Net SDK which I have confirmed are included properly. Normal 2003 .NET programs compile (went through the first 20 projects of a .NET 2003 tutorial book over the last 2 weeks with no problems at all. The only problem occurred after the introduction of DirectX which is the same version used in 2005 with no problems. So, with that in mind I can only assume there are differences in code somewhere and with a Windows Forms System Generated app that would be harder to find hence the attempt at narrowing it down to my code and not Microsofts generated code.
rileyjim
Well, looks like I got it working now .. this is the AllInOne code as it is and it compiles. Hopefully this will help others with similar problems. I think my problem was that I was placing the unmanaged includes (the workaround listed on various sites) in the wrong place.
[code]
- namespace
Microsoft[/code]
In my class based project I had to put that namespace set up at the top of DXMain.h before it would compile.
edit:
Just tried this in a normal auto generated Windows Form Application and for the life of me I cannot see where those namespace lines need to go. Fortunately you can add Windows Forms as needed from within a blank project which will still compile as needed. Oh well at least 2003 can now be used with Managed DirectX :D