Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all 4356 articles
Browse latest View live

Visual COBOL 2.3 naïve program run time issue

$
0
0

I have an old Net Express project that I have converted to Visual Cobol 2.3, I had issues getting the RUN time module to load based upon my path command, so I copied all of the runtime modules into my folder and I get the following message:

 

DSGRUN.dll is in the CCARMARUN folder:

 

 

What am I doing wrong?  Do I have a compile/link option incorrect, using dynamic runtime model.

 

Thanks


Visual COBOL processing question

$
0
0

I have a Visual Studio 2017 COBOL question. I have a Solution of many projects and the projects all focus on a single form. From that form various projects are initiated for different processing but when returning to the originating form I don't know how to gain control of the processing without initiating something on the form (button). That means the user has to do this to finish the processing from the initiated projects (changes are made to the form). Where do I insert code that will automatically do the processing without intervention by the user? 

Printing a form - define printable areas

$
0
0

Hello! New to VC programming!

I need guidance on a project.

I created a windows form with labels, textboxes, radios, checkboxes etc.

 

I have put a print button, printDialog, printDocument. I set the method of the print button to appear the print dialog menu. I have stuck in this: How to define what to print from the form? For example, If I want to print whatever I see, is there any method. 

Thank you in advance for your help!!!

Cobol calling visual basic and passing Structure as parameter

$
0
0

I have a netexpress program calling a vb subroutine passing 3 integer parameters which works fine.

If I try to pass the second 2 integers as a group then I cannot get it to work. (the group will eventually have about 50 items in it)

VB Prog

Imports System.Runtime.InteropServices

<ComClass(vbpan32.ClassId, vbpan32.InterfaceId, vbpan32.EventsId)> _
Public Class vbpan32

#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class 
' and its COM interfaces. If you change them, existing 
' clients will no longer be able to access the class.
Public Const ClassId As String = "253aac3c-266c-4786-a71c-7185051536c2"
Public Const InterfaceId As String = "1882ce84-9369-4d02-ada6-1a6438e56a08"
Public Const EventsId As String = "d610f949-b193-4e5a-9398-7a9ed1426c4b"
#End Region

' A creatable COM class must have a Public Sub New() 
' with no parameters, otherwise, the class will not be 
' registered in the COM registry and cannot be created 
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub
<StructLayout(LayoutKind.Sequential)> Structure wingad_params

<MarshalAs(UnmanagedType.I4)> Public num1 As Integer
<MarshalAs(UnmanagedType.I4)> Public num2 As Integer
End Structure

' Tried without MarshalAs and tried "R8" not "I4", "I8" tried too. SHOULD NOT need this anyway for integers.

'<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=30)> Public Param1 As String
'<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=30)> Public Param2 As String

'<VBFixedString(30)> Public Param1 As String
'<VBFixedString(30)> Public Param2 As String


Public Sub WinGad1(ByVal Func As Integer, ByRef num1 As Integer, ByRef num2 As Integer)
MsgBox("wingad Integer updated")
'
MsgBox("Win Gadget [" & Func & "] " & num1.ToString & " " & num2.ToString)

End Sub


Public Sub WinGad2(ByVal Func As Integer, ByRef Func2 As wingad_params)
MsgBox("wingad Structure")
'
MsgBox("Win Gadget [" & Func & "] " & Func2.num1.ToString & " " & Func2.num2.ToString)

End Sub

End Class

COBOL PROGRAM

 

$set ooctrl(+p)
* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
identification division.
program-id. winpanvb.
*
environment division.
configuration section.
source-computer. IBM-PC.
object-computer. IBM-PC.
special-names.
call-convention 74 is CallConvension74
console is crt.
* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
class-control.
winpan is class "$OLE$vbpan32.vbpan32".
data division.
* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
working-storage section.
copy "system.d01".
copy "winpan32.d01".
*
01 DLL-Obj object reference.

01 w-params.
03 w-num1 pic 9(8) comp.
03 w-num2 pic 9(8) comp.

01 w-func pic 9(8) comp value 1234.
* -----------------------------------------------------------------
01 w-message.
03 w-mess1 pic x(10) value "winpanvb".
03 w-messcnt pic 9999 value 0.
* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
procedure division.
winpan32-main section.
add 1 to w-messcnt.
display w-message.
*
invoke winpan "new" returning DLL-Obj.
move 888 to w-num1.
move 777 to w-num2.
*-------------------------------------------------------
stop "Call DLL-Obj using integers".
invoke DLL-Obj "WinGad1" using w-func
w-num1
w-num2.
*---------------------------------------------------------
stop "Call DLL-Obj using structure".
invoke DLL-Obj "WinGad2" using w-func
w-params.
*---------------------------------------------------------
stop "Call DLL-Obj Test Complete".
winpan32-end.
stop Run.

RESULTS

  

Calling 1st Routine wingad1 works fine passing integers.

 

Calling 2nd routine wingad2 with integer and group field fails. Tried to define a sequential structure to equate tto group field (found this in a sample program on MF site) but I must be missing something.

 

