delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/10/22/20:30:34

From: mcherk AT geog DOT ubc DOT ca (Michael Cherkassoff)
Subject: Error loading DLL. Please help.
22 Oct 1997 20:30:34 -0700 :
Message-ID: <199710230122.SAA21345.cygnus.gnu-win32@whimbrel.geog.ubc.ca>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hi,

I am trying to load .DLL with the following program:
----------- main.c ----------------
#include <windows.h>

int main()
{
    HINSTANCE hDLL;
      
    hDLL = LoadLibrary("libfoo.dll");
    if (hDLL == NULL)
      {
      unsigned int errorCode;
      printf("Error");
      errorCode = GetLastError();
      printf (" code is %d\n",errorCode);
      }
    else printf ("Success\n");
}
--------------------------------------------------

I get the message:

Error code is 0

if libfoo.dll is relocatable and

Error code is 11

if libfoo.dll is non-relocatable.

I create my libfoo.dll using Fergus' Henderson Makefile.DLLs
and it works perfectly for both relocatable and non-relocatable
examples of calling functions (not loading libraries).

Any ideas why loading libraries doesn't work and how to
make it work?

(I care mostly about the relocatable libraries)

I am using b18 with the most recent Coolview.

Thanks,
Michael.
------------------------------------------------------------
Michael Cherkassoff  (mcherk AT geog DOT ubc DOT ca)
Department of Geography,                 Tel: (604) 822-2663
University of British Columbia, B.C.     Fax: (604) 822-6150
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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