Attribute VB_Name = "Micro_Focus_VB_demo_BAS_module" Option Explicit Type COBOLInterface String_40 As String * 40 Integer As Integer String_40A As String * 40 Long As Long String_40B As String * 40 single As Single String_40C As String * 40 double As Double String_40D As String * 40 String_40_out As String * 40 Integer_out As Integer String_40A_out As String * 40 Long_out As Long String_40B_out As String * 40 single_out As Single String_40C_out As String * 40 double_out As Double String_40D_out As String * 40 message_out As String * 50 End Type Global CallInterface As COBOLInterface ' IMPORTANT - DO NOT name the DLL the same as any ' form - this WILL ERROR in VB 4.0 ' Use the following Declare statements with correct ' location for DLL during debugging 'Declare Sub MFDLL Lib "c:\demo\VB\MFDLL.dll" () 'Declare Sub REALWORK Lib "c:\demo\VB\MFDLL.dll" (CallInterface As COBOLInterface) ' The following Declare statements will work when run Declare Sub MFDLL Lib "MFDLL.dll" () Declare Sub REALWORK Lib "MFDLL.dll" (CallInterface As COBOLInterface) Dim BeepVal As Integer Declare Sub MessageBeep Lib "user" (ByVal BeepVal As Integer) Sub Call_COBOL_DLL() 'Call the DLL entry point ' (no arguments passed or returned) MFDLL CallInterface.String_40_out = "" CallInterface.String_40A_out = "" CallInterface.String_40B_out = "" CallInterface.String_40C_out = "" CallInterface.String_40D_out = "" CallInterface.Integer_out = 0 CallInterface.Long_out = 0 CallInterface.single_out = 0 CallInterface.double_out = 0 ' Call the REALWORK Entry in MFDLL.DLL REALWORK CallInterface End Sub