Viktor Apoyan
Viktor Apoyan

Reputation: 10755

Cant use typedef of one class in dll from another project

I have written a dll in which I have namespace VT in witch class public ref class Database in witch I have typedefs:

public:
        typedef System::Collections::Generic::Dictionary <System::String^, Database^>         SubkeyDictionary;
        typedef System::Collections::Generic::Dictionary <System::String^, System::Object^>   ValueDictionary;
        typedef System::Collections::Generic::KeyValuePair <System::String^, Database^>       SubkeyKeyValuePair;
        typedef System::Collections::Generic::KeyValuePair <System::String^, System::Object^> ValueKeyValuePair;

When I add my dll to another project and write VT:: I cant see my typedefs, why ???

Upvotes: 0

Views: 433

Answers (2)

Chris Taylor
Chris Taylor

Reputation: 53709

A typeset is more like an alias than a actual type and I will check shortly, but I suspect that this is not exposed as a .NET type that can be used from other assemblies.

However, all is not lost. Rather than using a typeset you could do the following

public:
  ref class SubkeyDictionary : public System::Collections::Generic::Dictionary <System::String^, Database^> {};
....

This will declare an actual type that you can then reference.

Upvotes: 1

Konrad Rudolph
Konrad Rudolph

Reputation: 545963

The typedefs are inside the class, not the namespace. Writing

VT::Database::

should do the trick.

Upvotes: 0

Related Questions