Highlighted
Outstanding Contributor.
Outstanding Contributor.
197 views

netxmapi examples tested with visual Cobol 5.0

i wanted test the email sending on visual Cobol. I know at the base the example was written in netexpress 5.x

I missed MF-Copy files as:

commdlg.cpy

mfres.cpy

miniwin.cpy

wingdi.cpy

wintypes.cpy (in MF-Files fail the Definition of lphandle)

winuser.cpy

Are there other files to be placed in source programs?

Using the netexpress copy files in visual Cobol gives any error on the Syntax!

I can posted this in a separate message!

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: netxmapi examples tested with visual Cobol 5.0

You can use the Net Express copybooks in Visual COBOL but you will have to add the following directive to the project:

REMOVE"OBJECT-REFERENCE"

This is a new reserved word in VC and later versions of NX so it cannot be used as a data-name. The REMOVE directive removes it from the reserved word list.

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: netxmapi examples tested with visual Cobol 5.0

Chris, thanks for the remove directive.
The netxmapi have never work correctly, there are too much bugs in the program, null terminate must be done on the fields (also filename for attachments) and not on the first space. There is not possible to use many recipients (to), not cc and not Bcc.
Sorry to publish this in the Forum and we hope a Little bit more help and examples that works! This program don't work with the latest Version of netexpress 5.1 as you have inform us. Please send us or publish the working Version/Project! Thanks
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: netxmapi examples tested with visual Cobol 5.0

In the opening comments in the email.cbl program it clearly states the following:

     "The demonstration consists of a simple GUI e-mail application which can be used to send e-mails with attachments. It is intended to be a demonstration only and not a fully functional application. "

This is a demo and not an email application that you can tailor to your own needs. It is not even distributed with the products. You are expected to take this as an example when writing your own application.

This demo was written in 1998 by one of our developers. I updated it slightly in 2001.
It works perfectly for me with the exception that the CC field was never implemented.

The fields are being null terminated correctly. It is not placing a NULL in the first space but it is placing a NULL in the space following the last character of each field. It uses reference modification to test when the rest of the field = spaces:
         perform varying wx-sub1 from 1 by 1
              until wx-sub1 > length of wl-profile-name
              if wl-profile-name(wx-sub1:) = spaces
                    move x"00" to wl-profile-name(wx-sub1:1)
                    exit perform
               end-if
           end-perform 

I took about 10 minutes here and implemented the CC field functionality for you. I am attaching the 2 files that were changed. That is all that I intend to do with this example. 

Perhaps somebody else has a different example that they can share with you.

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: netxmapi examples tested with visual Cobol 5.0

i will test your program tomorrow, but the mail-to, mail-cc, mail-bcc, mail-subject, mail-text and attachment must be x'00' terminated. You Routine copied from the example do only a x'00' on the first spaces and Exit. I have debug the example and found any thick bugs and have completed and corrected the program. The only Point to solve is the attachment(s)
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: netxmapi examples tested with visual Cobol 5.0

Chris, you example allow to send only to "mail-to" or to "mail-bc". It is and must be possible to send one message with on Windows with many recipients for "Mail-To", many recipients for "Mail-BC" and many recipients for "Mail-BCC", and also many attachments, in the example it was limited to 10. This program crashes only with 1 attachments. Mail-BCC is value 3.

Mail-to: abc@def.de; def@abc.de; xyz@microfocus.comx'00'
Mail-BC: abc@microfocus.com; Chris@mf.com;cg@web.dex'00'
Mail-BCC: Tom@jerry.com; michi@disneyland.frx'00'
Subject: this is a test messagex'00'
Message text: i have send a test message to any mail-to addresses, any mail-bc addresses, mail-bcc addresses and any attachments.x'00'
attachments:
this is a ASCII-file.asc
this is a cs-file.csv
this is a word-file.docx
this is a Excel-file.xlsx

I have include with a new keyin field the bcc
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.