Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: Sample project which highlights the use of hyperlinks in Net Express Resolution: INTRODUCTION ========== This HTML form illustrates the use of anchors (or hyperlinks) to navigate in different areas of the form. SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- Anchors.APP NetExpress project file Form Files: ---------------- ----------------------------------------------------------- Main.HTM HTML form OPERATION: ======== This project does not contain a CGI since the process is done from the HTML form using the hyperlinks (or anchors) to get to different areas of the form. The form therefore can be tested directly from a web browser or consider the following steps: (1) Load
Problem: This demo shows how to create and set the properties of a shortcut using the CreateShortcut Win32 API function. Resolution: INTRODUCTION ========== This demo will demonstrate how to create and set the properties of a shortcut using the CreateShortcut method. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- wsshortcut.cbl Application program Copy Files: ------------------- ----------------------------------------------------------- wintypes.cpy Resource Files: ------------------- ----------------------------------------------------------- mflogo.bmp REQUIREMENTS: ========== To be able to run this sample application you will need to modify the source code where indicated. Namely; invoke theshortcu
Problem: This show removing the Close Button from the COBOL Text Window Resolution: INTRODUCTION ========== Removing Close Button from the COBOL Text Window. This demo shows how to remove the "x" close button from the COBOL TEXT WINDOW title bar. It uses Windows Styles and API calls to acheive this. SOURCE FILES: ========= Program Files Description ---------------- ----------------------------------------------------------- test1.cbl Copy Files: ---------------- ----------------------------------------------------------- minwin.cpy winbase.cpy winclass.cpy winerror.cpy wingdi.cpy winnls.cpy wintypes.cpy winuser.cpy Resource Files: ---------------- ----------------------------------------------------------- runit.bat OPERATION: ======== To run the demo unzip to a directory and run "runi
Problem: Reading data from the COM port using WIN 32 APIs/Sending data to the COM port using WIN 32 APIs Resolution: INTRODUCTION ========== This example program demonstrates how to access the systems Serial communications ports using Windows API function calls. Two projects are used in this example. SENDCOM wants to send some data to whatever is connected to COM1. It starts by sending a message to the device to get its attention. READCOM then responds with a short "OK" message and then receives (without any response) whatever is sent by SENDCOM. SENDCOM ends the connection by sending a final "finish" message which, when received, causes READCOM to terminate. SENDCOM terminates after sending the finish message. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- SENDCOM .CBL
Problem: The SetWindowText Win32 API function can be used in a "Quick Win" or Windows application to change what is displayed by Windows in the Windows "Title Bar." In a Graphical Windows program, as opposed to a character ("Quick Win") program, you would get your Window handle from your CreateWindow Api call rather than the PC_WIN_HANDLE call-by-name routine. Resolution: INTRODUCTION ========== The SetWindowText Api can be used in a character mode program compiled with the Graphical setting or in a graphical application, to change what is displayed in the application's Window "Title Bar." In a graphical Windows program, you would get your Window handle from your CreateWindow Api call rather than the PC_WIN_HANDLE call-by-name routine used in this character mode example program. SOURCE FILES: ========= Program Files Description ----------------- --------
Problem: Example of an Active Server Page (ASP) calling a COBOL COM object Resolution: INTRODUCTION ========== This HTML form illustrates the use of JavaScript on some ActiveX controls. SOURCE FILES: ========== Program Files Description ------------------------ ----------------------------------------------------------- ASPtoCOBOL.APP NetExpress project file aspserver.CBL COBOL source code aspserver Trigger.CBL COBOL source code aspserver Server.REG Registry file Object Files -----------
Problem: MS APIs --> SetSysColors: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsyscolor.asp --> GetSysColor http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsyscolor.asp --> Color Table, RGB's values: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/colors/colors.asp Resolution: Paste of COBOL code ( attached to KB ): $set case copy "windows". identification division. special-names. call-convention 74 is STDCALL. working-storage section. 78 RGBlightGrey value x"C0C0C000". &
Problem: This demo illustrates using Win32 API function Winexec to start Notepad Resolution: INTRODUCTION ========== The program illustrates the use of the Windows API WinExec. This function runs the specified application. In this example, it runs Notepad.exe. This function is provided for compatibility with earlier versions of Windows. For Win32-based applications, use the CreateProcess function. SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- WinExec.APP NetExpress project file WinExe.CBL COBOL source code Help Files: ---------------- ----------------------------------------------------------- Readme.TXT This file OPERATION: ======== Consider the following steps: 1. Lo
Problem: This program demonstrates how to use the Windows 32-bit Network API functions to obtain a list of available network resources and their associated parameters. It also demonstrates how to map to a network drive and printer from within COBOL. Resolution: INTRODUCTION ========== This program demonstrates how to use the Windows 32-bit Network API functions to obtain a list of available network resources and their associated parameters. It also demonstrates how to map to a network drive and printer from within COBOL. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- ENUMNET.CBL Program that obtains information about all currently connected network drives. MAPNET.CBL Program that will map a l
Problem: WSDL syntax ( WSDL tutorial: http://www.w3schools.com/wsdl/default.asp ) allows a WSDL file to have more than one WSDL tag <port > and <binding > and <portype > . Unfortunately, at the time this article was written, the Micro Focus tool ( Net Express menu bar->Service->Generate Client->using WSDL), Our Web Service Client 'generator' , only uses one port (the first one) and includes all operations within the binding for that port. How to you create, in the Cobol Web Service Client, ALL THE OPERATIONS defined in the .WSDL which has multiple <port > & ...? You'll have to modify the .WSDL so it just uses ONE <port > and <binding > and <portype > tags. Enhancement request have been raised so the MF tool, our Web Service Client 'generator', can consume WSDLs using multiple <port > and <binding > and <portype > tags. These should be included
Problem: This example demonstrates the use of the two Win32 API functions WNetGetUser to retrieve the name of the user who is currently logged on, and WNetAddConnection2 to verify a specified password against a network servers password file for the current user. Resolution: INTRODUCTION ========== This example demonstrates the use of the two Win32 API functions WNetGetUser in order to retrieve the name of the user who is currently logged on, and WNetAddConnection2 in order to verify a specified password against a network servers password file for the current user. These routines allow you to use the Networks password authentication routines so that you can use the same network user names and passwords as security to your own application. You pass a network machine name, a username and a password to the WNetAddConnection2 function and it will attempt to log the specified user on to the network machine name provided. A return code is returned which indicates
Problem: Using Win 32 API functions to get the current user logged on the network Resolution: INTRODUCTION ========== This program demonstrates winapi call to get the network usernames. SOURCE FILES: ========= Program Files Description ---------------- ----------------------------------------------------------- getnuser.cbl program makes the necessary win api calls to get network usernames. Copy Files: ---------------- ----------------------------------------------------------- miniwin.cpy need these copybooks for winapi calls. winerror.cpy winnetwk.cpy wintypes.cpy REQUIREMENTS: ========== Edit the getnuser.cbl and at the top you will notice the compiler Directive intcode(1) that will need to be set for creation of .int intcode is initially set to 1. Chan
Problem: This example demonstrates the use of the two Win32 API functions GetVolumeInformation and GetDiskFreeSpaceEx in order to retrieve certain information about a specified disk drive. Resolution: INTRODUCTION ========== This example demonstrates the use of the two Win32 API functions GetVolumeInformation and GetDiskFreeSpaceEx in order to retrieve certain information about a specified disk drive. The GetVolumeInformation will return the volume name, the serial number the system flags and the type of file system for the specified drive. The GetDiskFreeSpaceEx will return the total amount of disk space and the total amount of free disk space available for the specified drive. SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- GETDISK.CBL Program that calls the WIN32 API functions. R
Problem: This shows how to get the details of the currently logged on users using Win32 API functions Resolution: INTRODUCTION ========== This program demonstrates using windows api calls to get computer name and user name. Place a brief description of the sample SOURCE FILES: ========= Program Files Description ---------------- ----------------------------------------------------------- getuser.cbl Program that makes win32 api calls to get the computer name and user name. Copy Files: ---------------- ----------------------------------------------------------- miniwin.cpy copybook needed to use the winapi calls. wintypes.cpy copybook needed to use the winapi calls. REQUIREMENTS: ========== Install the win32 sdk from the netexpress 3.1 cd-2
Problem: This example illustrates how to use the Windows MessageBox API function to display information for an application user. Four different techniques are described. Eight significant features are demonstrated: - call-convention, - COBOL Call Prototypes, - Constant Compiler directive, - Conditional Compilation, - Level 78 items, - z'literal', - procedure-pointer items, - set ... to entry ... statements. Resolution: INTRODUCTION ========== This example illustrates how to use the Windows MessageBox Api to display information for an application user. Four different techniques are described. Eight significant features are demonstrated, call-convention, COBOL Call Prototypes, Constant Compiler directive, Conditional Compilation, Level 78 items, z'literal', procedure-pointer items, and set ... to entry ... statements. There are five projects in these four directories: - cc66\\Cob32api\\MessageBox66
Problem: COM WORD: Automate Word to Perform a Mail Merge with Access Data ( GetMailMerge, OpenDataSource,... ) The cobol sample pasted below and attached to this KB is a copy & 'COBOL' paste of an example available on Microsoft Web site http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2kta/html/offaut.asp Automate Word to Perform a Mail Merge with Access Data MFC example //For optional arguments COleVariant vOpt(DISP_E_PARAMNOTFOUND, VT_ERROR); //Start Word _Application oApp; oApp.CreateDispatch("Word.Application"); if(!oApp) { AfxMessageBox("Cannot start Word."); &
Problem: This illustrates accessing the Windows registry with COBOL and writing or reading information from the registry Resolution: INTRODUCTION ========== This example demonstrates the use of the Win32 API function calls to access and create system Registry entries from within a COBOL program. In this example, we will create a new Registry key called "TestKey" which is a subkey of the Windows standard HK_CURRENT_USERS key. It will then create a null terminated string value name for this key and populate it with a value. It will then close the Registry, reopen the key, read the keys value and display the value to the user. You can check this keys existance after running this program by using the Windows program REGEDIT to view the Registry. SOURCE FILES: ========== Program Files Description ----------------- ----------------------------------------------------------- COBREG.CBL&
Problem: This illustrates GetSystemTime and GetLocalTime. It also uses CBL_ALLOC_MEM and CBL_FREE_MEM to get and free memory for the SYSTEMTIME structure and passes the pointer to the API calls by value rather than by reference. Resolution: INTRODUCTION ========== The program illustrates the use of the Windows API GetSystemTime and GetLocalTime. It also uses CBL_ALLOC_MEM and CBL_FREE_MEM to get and free memory for the SYSTEMTIME structure and passes the pointer to the API calls by value rather than by reference. SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- GST.APP Net Express project file GST.CBL COBOL source code Help Files: ---------------- &n
Problem: Is it possible to recover source code from int , gnt or executable code ? Resolution: There is no decompiler available for Micro Focus products. Unfortunately there is no tools available to recover COBOL from Micro Focus generated modules. Old KB# 4180
Problem: This program demonstrates the use of OLE Automation to send messages to objects in another application. This example uses Microsoft Word Resolution: INTRODUCTION ========== This program demonstrates the use of OLE Automation to send messages to objects in another application. This example uses Microsoft Word. This is a modified version of the demo program that is provided by Net Express in the NetExpress\\Base\\Demo\\Oledemos directory. It demonstrates how to change the Page Setup and Font information for a Word document. SOURCE FILES: ========== Program Files Description --------------------- ----------------------------------------------------------- WORDSETUP.CBL Program that calls the MSWord OLE automation functions. REQUIREMENTS: ========== Microsoft Word 97 or above needs to be installed on your system.
Problem: This sample program demonstrates how to use the Windows SHFileOperation API in order to send a file to the Recycle Bin when it is deleted. Resolution: INTRODUCTION ========== This sample program will demonstrate how to use the Windows SHFileOperation API in order to send a file to the Recycle Bin when it is deleted. This application will first call the subprogram "SelectFile" which uses the Net Express Class Library in order to display a Windows OpenFileName dialog box so that the user can select the name of a file to delete. The default filter used for the select file is *.tmp within the current directory. A number of temp files with this extension are provided in the project directory. Once a filename is selected and returned, this program will use the SHFileOperation API with the Delete function and the FOF-ALLOWUNDO flag which causes the deleted file to be sent to the Windows Recycle Bin so that it can be restored at a later tim
Problem: You may have validation defined for your Dailog System screenset, but the messages in the error message file do not appearwhen an invalid value is entered. Resolution: This could be because you have not defined the path of the error message file correctly (this is done by clicking on 'Resource Files' for the screenset and completing the appropriate field). Dialog System does not display an error when the mesage file is not found, it just displays spaces instead of the desired message. Old KB# 4203
Problem: Auf unseren Servern läuft auch ein Teilprogramm einer Kassenapplikation, welches mit Dialog System geschrieben ist. Das Programm überträgt timergesteuert Daten von der lokalen Datenbank in die zentrale DB2-Datenbank. Dieses Programm wurde bisher bei der automatischen Anmeldung des Servers im Rahmen der Anmeldeprozedur automatisch angestartet. Nun müssen wir dieses Programm als Windows Service starten lassen. Wir haben mittels des Windows Programmes "instsrv.exe" nun einen ausführbaren Windows Dienst erstellt. Dieser kann zwar angestartet werden und der Prozeß des Dialog System Programm erscheint im Prozeß Manager, dass Programm funktioniert aber nicht korrekt, es werden keine Daten übertragen. Können sie uns bitte daher Unterstützung geben, wie wir mit dem Dialog System Programm einen ausführbaren Windows Dienst erstellen können. Resolution: Es liegen derzeit bei Micro Focu
Problem: This example demonstrates how to create a link to an FTP site and also how to create an E-mail link from an HTML form designed with Form Designer. The input form is from an imaginary company and allows you to connect to an FTP site which is actually the Microsoft ftp site at Microsoft.com. The HTML document ftplinks.htm will be displayed in your browser. When the exit submit button is pressed, the CGI program FTP0501.EXE will be run which will display the output form ftplinks-out.htm. This form simply outputs a "Thank You" message to the user and offers a link back to the main page. Resolution: INTRODUCTION ========== This example demonstrates how to create a link to an FTP site and also how to create an E-mail link from an HTML form designed with Form Designer. The input form is from an imaginary company and allows you to connect to an FTP site which is actually the Microsoft ftp site at Microsoft.com. The HTML document ftplinks.htm will b
Problem: GetSystemMetrics is an API that can be used to collect details from Windows. In this example it is collecting the resolution currently in use. Resolution: INTRODUCTION ========== GetSystemMetrics is an Api that can be used to collect details from Windows. In this example it is collecting the resolution currently in use. SOURCE FILES: ========= Program Files Description ---------------- ----------------------------------------------------------- GSM.CBL Copy Files: ---------------- ----------------------------------------------------------- GSM.CPY REQUIREMENTS: ========== Ensure that the USER32.LIB is linked with the EXE. NOTE: ==== For details on the parameters that can be retrieved by this call go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/sysinfo_8fjn.asp ==================================================
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.