Highlighted
Absent Member.
Absent Member.
404 views

[archive] VB called from Cobol

[Migrated content. Thread originally posted on 21 May 2008]

Hello,
Can you call a Visual Basic program from Cobol and can you pass data to it?:confused:

Thanks
0 Likes
6 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] VB called from Cobol

Using command line, you can pass arguments. If a VB program has not been designed to interact, that is normally the only way.
If you design programs to interact, you would normally do them as DLLs, however, VB's DLL capability is not the Windows API DLL type, so it won't work.
If you were to design a VB program for the purpose of calling it from Acu, I would suggest you do either a windowless ActiveX or a COM project. This is though an area in which you easily run into trouble.
If you are thinking about designing something, I cannot help but wonder what it will do, perhaps it can be done in COBOL?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] VB called from Cobol

I wrote a Cobol program to send a fax using the "Microsoft Fax Service Extended COM Type Library". It would send the fax, but I would get a "Type Mismatch" error. Microfocus support said there was a defect in the runtime and suggested writing a VB program instead.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] VB called from Cobol

Show me the VB code and COBOL code for the line that cause the Type Mismatch error along with method/property definition in the def file. Also the definition of the data item(s) in WORKING STORAGE
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] VB called from Cobol

I attached the Cobol code in the General Forum in the thread "Faxing Success"

Thanks
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] VB called from Cobol

I would recommend getting the COBOL code to work, but when I have used VB programs for various reasons, I have always passed via the Windows Registry.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] VB called from Cobol

I attached the Cobol code in the General Forum in the thread "Faxing Success"


True, the COBOL code is there, but there is no def file, nor a listing of the similar VB code.

According to documentation, it is expecting a BSTR, but to be sure of that it will be required to see the def file.
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.