Subject: RE: DLL's for use with other languages...
From: [email-masked] (David Essex)

16 Jun 1997 14:15:12 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
X-Sender: [email-masked] (Unverified)
X-Mailer: Windows Eudora Light Version 3.0.1 (32)
Original-To: gnu-win32 <[email-masked]>
Original-Cc: "Toni Harbaugh-Blackford" <[email-masked]>,
        "J Russell Smyth" <[email-masked]>
In-Reply-To: <[email-masked]>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=====================_866488219==_"
Original-Sender: [email-masked]

--=====================_866488219==_
Content-Type: text/plain; charset="us-ascii"

J Russell Smyth wrote:
> ....
>What I want to know is can GNU-WIN32 or cygwin32 create DLLs that can be
used 
>by Visual Basic?

Toni Harbaugh-Blackford you wrote:
> .....
>I too want to use cygwin32 DLLs with Visual Basic, and end up
>with the same error.  I have tried using both relocatable and non-relocatable
>It would really be great if someone who had solved the problem of using
cygwin32
>DLLs with OTHER programs (especially Visual Basic) would provide an example.

I have a working example of a DLL which is compiled under gnu-win32 gcc and
works when it is called from Delphi2 and from another gnu-win32 C program.
It is auto loaded at run time, and is compiled using b18 under Win95. See
enclosed attached source code.

The strange thing about this working example is that it requires 2
different type of declarations. For example the following code will work;

/* gnu-win32 C program declaration */
extern int foo1(...); 
extern char* foo2(...);

/*  DLL C program function */
int foo1(...) { ... }
char* foo2(...) { ... }
int WINAPI dllEntry(HANDLE hDll, DWORD reason, LPVOID reserved)
{   return 1; }

/* Delphi2 Pascal program declaration */
function foo1(t: integer): Integer; stdcall;
function foo2(t: integer): Pchar; stdcall;

However similar code(i.e.: STDCALL IWNAPI) in the C as in the Delphi
calling program will compile but will not load.

/* gnu-win32 C program declaration */
extern int WINAPI foo1(...); 
or
extern char* STDCALL foo2(...);

Any way it works. Hope this helps,

David

--=====================_866488219==_
Content-Type: application/octet-stream; name="sample.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="sample.tgz"

--=====================_866488219==_
Content-Type: text/plain; charset="us-ascii"

--=====================_866488219==_--

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".