Linkerror: Cobol program "SQLADR" undefined

$
0
0

i have a small sql-testprogram and precompile it under eclipse with Oracle Pro*Cobol . If the result is a int-file, the run works fine using rtsora.  The compile/link as SingleExecutableFile shows the linkerror: 'Cobol program "SQLBEX"/"SQLADR" undefined'. The OracleInstantClient is installed and then libclntsh.so (lib where sqladr and sqlbex is included) ist available in ldconfig-cache.

running the program (" ./pgm") shows a similar error

Load error : file 'SQLADR'
error code: 173, pc=0, call=1, seg=0
173     Called program file not found in drive/directory

What is the problem? How can i resolve link errors?

environment is RHEL, VisualCobol4.0, recent OracleClient

 

regards lw

VC 2.2 and NuGet

$
0
0

I'm developing a DLL using Visual Cobol 2.2, and I want to make it a NuGet package so that other people in my shop can leverage it.  In my VC project, the first time I tried to do this, I right-clicked on References and clicked on "Manage NuGet Packages."  I received a message along the lines of "Not compatible with project."  Not sure of the exact message text because I only got it once.  After that, if I right-click on References, I do not even get the "Manage NuGet Packages" option.  If I try to add the Nuget package at the solution level, I get a message "...could not be installed because it is not compatible with any project in the solution."

What am I missing?  Is there something I need to do to the project properties for it to support NuGet?  Something with the NuGet configuration?  Something to the VC config?

Thanks for the help,

Mike

Cobol compilation with cobol server license

$
0
0

Hi,

We have a COBOL server 3.0 installed with a valid license. Was trying to compile a program to create .o (object file) in UAT environment and it gave a error "Error[18]: No license code is available for feature RestrictedNativeChecker on host 127.0.0.1."

Do I need a devhub to compile.

Note: We have a devhub license for DEV env and 2 COBOL server license one each for UAT and PROD.

Why won't VC personal edition install?

$
0
0

Hi -

I'm trying to install Visual COBOL Personal Edition on OpenSUSE Tumbleweed (version id =  20180829). I've added the dependencies the installer asked for (Ed, glibc-locale-32bit and JDK 8), but when I run the installer I get:


install.sh - ExtractFiles - 001 - Failed to extract product
PaX tool returned non-zero return code. RC:- 255

The installer has created the following directories below /opt/microfocus, but both the VisualCOBOL directories are empty: 

logs
VisualCOBOL
VisualCOBOL.BKP-2018-0-03.14:54:01

Any suggestions? 

Thanks. 


Formatting Zip Code and Using Insert key in Dialog System

$
0
0

I am trying to do two simple tasks and I cannot find the answer in help topics. 

 

1) How can I format an entry field in Dialog Sytem to display a zip code with dashes. For example, I am trying to display the zip code 115308020 as 11530-8020. I am able to format amount fields and date fields but I cannot figure out zip code fields

 

2) Dialog Sytem comes with insert fields as INS1 and INS0. I am trying to give the user the ability to overwrite text on an entry field. For example, on most windows application, users simply hit the "insert" key on their keyboard in order to overwrite text as appose to appending text. But the help topics in Dialog System does not really provide information as to how to use their INS1 and INS0 functions in order to achieve this.

 

Thanks in advance for your help

Are Microfocus Cobol 2.2 source programs for DOS COBOL 85 compliant?

$
0
0

Hi,

 

Are Microfocus Cobol 2.2 source programs for DOS COBOL 85 compliant?

 

Regards

Suresj

Don't know how to delete programs from solution / project

$
0
0

I've got about sixty programs in my solution / project.  (The entire solution is one project)

I decided that about ten programs were obsolete, no longer needed, so I deleted the source code (*.cbl).

But now when I try to build/rebuild either the solution or project, I get errors like these:

1>COBOL : error COBCH1502: Open fail : 'C:\PSMJ\TEST.cbl'
1>COBOL : error COBCH1502: Open fail : 'C:\PSMJ\X-BB-BENCH.cbl'
1>COBOL : error COBCH1502: Open fail : 'C:\PSMJ\X-FE-BENCH.cbl'
1>COBOL : error COBCH1502: Open fail : 'C:\PSMJ\X-FN-BENCH.cbl'
1>COBOL : error COBCH1502: Open fail : 'C:\PSMJ\X-MC-BENCH.cbl'

What can I do to make the solution / project completely forget about these programs?

Consuming C# WCF service from managed visual cobol winform application

$
0
0

I was able to execute the sample visual cobol WEB WCF service and validate its results.

I am trying to consume a C# WCF service hosted in a different domain from a winform test client managed program developed using VC 2.3.

I get error message  "The server has rejected the client credentials".

Here's my test client app config file details...

 

<client>

<endpoint address="net.tcp://servername.domain:port number/path/TestService.svc" binding="netTcpBinding" bindingConfiguration="TestService" contract="ServiceReference.ITestService" name="TestService">
<identity>
<userPrincipalName value="service account@another domain" />

