Skip to main content

Hi

We recently upgraded from Visual Cobol 2.3 for Visual Studio Community 2015 to Visual Cobol 8.0 for Visual Studio Community 2022 on Windows 10.  Uninstalled VC 2.3 and VS 2015 first.  Also, installed Update 9 of Visual Cobol and  VS 2022 v 17.7.2.  Made copies of all projects and changed the Target framework from .NET Framework 4.5.2 to 4.6.2 in all projects, because 4.5.2 is no longer supported.  Application is a Windows forms app. 

There are now some problems with version 8.0:

1. Accessing properties/methods on data items defined in another .cbl (eg objects on a form where the objects are instantiated in the .designer.cbl) the data item is coloured differently in the editor

In V2.3:

set litem-butt-amend::Enabled to false

In V8.0

set litem-butt-amend::Enabled to false

In V8.0 the data item shows as green.  This does not happen in the .designer.cbl.  I cannot find a setting in Fonts and Colors to fix this.

2. Getting error when reading from a static dictionary defined in another class.

In class that defines dictionary object:

class-id ClassColors.estats.

01 color-norm type Color public static property as "color-norm" value type SystemColors::ControlText.
01 color-new type Color public static property as "color-new" value type Color::LimeGreen.
01 color-left type Color public static property as "color-left" value type Color::Red.
01 color-hol type Color public static property as "color-hol" value type Color::FromArgb(128, 224, 255).
01 color-hold type Color public static property as "color-hold" value type Color::FromArgb(255, 192, 0).
01 color-dec type Color public static property as "color-dec" value type Color::Black.

01 dic-color public static property dictionary [string type Color].

method-id estat-colors static.
procedure division.

create dic-color.

write dic-color from color-norm key "N" *>> Black
write dic-color from color-norm key "P" *>> Black
write dic-color from color-new key "Y" *>> Green
write dic-color from color-left key "L" *>> Red
write dic-color from color-left key "T" *>> Red
write dic-color from color-hol key "H" *>> Blue
write dic-color from color-hold key "U" *>> Orange
write dic-color from color-dec key "D" *>> Black

goback.
end method.

In Windows forms class I call the method above:

invoke type spaye::stat-colors

Later I read the dictionary:

read type ClassColors.spaye::dic-color into color-stat key LI-STATUS

color-stat is type Color and LI-STATUS is PIC X.

I am getting an error on this line "COBCH0013: User-name required".  This does not happen in V2.3  Otherwise, there seem to be no build errors in V8.0 projects.

3. (Erroneous) Errors with Office Interop objects.  We have a number of programs where we convert csv files to Excel.  Putting the directives

$set ilusing "Microsoft.Office.Interop.Excel"
$set ilref "Microsoft.Office.Interop.Excel"
$set ilusing "System.Runtime.InteropServices"

at the top of the program was sufficient in V2.3 to access the interop objects.  No need to add Microsoft.Office.Interop.Excel as a Reference or namespace.

In V8.0 we are getting COBCH0845 unknown type errors, eg on the lines:

01 ExcelObject type Microsoft.Office.Interop.Excel.Application.
01 WorkBooksCollection type Workbooks.

and

set ExcelObject to new type Microsoft.Office.Interop.Excel.Application

or at least that is what the editor says!  The program builds successfully and the errors disappear.  Then close the program and open it again and the error come back, or even just scroll through the program and the errors come back.  Adding Microsoft.Office.Interop.Excel.Application as a Reference or imported namespace and the errors disappear completely.  So the errors appear to be somewhat erroneous, but disconcerting.

4. Background Tasks in VS.  Bottom left hand corner of Visual Studio is shows a constant icon saying it is indexing the files in the project directory.  After googling I found the deleting the file Indexing.servicehub.service.json stopped the service but does not remove the icon or give the impression that the service has stopped.  I appreciate this is likely as Visual Studio issue.

I appreciate any help on these issues.

Regards

Brendan

Hi

We recently upgraded from Visual Cobol 2.3 for Visual Studio Community 2015 to Visual Cobol 8.0 for Visual Studio Community 2022 on Windows 10.  Uninstalled VC 2.3 and VS 2015 first.  Also, installed Update 9 of Visual Cobol and  VS 2022 v 17.7.2.  Made copies of all projects and changed the Target framework from .NET Framework 4.5.2 to 4.6.2 in all projects, because 4.5.2 is no longer supported.  Application is a Windows forms app. 

