[Migrated content. Thread originally posted on 24 September 2003]
I am trying to learn how to do this in Cobol. Is it even possible to call an ActiveX Dlls written in VB? I've tried the way it was explained in one those Tech Tips on AcuCorp Forum , How to call Dll's under Windows, but I am getting "Program missing or inaccesible" error message.
The example of Vb dll code in Class Modues (cMyObject):
_______________________
Option Explicit
Public Function Add(ByVal A As Integer, ByVal B As Integer) As Integer
Add = A B
End Function
Public Function Subtract(ByVal A As Integer, ByVal B As Integer) As Integer
Subtract = A - B
End Function
_________________
First of all, there is no such thing as an ActiveX DLL.
It is difficult to state what you do wrong when there is no example of what you do. Can you please provide some sample COBOL code too?
Having said this, I presume what you think of when stating ActiveX DLL, is that you have a DLL that exports an object. This is not supported by ACUCOBOL-GT, but then, nor is this an ActiveX.
ACUCOBOL-GT supports Active-X/COM, it supports DLLs. But it does not support DLLs that exports objects (not to confuse with ActiveX/COM).
[Migrated content. Thread originally posted on 24 September 2003]
I am trying to learn how to do this in Cobol. Is it even possible to call an ActiveX Dlls written in VB? I've tried the way it was explained in one those Tech Tips on AcuCorp Forum , How to call Dll's under Windows, but I am getting "Program missing or inaccesible" error message.
The example of Vb dll code in Class Modues (cMyObject):
_______________________
Option Explicit
Public Function Add(ByVal A As Integer, ByVal B As Integer) As Integer
Add = A B
End Function
Public Function Subtract(ByVal A As Integer, ByVal B As Integer) As Integer
Subtract = A - B
End Function
_________________
Hey gforseth,
I am new at this type of interface and trying to learn, so if I seem cluless, you are right. Any kind of help you provide will be appreciated.. Anyway,
Attched is the sample VB codes:
Of Course, I've compiled it as SimpleCalculator.dll and in Cobol program I have following lines:
set environment "dll-convention" to 1.
Call "user32.dll".
Call "ole32.dll".
Call "SimpleCalculator.dll".
Call "AddNumbers" using number1, number2
giving number3.
Of course when it comes to Call "AddNumbers", the runtime system is giving me the error message
[Migrated content. Thread originally posted on 24 September 2003]
I am trying to learn how to do this in Cobol. Is it even possible to call an ActiveX Dlls written in VB? I've tried the way it was explained in one those Tech Tips on AcuCorp Forum , How to call Dll's under Windows, but I am getting "Program missing or inaccesible" error message.
The example of Vb dll code in Class Modues (cMyObject):
_______________________
Option Explicit
Public Function Add(ByVal A As Integer, ByVal B As Integer) As Integer
Add = A B
End Function
Public Function Subtract(ByVal A As Integer, ByVal B As Integer) As Integer
Subtract = A - B
End Function
_________________
Hey gforseth,
I am new at this type of interface and trying to learn, so if I seem cluless, you are right. Any kind of help you provide will be appreciated.. Anyway,
Attched is the sample VB codes:
Of Course, I've compiled it as SimpleCalculator.dll and in Cobol program I have following lines:
set environment "dll-convention" to 1.
Call "user32.dll".
Call "ole32.dll".
Call "SimpleCalculator.dll".
Call "AddNumbers" using number1, number2
giving number3.
Of course when it comes to Call "AddNumbers", the runtime system is giving me the error message
[Migrated content. Thread originally posted on 24 September 2003]
I am trying to learn how to do this in Cobol. Is it even possible to call an ActiveX Dlls written in VB? I've tried the way it was explained in one those Tech Tips on AcuCorp Forum , How to call Dll's under Windows, but I am getting "Program missing or inaccesible" error message.
The example of Vb dll code in Class Modues (cMyObject):
_______________________
Option Explicit
Public Function Add(ByVal A As Integer, ByVal B As Integer) As Integer
Add = A B
End Function
Public Function Subtract(ByVal A As Integer, ByVal B As Integer) As Integer
Subtract = A - B
End Function
_________________
First of all. This is not a DLL, but a COM library. It is a COM library that contains the classes:
AddNumbers
DivNumbers
MulNumbers
SubNumbers
They may not be accessed as DLL functions, but through the COM interface; CREATE, MODIFY, INQUIRE, DESTROY that is.
Developing COM services (and DLLs for that matter) is a difficult task, I strongly suggest you rather try to find someone already available than jumping into this on your own. When you don't know what you are doing, chances are likely that you will end up crashing the runtime.
The fact that you may make it work with VB doesn't mean it will work with other languages (Visual C , Delphi, Java...), VB has its own ways of working with itself, which doesn't necessarily mean it will work with other languages.