?
=?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.
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.