🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.intrabuilder.forms
3 messages
3 total messages Started by Pasi Bergman Mon, 03 Aug 1998 00:00
Calling DLL-functions ?
#116
Author: Pasi Bergman
Date: Mon, 03 Aug 1998 00:00
38 lines
1635 bytes
Hi,

I've developed a DLL using Borland Delphi 3. I'm trying to call the
one and only function in the DLL. Everything works fine if I call
the DLL from a Delphi program (that I've developed to test the
DLL), but if I try to call the DLL from IntraBuilder the Designer
crashes. Does anyone know why this happens ?

Does anyone have good experiences using DLLs with
IntraBuilder ?

--------------- Delphi source ----------------------
function MakeMyFile( Parameter1: PChar;
                                Parameter2: PChar;
                                Parameter3: PChar;
                                Parameter4: PChar ): integer; export;
------------------------------------------------------

--------------- IntraBuilder source ----------------
extern int MakeMyFile( char*, char*, char*, char*  ) "./MY.DLL"

// {End Header} Do not remove this comment//
// Generated on 31.07.1998
//
var f = new otfileForm();
:
:
   function button1_onServerClick()
   {
       var N = 0;
       N = MakeMyFile( '123', '123', '123', '123' );
       :
       :
   }
}
-----------------------------------------------------

Pasi B.
Re: Calling DLL-functions ?
#196
Author: Jeremy Burges
Date: Wed, 30 Sep 1998 00:00
57 lines
2054 bytes
Hello

Did you ever get this sorted out?
I get exactly the same effect when tring to call the mailsock.dll supplied
with IB. ie, the designer (or agent) simply freezes.

I'd be grateful if you could tell me how you fixed it (if indeed you did!)

Regards
Jeremy Burges


 
> Hi,
>
> I've developed a DLL using Borland Delphi 3. I'm trying to call the
> one and only function in the DLL. Everything works fine if I call
> the DLL from a Delphi program (that I've developed to test the
> DLL), but if I try to call the DLL from IntraBuilder the Designer
> crashes. Does anyone know why this happens ?
>
> Does anyone have good experiences using DLLs with
> IntraBuilder ?
>
> --------------- Delphi source ----------------------
> function MakeMyFile( Parameter1: PChar;
>                                 Parameter2: PChar;
>                                 Parameter3: PChar;
>                                 Parameter4: PChar ): integer; export;
> ------------------------------------------------------
>
> --------------- IntraBuilder source ----------------
> extern int MakeMyFile( char*, char*, char*, char*  ) "./MY.DLL"
>
> // {End Header} Do not remove this comment//
> // Generated on 31.07.1998
> //
> var f = new otfileForm();
> :
> :
>    function button1_onServerClick()
>    {
>        var N = 0;
>        N = MakeMyFile( '123', '123', '123', '123' );
>        :
>        :
>    }
> }
> -----------------------------------------------------
>
> Pasi B.
>
>
>


J. Burges
Re: Calling DLL-functions ?
#199
Author: Cardiologia
Date: Fri, 02 Oct 1998 00:00
59 lines
1645 bytes
Jeremy Burges wrote:
> 

here is my Delphi DLL that works with Intrabuilder:
// project file
library mcsintra;

uses
  SysUtils,
  Classes,
  mcsintra1 in 'mcsintra1.pas';

exports
 copiacat,readtxt resident;

begin

end.


// unit file
unit mcsintra1;

interface
  uses Windows, DB, DBTables, BDE, forms, mask, SysUtils, StdCtrls,
Classes, Math,
       WinSpool, Printers, Dialogs, Controls;
function copiacat(s:PChar;nome:PChar;d:PChar;n:integer) :PChar; stdcall;
function readtxt(s:PChar) :PChar; stdcall;

var  buff:array[0..10000] of char; //declare static to avoid dynamic
memory problems

implementation

...

function readtxt(s:PChar) :PChar; stdcall;
var nb,fd1,fd2,offs,l,blocksize,filespercat,offset,length:integer;
catname:string;

begin
     ....
     FillChar(buff, SizeOf(buff), #0);
     nb := FileRead(fd1,buff,nbyte);
     FileClose(fd1);
     Result := @buff;
end;

end.


Intrabuilder code:
extern char* readtxt(char*) "mcsintra1.dll";
var txt = readtxt("param");


Hope helps.
Eugenio
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