Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > C# program can't find namespace of classes in C++ dll
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 8th April 17:34
beck johnson via .net 247
External User
 
Posts: 1
Default C# program can't find namespace of classes in C++ dll


I'm using unmanaged C++ libraries that I have created managed wrapper classes for. I would like to use these wrapped classes in a C# program, but I have run into a problem.

Although I have both put a "using" statement at the top of the program AND included the dll as a reference, I get the following error message when trying to use those classes: "The type or namespace name "NameOfClass" could not be found (are you missing a using directive or an assembly reference?)

Code as follows:

-----------------------------------------------
The managed wrapper for one of the unmanaged C++
classes, which are contained in dicomlib.lib.
This class is compiled into a .dll file called
"managedDicomlib.dll" ----------------------------------------------- #using "dicomlib.lib"
#using <mscorlib.dll>

using namespace System;

//namespace managedDicomlib {

public __gc class AAssociateRQ {
private:
dicom:rimitive::AAssociateRQ* pAAssociateRQ;
public:
AAssociateRQ() { pAAssociateRQ = new dicom:rimitive::AAssociateRQ(); }
AAssociateRQ( string& CallingAp, string& CalledAp ) {
pAAssociateRQ = new dicom:rimitive::AAssociateRQ( CallingAP, CalledAp );
}

~AAssociateRQ() { delete pAAssociateRQ; }
};
//}


-----------------------------------------------
The C# class which uses the wrapped C++ class
-----------------------------------------------

using System;
using managedDicomlib;


namespace usingManagedDicomlib {

public class Driver {

void Main( string[] args ) {
AAssociateRQ aarq = new AAssociateRQ();

}
}
}


Could someone tell me if something in my .dll is changing what I think is the namespace? Or if my problem is something else? Thank you in advance.

--------------------------------
From: Beck Johnson

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>/vi1/698PUqz/0uQ9ad72A==</Id>
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666