Board index » delphi » 16 bit DLL won't work with Delphi 2.0

16 bit DLL won't work with Delphi 2.0

I have a 16bit DLL written in C which I want to use in D2.  If I declare the DLL and its functions as so:

interface
         function master_volume (left,right:WORD):word;
         function wav_volume (left,right:WORD):word;
implementation
         function master_volume;External 'VOL.DLL';
         function wav_volume;External 'VOL.DLL';

And later on in the program try to use one of the functions:

         master_volume (0,0);

On compliation:

Delphi 2.0 tells me that VOL.DLL is corrupt and then stops.
Delphi 1.0 compiles and runs OK.

(n.b. VOL.DLL uses mmsystem.dll)

Can anyone help??

Thanks, Ryan.

 

Re:16 bit DLL won't work with Delphi 2.0


Quote
Ryan Mills (Ryan.Mi...@nottingham.ac.uk) wrote:

: I have a 16bit DLL written in C which I want to use in D2.  If I declare the DLL and its functions as so:
:
: interface
:          function master_volume (left,right:WORD):word;
:          function wav_volume (left,right:WORD):word;
: implementation
:          function master_volume;External 'VOL.DLL';
:          function wav_volume;External 'VOL.DLL';
:
: And later on in the program try to use one of the functions:
:
:          master_volume (0,0);
:
: On compliation:
:
: Delphi 2.0 tells me that VOL.DLL is corrupt and then stops.
: Delphi 1.0 compiles and runs OK.
:
: (n.b. VOL.DLL uses mmsystem.dll)

You cannot call a 16-bit DLL from a Win32 (Delphi 2.0) program, without
using thunking. Compile your C sources into a Win32 DLL, and your problem
with D2 should disappear.

Best regards, The Chief
--------
Dr. A{*word*73}la A. Olowofoyeku (The African Chief)
Email: la...@keele.ac.uk
Author of: Chief's Installer Pro 4.01 for Win16 and Win32:
  Winner of PC PLUS Magazine Gold Award (April 1995 U.K. edition)
  http://ourworld.compuserve.com/homepages/African_Chief/
  ftp://ftp.demon.co,uk/pub/ibmpc/win3/apps/chief/pro/chief401.zip

Re:16 bit DLL won't work with Delphi 2.0


You can't use 16bit Dlls with 32bit exe. Look for a 32bit dll.

Heiko

Ryan Mills <Ryan.Mi...@nottingham.ac.uk> schrieb im Beitrag
<624pkc$...@paperboy.ccc.nottingham.ac.uk>...

Quote
> I have a 16bit DLL written in C which I want to use in D2.  If I declare

the DLL and its functions as so:
Quote

> interface
>          function master_volume (left,right:WORD):word;
>          function wav_volume (left,right:WORD):word;
> implementation
>          function master_volume;External 'VOL.DLL';
>          function wav_volume;External 'VOL.DLL';

> And later on in the program try to use one of the functions:

>          master_volume (0,0);

> On compliation:

> Delphi 2.0 tells me that VOL.DLL is corrupt and then stops.
> Delphi 1.0 compiles and runs OK.

> (n.b. VOL.DLL uses mmsystem.dll)

> Can anyone help??

> Thanks, Ryan.

Other Threads