About Dlls in Borland C++builder 6 Ent

  • Thread starter =?ISO-8859-1?Q?Ren=E9_Kjellerup?=
  • Start date
?

=?ISO-8859-1?Q?Ren=E9_Kjellerup?=

Hi' all

I've come across a strange thing
using 'Borland C++Builder 6 Ent'
and are now looking for how this
all fit together.

Here is the files that where created
without the .bpf, .bpr, and .res file:

(this is a DLL project)

// --- Unit1.cpp:

#include <vcl.h>
#include <windows.h>
#pragma hdrstop

// lots of comments generated by DLL Wizard

#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*
lpReserved)
{
return 1;
}

// --- Unit1.cpp EOF

// --- Unit2.cpp:

#pragma hdrstop

#include "Unit2.h"

// if I don't include this non existent file:
#include "Unit1.h"
// this doesn't work, Why?

#pragma package(smart_init)

void Say(char *What)
{
ShowMessage("From within the DLL\n" + (String)What );
}

// --- Unit2.cpp EOF

// --- Unit2.h:

#ifndef Unit2H
#define Unit2H

#endif

extern "C" void __declspec(dllexport) Say(char *What);

// --- Unit2.h EOF





I have noticed that I need to include the file Unit1.h
in the unit I add to hold my DLL functions even though
it's never created in the project folder.

This piece of code is taken from a tutorial on DLL files
and I came to wonder why my project wouldn't compile,
and I thought to my self: off cause you'll need the header
for your main unit of the DLL file project, and used to the
filenaming in Borland I just wrote '#include "Unit1.h"'
right next to the other include statement and compiled.
Everything worked, yes.

However as I got a little further I noticed that there were
no Unit1.h any where in the project to be found.

I came across this as wanted to do the same thing a second DLL
that are in the project group, lets just call the files:
Unit3.cpp, Unit4.cpp, and Unit4.h, and I wished to include
Unit3.h and then I received the error:

E2209 Unable to open include file 'Unit3.h'

but if I changed it to the (now to me known) non-existent
file: Unit1.h. Everything compiled just fine.

Now I'm asking how can this be?

Yours R.Kj.
--As life grows older, I gain experience.
 
J

Jonathan Turkanis

René Kjellerup said:
Hi' all

I've come across a strange thing
using 'Borland C++Builder 6 Ent'
and are now looking for how this
all fit together.

Here is the files that where created
without the .bpf, .bpr, and .res file:

(this is a DLL project)

As you have phrased it, your question is specific to a particular OS,
and to a particular development environment, and therefore not
appropriate for this group.

If you can replicate your problem with a simple project not involving
DLLs, you may get a good answer here. Try to find the simplest example
that reproduces the error.

Jonathan
 
D

Duane Hebert

René Kjellerup said:
Hi' all

I've come across a strange thing
using 'Borland C++Builder 6 Ent'
and are now looking for how this
all fit together.

newsgroups.borland.com
 
Joined
Mar 22, 2011
Messages
1
Reaction score
0
c++ builder programming

you can view the examples given in site www.ibsoftindia.org

www.ibsoftindia.org
Hi' all

I've come across a strange thing
using 'Borland C++Builder 6 Ent'
and are now looking for how this
all fit together.

Here is the files that where created
without the .bpf, .bpr, and .res file:

(this is a DLL project)

// --- Unit1.cpp:

#include <vcl.h>
#include <windows.h>
#pragma hdrstop

// lots of comments generated by DLL Wizard

#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*
lpReserved)
{
return 1;
}

// --- Unit1.cpp EOF

// --- Unit2.cpp:

#pragma hdrstop

#include "Unit2.h"

// if I don't include this non existent file:
#include "Unit1.h"
// this doesn't work, Why?

#pragma package(smart_init)

void Say(char *What)
{
ShowMessage("From within the DLL\n" + (String)What );
}

// --- Unit2.cpp EOF

// --- Unit2.h:

#ifndef Unit2H
#define Unit2H

#endif

extern "C" void __declspec(dllexport) Say(char *What);

// --- Unit2.h EOF





I have noticed that I need to include the file Unit1.h
in the unit I add to hold my DLL functions even though
it's never created in the project folder.

This piece of code is taken from a tutorial on DLL files
and I came to wonder why my project wouldn't compile,
and I thought to my self: off cause you'll need the header
for your main unit of the DLL file project, and used to the
filenaming in Borland I just wrote '#include "Unit1.h"'
right next to the other include statement and compiled.
Everything worked, yes.

However as I got a little further I noticed that there were
no Unit1.h any where in the project to be found.

I came across this as wanted to do the same thing a second DLL
that are in the project group, lets just call the files:
Unit3.cpp, Unit4.cpp, and Unit4.h, and I wished to include
Unit3.h and then I received the error:

E2209 Unable to open include file 'Unit3.h'

but if I changed it to the (now to me known) non-existent
file: Unit1.h. Everything compiled just fine.

Now I'm asking how can this be?

Yours R.Kj.
--As life grows older, I gain experience.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top