Skip to main content

Using a dll function in acucobol

  • November 27, 2012
  • 4 replies
  • 0 views

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?

4 replies

Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • November 27, 2012

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?

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


  • Author
  • Rocketeer
  • 19312 replies
  • November 28, 2012

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?

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(v=vs.85).aspx


  • Author
  • Rocketeer
  • 19312 replies
  • December 5, 2012

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?

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.


Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • December 5, 2012

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?

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.