home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!pipex!bnr.co.uk!bnrgate!nott!torn!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!kth.se!nada.kth.se!da1-lst
- From: da1-lst@nada.kth.se (Lars-Erik Stenholm)
- Subject: SUPERBASE/BC++/DLL
- Message-ID: <1993Jan28.152137.8561@kth.se>
- Originator: da1-lst@hemul.nada.kth.se
- Sender: usenet@kth.se (Usenet)
- Nntp-Posting-Host: hemul.nada.kth.se
- Reply-To: da1-lst@nada.kth.se (Lars-Erik Stenholm)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Date: Thu, 28 Jan 1993 15:21:37 GMT
- Lines: 88
-
- Posted for a friend of mine...
- __________________________________________________________________
-
- To users of Superbase 4 and Borland C++:
-
- I'm having problems trying to call a DLL (wich I write with Borland C++),
- from a Superbase 4 DML program. My test example is very easy. My DLL just
- returns a string. The following is the code of the C++ program that creates
-
- the DLL:
-
- #include <stdlib.h>
- #include <owl.h>
- #include "windows.h"
-
- PTModule DLLHelloLib;
-
- extern "C"
- {
- char * far mystring();
- };
-
- char * far _export mystring() {
- return "Hello Superbase I'm coming from a DLL!!!";
- };
-
-
-
- int FAR PASCAL LibMain(HINSTANCE hInstance, WORD, WORD, LPSTR lpCmdLine)
- {
- int TheStatus;
-
- DLLHelloLib = new TModule("DLLHello", hInstance, lpCmdLine);
- TheStatus = DLLHelloLib->Status;
- if ( TheStatus != 0 )
- {
- delete DLLHelloLib;
- DLLHelloLib = NULL;
- }
- return (TheStatus == 0);
- }
-
- int FAR PASCAL WEP ( int)
- {
- return 1;
- }
-
-
-
- My compilation opptions are:
- Applications options: Windows DLL
- Model: Large
- Defines: _CLASSDLL; STRICT; WIN31
- Entry/Exit code: Window DLL explicit functions exported
-
- My .DEF file for compiling the DLL is:
-
- LIBRARY DLLHELLO
- DESCRIPTION 'DLL Hello'
- EXETYPE WINDOWS
- CODE PRELOAD MOVEABLE DISCARDABLE
- DATA PRELOAD MOVEABLE SINGLE
- HEAPSIZE 1024
- EXPORTS mystring
-
- If I call the function mystring from another C program that I have
- linked with the DLL import library, it works, I get then string from
- DLL. But I don't get it I call the function from my superbase program
- wich looks like this:
-
- REGISTER CLEAR
- REGISTER "hellodll.dll","mystring","C"
- a$ = CALL("mystring")
- ?a$
- REGISTER CLEAR
-
- The message that I get is:
- mystring can't find function
-
-
- If someone have some idea what is missing or what I'm doing wrong I would be
- very glad to know it. Thank you very much for all kind of help!!!!
-
- Plese respond with e-mail to jorge@cor.sos.sll.se
-
- Thanks in advance!
-
- Jorge Cantini
-