</identity>
</endpoint>
</client>

 

What am i missing ? 

Need documentation / video explaining BUILD, REBUILD, and CLEAN

$
0
0

I don't understand what those terms mean.  I would be most appreciative for reference to any "for dummies" documents or videos on BUILD, REBUILD, and CLEAN.

Set cursor position in Dialog System

$
0
0

I have an alphanumeric entry field which I am populating before displaying my dialog screen and would like to set the cursor position at the end. For example, if I populate an entry field in my Visual Cobol program with the word "TESTING"  prior to displaying my screen, I would like the blinking cursor to appear at the end of the word (which would be after the letter "G") once my screen displays.  I do not know how to do this.

 

Thanks in advanced for your help.

Managed COBOL access to C functions by setting an entry point to a .dll

$
0
0

I am compiling procedural COBOL into class files and deploying it to an .ear folder which is being run using JBOSS. The program exits prematurely and I am seeing the following error in the server logs:

com.microfocus.cobol.program.COBOLProgramLoadException: 173     Called program file not found in drive/directory [ONOFFCHK]

 

ONOFFCHK is one of many functions the application uses to handle memory contained in a .dll file called ACSDLL. This .dll contains functions exclusively written in C. Using the debugger I have found the line of code where the failure occurs:

SET DLLPTR TO ENTRY "ACSDLL".

 

It seems like the .dll is not being found at runtime, despite its directory being set in the PATH. Is there any particular setup in Eclipse or compiler directives required to link JVM COBOL to a .dll containing C functions?

 

Thanks!


Calling an API by using a client ID and client secret

$
0
0

Can a REST API definition supplying client ID and/or client secret be done using Visual COBOL 2.3 for Visual Studio 2012?  Is this possible from the new project/the web service client application from WSDL/JSON or using IMTKMAKE?

Implicitly Type

$
0
0

Is there a way to implicitly type a variable in visual cobol?

For example, in C#, if I have the statement:

var myResult = myFunction(parm, parm2);

The type of myResult will be whatever type that myFunction returns.

Is there a cobol equivalent to the above function call?

Thanks,

Mike

Code Conversion

$
0
0

Hi,

Can any advise how to convert below to Visual Cobol?

using System;

using System.IO;

using System.Net;

using System.Net.Security;

using System.Security.Cryptography.X509Certificates;

 

namespace ConnectToFtpDemo

{

    class Program

    {

        static void Main(string[] args)

        {

            try

            {

                FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp:///testFileUpload.txt"); 

                request.Method = WebRequestMethods.Ftp.UploadFile; 

                request.Credentials = new NetworkCredential("Username", "Password");

                request.EnableSsl = true;

                ServicePointManager.ServerCertificateValidationCallback = ServicePointManager_ServerCertificateValidationCallback;

 

                long bytesSent = 0;

                using (Stream requestStream = request.GetRequestStream())

                using (FileStream uploadFileStream = File.OpenRead("C:\\Test\\test.txt"))

                {

                    uploadFileStream.CopyTo(requestStream);

                    bytesSent = uploadFileStream.Position;

                }

 

            }

            catch (Exception ex)

            {

                Console.WriteLine(ex);

            }

 

            Console.ReadLine();

        }

 

 

        private static bool ServicePointManager_ServerCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)

        {

            //TODO: Logic to determine if certificate sent by server on connection is valid if it is return to true otherwise return false

            return true;

 

            //Type type = null;

 

            //var publicKey = certificate.GetPublicKeyString();

            //// Check public key if matche

            //type = certificate.GetType();

            //var p = type.GetProperty("Thumbprint");

            //var thumbPrint = p.GetValue(certificate)?.ToString();

           

 

        }

    }

}

JVMCLASSPATH cannot exceed 255 characters

$
0
0

I am having a problem compiling my COBOL app with Linux bash script.  I need to set JVMCLASSPATH to several JAR files and I keep getting the error 

 

Cobol compiler argument exceeds 255 byte limit: JVMCLASSPATH(...)

 

Any suggestions ?

 

basic question regarding debugging a remote cobjvm program from eclipse

$
0
0

We are migrating from Server Express 5.1 to Visual COBOL 3.0.  I am trying to get a very basic COBJVM example to debug.

 

The environment is

 

Visual COBOL for express 3.0 on windows 10

Visual COBOL devhub 3.0 on SLES 12.

 

I have created a new remote COBOL project with Java Byte Code target.

 

I have created and compiled a very simple COBOL program   (See end of this post)

 

The program compiles fine, and I can run it by going over to Linux and running cobjrun, but when I try to debug it in eclipse I get the following error

 

                 Could not launch remote project.  Check that the remote server settings are not empty. 

 

the remote server setting is definitely not empty, it shows the correct server.

 

----- program ----

 

       program-id. ap02 as "ap02".
       data division.
       working-storage section.
       procedure division.
           display 'Hello, World'.
           goback.
       end program ap02.
Viewing all 4356 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>