🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.ms-windows.programmer.misc
1 messages
1 total messages Started by Lars-Erik Stenholm Thu, 28 Jan 1993 15:21
SUPERBASE/BC++/DLL
#2429
Author: Lars-Erik Stenholm
Date: Thu, 28 Jan 1993 15:21
88 lines
2645 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads