calling Delphi-DLL 
Author Message
 calling Delphi-DLL

Hi, has anyone worked with the posibility to call a routine in a
Delphi-DLL from Micro-Focus Cobol. The problem is to parse Data to to
DLL.

Thanks Jens



Sun, 14 Jul 2002 03:00:00 GMT  
 calling Delphi-DLL

Quote:
> Hi, has anyone worked with the posibility to call a routine in a
> Delphi-DLL from Micro-Focus Cobol. The problem is to parse Data to to
> DLL.

I don't know MF Cobol, but these things are usually pretty independent. May
I have your function declaration and how you call it from Cobol, preferably
also the declaration of the parameters in Cobol.

Cheesle



Sun, 14 Jul 2002 03:00:00 GMT  
 calling Delphi-DLL

writes:

Quote:

>Hi, has anyone worked with the posibility to call a routine in a
>Delphi-DLL from Micro-Focus Cobol. The problem is to parse Data to to
>DLL.

>Thanks Jens

In another thread regarding Fujitsu and Delphi:  Cheesle had this to say;
<<
Remember this is viewed from Acucobol <> Delphi, I do not know Fujitsu.

First of all, make your form into a .DLL, Delphi contains reasonable good
support on how to do that, just enter the help and index for DLL.

Make a frontend procedure of displaying your form which specifies the data
items you want.

Let's assume MyDLL.DLL and MyProc(String1, String2);

Acucobol does not have NULL terminated strings, so what I have used to do is
to make sure that I fill the strings (PIC X(xx)) with low-values, such that
the entire trailing area is filled with ascii 0.
Like:
    STRING "Whatever" LOW-VALUES DELIMITED BY SIZE INTO my-var.

Inside the Cobol you will then:

Loadlibrary MyDLL.DLL (In Acucobol this is done by: CALL "MyDLL.DLL")

Set your data

CALL MyProc USING
    BY REFERENCE string1,
    BY REFERENCE string2.

CANCEL "MyDLL.DLL".

If you want your data returned from the DLL, you may use StrPCpy to the
variable from Cobol.
Remember a few things:

    - In 32 bits windows, function calls are case sensitive
    - For numeric items, it is necessary to send BY VALUE
    - Be aware that Delphi by default does cdecl  parameter convention. You
may however alter this
      if Fujitsu does not.

Let me know if this just made you more confused or gave you a path to go.

Cheesle
I have found it best to setup the DLL calls as dynamic calls so you don't have
to
have the .EXP and .LIB files from Delphi.
Any strings that are passed must be NULL terminated for them to work properly.
I've had VERY LIMITED exposure to the integration of these two languages, but
expect to begin integrating future apps with Delphi, Visual Basic, and Visual
C++.



Sun, 14 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Calling Delphi DLLs

2. Calling Delphi DLL from Python

3. ctypes calling delphi dll

4. A CW DLL called from Delphi

5. Write delphi dll, call from clarion

6. Delphi Function Call (to CW DLL)

7. Function call from Delphi to CW dll

8. Delphi calls to Clarion DLL:Parameters?

9. C5PE calling Delphi 5 DLL

10. Call a Borland Delphi DLL with Structs from LabView

11. Calling an activeX-DLL written in Delphi.

12. calling visual fortran 6.5 routines in a dll from delphi 7

 

 
Powered by phpBB® Forum Software