Highlighted
Absent Member.
Absent Member.
2874 views

Using a dll function in acucobol

I need write a program can use tapi32.dll.

I use acucobol compiler.

my problem is understand how transform code in cobol.

I call Tapi32.dll.

:          SET ENVIRONMENT "DLL_CONVENTION" TO "1"

:          CALL "TapI32.dll"

:                ON EXCEPTION

:                   DISPLAY MESSAGE BOX

:                   "Message: Tapi32.dll not found"

:                   SET ENVIRONMENT "DLL_CONVENTION" TO "0"

:          END-CALL.

and now i had to call for example "lineInitialize" function

ex.

LONG lineInitialize(

 LPHLINEAPP lphLineApp,

 HINSTANCE hInstance,

 LINECALLBACK lpfnCallback,

 LPCWSTR lpszAppName,

 LPDWORD lpdwNumDevs

);

Anyone can help me?

0 Likes
4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

You might want to look in this forum here: community.microfocus.com/.../5601.aspx

0 Likes
Highlighted
Absent Member.
Absent Member.

As a side note, you may wish to change which function you are calling.  lineInitialize is obsolete according to the docs. msdn.microsoft.com/.../ms735982%28v=vs.85%29.aspx

0 Likes
Highlighted
Absent Member.
Absent Member.

ok.

I declare this variables

:      01  TAPI32-STATUS PIC X(4) COMP-N.

:      01  myvar.

:          05 lphLineApp HANDLE.

:          05 hInstance PIC X(4) COMP-N.

:          05 lpfnCallback PIC X(4) COMP-N.

:          05 lpszFriendlyAppName pic x(12).

:          05 lpdwNumDevs PIC X(4) COMP-N.

:          05 lpdwAPIVersion PIC X(4) COMP-N.

:          05 lpLineInitializeExParam PIC X(4) COMP-N.

and call

:          CALL "lineInitializeExA" using

:             by reference lphLineApp

:             by reference hInstance

:             by reference lpfnCallback

:             by reference lpszFriendlyAppName

:             by reference lpdwNumDevs

:             by reference lpdwAPIVersion

:             by reference lpLineInitializeExParam

:             giving TAPI32-STATUS

:          END-CALL.

but someting not working.

tapi32-status isn't 0 and all variables aren't initializzate.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

You need to call tapi32.dll before calling lineInitializeExA

CALL "TapI32.dll"              

               ON EXCEPTION            

                  DISPLAY MESSAGE BOX  

                  "Message: Tapi32.dll not found"  

                  SET ENVIRONMENT "DLL_CONVENTION" TO "0"                

            END-CALL.              

            CALL "lineInitializeExA" using

Based on this article ... www.gtro.com/.../tapi_e.php the TAPI32-STATUS will hold a handle .. exeuting in debug I get a value of 2147483701 which appears to be a valid handle value.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.