Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
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 shows how to disable an html text input field programmatically through the CGI program and JavaScript code Resolution: INTRODUCTION ========== This demo shows how to disable an html text input field programatically through the CGI program and Javascript code. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- disablefield.app project file mycgi.cbl Internet App Wizard generated cgi program Copy Files: ------------------- ----------------------------------------------------------- mycgi.cpf Form fields copyfile mycgi.cpy &nb
Problem: Using Win 32 API to create a new process in COBOL Resolution: INTRODUCTION ========== This example demonstrates the use of the Win32 API function call CreateProcess in order to execute a non-COBOL program from within a COBOL program. In this example, the Windows Text Editor NOTEPAD.EXE will be executed. The program will then wait until NOTEPAD has been exited at which point it will also exit. CreateProcess allows you to control how a program is started along with the parameters the environment and the working directory that the new program should use. SOURCE FILES: ========== Program Files Description -------------------- ----------------------------------------------------------- CREATEP.CBL Program that calls the CreateProcess function. WINTYPES.CPY Copy file
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: Would like to know how to do old DOS Landscape Print reports in Net Express ? When converting a system that prints 132 character width and 66 lines to a page how can you get this working using Windows. Resolution: You can use the printer redirection runtime tunable to redirect print to the Windows Print spooler. You can also then use the PC_PRINTER routines to switch into Landscape mode and use a suitable monospaced font. An example of this approach is attached. Attachments: redir.zip Old KB# 4202
Problem: This demo shows how to use the usage of the GetFileAttributes and SetFileAttributes APIs. This sample will set a file as Read-Only. Resolution: INTRODUCTION ========== This demo show how to use the usage of the GetFileAttributes and SetFileAttributes APIs. This sample will set a file as Read-Only. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- fileattribute.cbl OPERATION: ======== Rebuild and animate program. ========================================================== Keywords: demonstration, sample, example, demo, win32 api, attrib.zip demo.ex demo.me demo.ne Attachments: attrib.zip Old KB# 4159
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: 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: 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: 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 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 program demonstrates the use of Win32 API calls SHBrowseForFolder and SHGetPathFromIDList to display a dialog box that will allow the user to select a directory. Resolution: INTRODUCTION ========== This program demonstrates the use of Win32 API calls SHBrowseForFolder and SHGetPathFromIDList to display a dialog box that will allow the user to select a directory. SOURCE FILES: ========= Program Files Description -------------------- ----------------------------------------------------------- getDirectory.cbl COBOL program with logic to show a folder browser dialog. getDirectory.gs Dialog System screenset. Copy Files: --------------------  
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: 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 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: 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 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 example demonstrates the use of the Win32 SDK function FormatMessage to receive an error message text associated with a specified error number. Normally this would be used in conjunction with the GetLastError function in order to receive the error message text associated with an error returned by the last Win32 SDK function call. This example will simply display the error message text for the first 20 system errors numbered 0 through 19. This example also demonstrates the use of COBOL typedefs. Resolution: INTRODUCTION ========== This example demonstrates the use of the Win32 SDK function FormatMessage to receive an error message text associated with a specified error number. Normally this would be used in conjunction with the GetLastError function in order to receive the error message text associated with an error returned by the last Win32 SDK function call. This example will simply display the error message text for the first 20 system errors numbered 0 through
Problem: Dialog System ( DSWIN.exe ) : How to do batch processing operations ? Resolution: In the Net Express online help, Search for the keyword DSWIN. You should find an entry titled 'Starting DialogSystem' which documents all the command-line parameters of the command DSWIN.EXE ( Dialog System tool ). Old KB# 4186
Problem: Every time a COM registered component was created there was a slight delay. This leads to a performance issue when componants are consistantly being created. Resolution: This was due to a "wins" server being specified in TCPIP setting. The wins setting should not have been specifed as the site was using a dns server. Old KB# 4193
Problem: Following is an example of how to Play a WAV file under 32-bit windows using the Win 32 API functions and PlaySound (old api) and PlaySound (Current API). The PlaySound API is the recommend way, and the information below relates only to the play sound demo. The zip file constains information about the sndPlaySound demo. Resolution: BUILD W/RELEASE: Net Express 4.0, All04n40.exe and 3.1, SP1 FixPacks ============ Two Net Express project files, "PlaySound.APP" and "PlaySound.OLD" are present in the project directory. The "PlaySound.APP" file is a Net Express 4.0 project file. The "PlaySound.OLD" file is a Net Express 3.1, SP1 project file. If you are working with Net Express 3.1 rename the 4.0 project file ("PlaySound.V40") and change the file extension of the 3.1 project file from "OLD" to "APP". INTRODUCTION ========== The "PlaySound"
Problem: This example program demonstrates how to find the executable program name which is associated with a particular file extension and then use it to open the specified file. It uses the two Win32 API functions FindExecutable and CreateProcess. Resolution: INTRODUCTION ========== This example program demonstrates how to find the executable program name which is associated with a particular file extension and then use it to open the specified file. It uses the two Win32 API functions FindExecutable and CreateProcess. File associations are made in Windows Explorer under the File Types option. This example uses the filename DUMMY.CBL which is associated with Net Express when it is installed. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- FINDEXE.CBL &nb
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: Example of using an Indexed file to track multiple executions of the same program Resolution: INTRODUCTION ========== This project uses an indexed file to track multiple executions of the same program. SOURCE FILES: ========= Program Files Description ------------------- ----------------------------------------------------------- AppNmbrs.APP NetExpress project file Snapa.CBL COBOL source code Snapd.CBL COBOL source code Snapm.CBL COBOL source code Snapq.CBL COBOL source code Copy Files: ------------------- --
Problem: This example program demonstrates how to use the Windows SDK functions to read and write to a system .INI file. These functions have been replaced by the Registry functions in 32-bit programs (see COBREG sample) but still exist to maintain compatibility with 16-bit programs. This program will read the WIN.INI file looking for the following entry: [NetExpressApp] NetExpressKey= If it finds the entry it will display the value associated with NetExpressKey. If it does not find the entry it will go ahead and create it and then read it back and display the value associated with NetExpressKey. Resolution: INTRODUCTION ========== This example program demonstrates how to use the Windows SDK functions to read and write to a system .INI file. These functions have been replaced by the Registry functions in 32-bit programs (see COBREG sample) but still exist to main- tain compatibility with 16-bit programs. This program will read the WIN.INI file looking for
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.