Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

import class from dll.

Status
Not open for further replies.

zyBitX

Programmer
Sep 16, 2001
7
SE
I have created a dll like this:

In my DLL
Code:
//MyClassA.h
class MyClassA
{
}
Code:
//myClassB.h
class MyClassB
{
}
Code:
//myClassC.h
#include "myClassA.h"
#include "myClassB.h"

class __declspec(dllexport) MyClassC
{	
	MyClassA *aObj;
	MyClassB bObj;
}

In my Project that imports the Dll:

Code:
//myImports.h
class __declspec(dllimport) MyClassC
{	
	MyClassA *aObj;
	MyClassB bObj;
}
I have copied the .dll and .lib to my projectfolder and I have added the .lib
to the project linkings.

So!
Why do I get this?

myImports.h : error C2501 : 'MyClassA' : missing storage-class or type specifiers

What should I do to give myClassC access to the "hidden" classes?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top