delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/11/04/14:09:28

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <BC46D442BCFB6340A9BB1CED6766E36E3949D8@tons2226>
From: "Willis, Matthew" <Matthew DOT Willis AT CIBC DOT ca>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Q. on creating DLL's for use w/ excel (export names without @0, @
4 etc?) (cygwin 1.3.13-2)
Date: Mon, 4 Nov 2002 14:07:10 -0500
MIME-Version: 1.0

I've searched on google for some references to interfacing cygwin with win32
dll's. I've made a little progress but am kind of stuck creating DLL's
inside cygwin. The method I am using is the following:

/* foo.c */
#include <windows.h>
int WINAPI foobar() {  return 1234; }

gcc -mno-cygwin foo.c -c
gcc -Wl,--out-implib,libfoo.import.a -mno-cygwin -shared -o foo.dll foo.o

When I look at the DLL file with MSVC's "depends.exe" I see the symbol is
"foobar AT 0" -- and I guess the @0 refers to how many bytes the function args
take (I get @4 with a pointer to double, etc.). The only way I can make the
symbols available to excel's visual basic interface is to cheat and hexedit
foo.dll to change "foobar AT 0" to "foobarX0". Then I can put a few lines in my
excel modules like
 
Declare Function foobarX0 Lib "e:\dlltest\foo.dll" () As Integer

Function MattVersion()
    Dim i As Integer
    i = foobarX0()
    MattVersion = "MW 0.0.1.0.1." + Str(i)
End Function

Surely there is a better way. Can anyone suggest a better technique? 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019