Problem:
Scenario:
I need to create a Cobol based DLL, which can be called from Visual Basic 6 as a function. I have found vb-call-cobol.zip demo program in the Net Express Samples & Utilities section of the Micro Focus SupportLine. I am using that approach. I set up my VB program and compiled the Cobol module in Net Express. However, when I run VB, I'm getting run time error 53 - 'ccsvallt not found' ('ccsvallt.dll is my DLL).
Resolution:
Error 53 is reported in Visual Basic when it can't load the DLL. The most likely cause is that a Win32 DLL is being used rather than via OLE.
What's likely happening is that VB found the COBOL DLL but its failing to load because it cannot find the runtime.
You can try the following:-
- Use the Build Settings in the IDE (under the 'Project' menu) to set the Dynamic Option on the 'link' tab. Or right-click on the EXE and click on Build Settings. This will use the registry to find the runtime.
or
- Set up PATH and COBDIR to point to the location where the COBOL Application Server files are
You only need to install the Application Server product on the machine that does not have the Net Express development product installed, to run your executables on that Production server.
(Below extracted from the online help)
To create a new dynamic link library and add files to it:
If the source files are already in the project structure on the left of the Project window, select them there to change how they are packaged. If they aren't in the project structure yet, select them in the source pool on the right.
To select multiple files, hold down the Ctrl key while you click the files.
Right-click your selection.
Click Package Selected Files > Dynamic Link Library (DLL).
Enter a name for the new .dll file.
Click Create.
Next time you rebuild, the source files you selected are compiled and linked into a dynamic link library.
Tip: Remember that your program cannot use any routines in the .dll file until it has been loaded into memory. Use the SET PROCEDURE-POINTER statement in your main program to load the dynamic link library into memory before you attempt to access it.



