473,394 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

DLL in C++Builder6

Hi all.

I'm trying to export a class and its instance in a dll in c++builder.
My class definition in the dll project is like this:

class __declspec(dllexport) TableTest
{
// class definitions with only public functions and data fields.
};

__declspec(dllexport) TableTest Test;

-----------

In my other project in wich i use the created .dll and .lib, i have:

class __declspec(dllimport) TableTest;
__declspec(dllimport) TableTest Test;

But when i try to access any of functions or data fields from Test
(like: Test.Name) i get the following compile error:

E2315: 'Name' is not a member of 'TableTest', because the type is not
defined yet.

Thanks for any help.

Henrique.
Jul 22 '05 #1
1 1367
"Henrique O. Santos" <he*******@yahoo.com> wrote...
I'm trying to export a class and its instance in a dll in c++builder.
My class definition in the dll project is like this:

class __declspec(dllexport) TableTest
{
// class definitions with only public functions and data fields.
};

__declspec(dllexport) TableTest Test;

-----------

In my other project in wich i use the created .dll and .lib, i have:

class __declspec(dllimport) TableTest;
__declspec(dllimport) TableTest Test;

But when i try to access any of functions or data fields from Test
(like: Test.Name) i get the following compile error:

E2315: 'Name' is not a member of 'TableTest', because the type is not
defined yet.


Let's put aside all the off-topic nonsense like __declspec and such.
One rule remains in effect: in order to call a member function, the
compiler has to know that it exists, what its arguments are and what
its return value type is. You give this information to the compiler
in the form of the class definition. Your "other project" apparently
doesn't have the benefit of the class definition. How do you suppose
the compiler should be able to deal with that?

V
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Leor Zolman | last post by:
The Intel C++ version of STLFilt (my STL Error Message Decryptor utility) has now been updated to support Intel C++ 8 (currently in Beta) along with version 7. All three MSVC libraries are...
1
by: Lars Ronnow | last post by:
Is it possible to create a window control using .NET (vb/c#) and use it in a borland c++builder 6 application? I've tried with some experiments and searched for information without any luck. ...
3
by: Miguel Angel Polo | last post by:
Hi Maybe this question is off-topic, but anyway I've seen some questions about Builder and Visual, so here it is: How can I use an OpenGL component?? Where can I find it??
1
by: Thad | last post by:
In C++B6 you can use panels on your form. They are all straight edge and rectangular with very limited color choices. I am trying to find a component that has rounded off corners and has a...
1
by: Thad | last post by:
I am using C++ Builder 6. I am trying to use a PNG file (installed a component that gives the png option) on a form. It displays fine. The problem is, when i try and stretch the image (stretch...
1
by: wiza | last post by:
there is only directions for vc7 and g++, but i want to use cgal in borland c++ builder6, who knows how to do , thanks.
14
by: deanbrown3d | last post by:
Hi there! Suppose I have a function void ShowMessage(string s); (that has a void return type.) In my other function F, also with a void return type, can I do this?
1
by: harp | last post by:
I created a stored procedure in oracle with the help of sql +plus: Set serveroutput on create or replace procedure spComp(company IN CHAR,oFname OUT CHAR, oFamname OUT CHAR, oAdr OUT CHAR,...
47
by: =?Utf-8?B?ZW1hdmlzdQ==?= | last post by:
Dear guys, I'm in trouble having to port my project from C++Builder6 to VisualC++. Has anyone of you idea if there are any tools to help my doing this job? My current project is widely using VCL...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.