There are now some problems with version 8.0:

1. Accessing properties/methods on data items defined in another .cbl (eg objects on a form where the objects are instantiated in the .designer.cbl) the data item is coloured differently in the editor

In V2.3:

set litem-butt-amend::Enabled to false

In V8.0

set litem-butt-amend::Enabled to false

In V8.0 the data item shows as green.  This does not happen in the .designer.cbl.  I cannot find a setting in Fonts and Colors to fix this.

2. Getting error when reading from a static dictionary defined in another class.

In class that defines dictionary object:

class-id ClassColors.estats.

01 color-norm type Color public static property as "color-norm" value type SystemColors::ControlText.
01 color-new type Color public static property as "color-new" value type Color::LimeGreen.
01 color-left type Color public static property as "color-left" value type Color::Red.
01 color-hol type Color public static property as "color-hol" value type Color::FromArgb(128, 224, 255).
01 color-hold type Color public static property as "color-hold" value type Color::FromArgb(255, 192, 0).
01 color-dec type Color public static property as "color-dec" value type Color::Black.

01 dic-color public static property dictionary [string type Color].

method-id estat-colors static.
procedure division.

create dic-color.

write dic-color from color-norm key "N" *>> Black
write dic-color from color-norm key "P" *>> Black
write dic-color from color-new key "Y" *>> Green
write dic-color from color-left key "L" *>> Red
write dic-color from color-left key "T" *>> Red
write dic-color from color-hol key "H" *>> Blue
write dic-color from color-hold key "U" *>> Orange
write dic-color from color-dec key "D" *>> Black

goback.
end method.

In Windows forms class I call the method above:

invoke type spaye::stat-colors

Later I read the dictionary:

read type ClassColors.spaye::dic-color into color-stat key LI-STATUS

color-stat is type Color and LI-STATUS is PIC X.

I am getting an error on this line "COBCH0013: User-name required".  This does not happen in V2.3  Otherwise, there seem to be no build errors in V8.0 projects.

3. (Erroneous) Errors with Office Interop objects.  We have a number of programs where we convert csv files to Excel.  Putting the directives

$set ilusing "Microsoft.Office.Interop.Excel"
$set ilref "Microsoft.Office.Interop.Excel"
$set ilusing "System.Runtime.InteropServices"

at the top of the program was sufficient in V2.3 to access the interop objects.  No need to add Microsoft.Office.Interop.Excel as a Reference or namespace.

In V8.0 we are getting COBCH0845 unknown type errors, eg on the lines:

01 ExcelObject type Microsoft.Office.Interop.Excel.Application.
01 WorkBooksCollection type Workbooks.

and

set ExcelObject to new type Microsoft.Office.Interop.Excel.Application

or at least that is what the editor says!  The program builds successfully and the errors disappear.  Then close the program and open it again and the error come back, or even just scroll through the program and the errors come back.  Adding Microsoft.Office.Interop.Excel.Application as a Reference or imported namespace and the errors disappear completely.  So the errors appear to be somewhat erroneous, but disconcerting.

4. Background Tasks in VS.  Bottom left hand corner of Visual Studio is shows a constant icon saying it is indexing the files in the project directory.  After googling I found the deleting the file Indexing.servicehub.service.json stopped the service but does not remove the icon or give the impression that the service has stopped.  I appreciate this is likely as Visual Studio issue.

I appreciate any help on these issues.

Regards

Brendan

Hi Brendan,

In order to investigate these types of problems you are reporting they really need to be opened as cases with Customer Support with each individual problem being opened as a separate case. We can then test them and hopefully provide a workaround or alternatively we can report them to Development.

Thanks


Hi Brendan,

In order to investigate these types of problems you are reporting they really need to be opened as cases with Customer Support with each individual problem being opened as a separate case. We can then test them and hopefully provide a workaround or alternatively we can report them to Development.

Thanks

Hi Chris

Thanks.  I have now created separate cases for each of the issues.

Please note, I had to specify Case Type: Non Technical Enquiry for each.  Selecting Technical Issue meant I could go no further.  Also, there is never an option to select Product, Reported Version, Entitlement, etc, when creating a case, all those lists are empty (and only available for Licensing issues).  Perhaps I was doing something wrong.

Regards

Brendan