Board index » delphi » using DLL in DOS application (BC 4.52)

using DLL in DOS application (BC 4.52)

Hi:

I am trying to call a third-party DLL for a DOS application.
I created the import library (abc.lib) using implib and add
it to the node. When I tried to build, I got the undefined symbol
error messge for all the functions from that DLL.

In the program I prototype the functions as

extern "C"  int __cdecl GetActualVelocity(short int axis);

When I created the project I selected the DOS platform,
LARGE memory model, with .cpp initial node.

Any help or suggestions are greatly appreciated.

PS: I also read from the newsgroup that DLL works in DOS
only under the protected mode. Is that true?

 

Re:using DLL in DOS application (BC 4.52)


Quote
"Suttipan Limanond" <liman...@ksc.th.com> wrote in message

news:3b09c7c5$1_1@dnews...

Quote

> Hi:

> I am trying to call a third-party DLL for a DOS application.
> I created the import library (abc.lib) using implib and add
> it to the node. When I tried to build, I got the undefined symbol
> error messge for all the functions from that DLL.

> In the program I prototype the functions as

> extern "C"  int __cdecl GetActualVelocity(short int axis);

> When I created the project I selected the DOS platform,
> LARGE memory model, with .cpp initial node.

> Any help or suggestions are greatly appreciated.

> PS: I also read from the newsgroup that DLL works in DOS
> only under the protected mode. Is that true?

DLLs are not supported under plain DOS because the program loader built in
to DOS doesn't recognise the newer .EXE formats used in Windows 3.x or
Windows 9x/NT/2000.

DOS extenders must provide their own program loaders which switch the
computer into protected mode, run the program then switch the computer back
to real mode. These extenders may or may not support loading DLLs.

It is possible to write a program loader for DOS that will allow you to load
DLLs (see IBM/Microsoft's "family mode" for OS/2 1.x), but it will usually
not be worth the effort. If you need the extra memory - use a DOS extender
or write Win32 Console programs.

Daniel Pfeffer

Re:using DLL in DOS application (BC 4.52)


First:
Is the DLL a 16bit or 32 bit DLL ??

If its a 16bit dll, you need a dos extender for 16bit dpmi. Or write a
windows 16bit app, thats calling the dll.
If its a 32 bit dll, you need to write a win32 console program,or use a
32bit dos extender, dpmi32.

With the borland power pack dos extenders, it was able to call dll's in both
modes, but if the dll uses functions not supported in dpmi, like specific
windows gdi functions, a dos exe is not executable.

You will get the error message "couldnt load gdi.exe", or something like
that.
Please give info about the dll, what the app shall do, and which compiler
you are using.

If its a 16bit dll, you can make an EasyWin 16 bit windows app, that has the
same functionality as a plain dos app, except that the graphics is a kind of
simplified windows.

// Svenne

"Suttipan Limanond" <liman...@ksc.th.com> skrev i meddelandet
news:3b09c7c5$1_1@dnews...

Quote

> Hi:

> I am trying to call a third-party DLL for a DOS application.

Other Threads