Status of source code changes suggested in November 2014

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Status of source code changes suggested in November 2014

Post by kcarmody »

In November 2014, I proposed the source code changes listed below. Following Claudio's directions, I submitted them via a forum posting, viewtopic.php?f=43&t=4071&start=10

These changes included a revised rich edit demo, in which I used all of the other changes I proposed, except for the SelPasteSpecial method. I used the rich edit demo to thoroughly test all these other changes, and I was satisfied that they all worked properly when I submitted them. You can download the compiled exe of this demo from http://kevincarmody.com/hmg/SAMPLES/Con ... x/demo.exe

Now I have found that almost none of these changes are present in the current version of HMG, 3.4.1. The rich edit demo has been returned to the 3.3.1 version, and all of the other changes I proposed, except for the justification bug fix, have also been ignored.

After some months away from HMG, I downloaded version 3.4.1 in July and again in September. I found numerous differences in the source code between these two downloads, especially with regard to my proposals, so many that they are effectively two different versions. In the following discussion, I will call the July version 3.4.1a and the September version 3.4.1b.

The proposals I made last November were changes to version 3.3.1. I will call my proposals version 3.3.1k.

I found that 3.4.1a had all the changes from 3.3.1k for .prg and .c files in the SOURCE directory, but none of the changes from 3.3.1k for the .ch files in the INCLUDE directory. This meant that none of the new properties and methods in 3.3.1k were accessible, and this in turn meant that the 3.3.1k rich edit demo would not compile in 3.4.1a.

The 3.4.1a rich edit demo thus had to have some changes from 3.3.1k version. One change that someone made (I don't know who) was to completely rewrite the ReadFile and WriteFile functions. Unfortunately, these rewrites were very buggy, so the 3.4.1a rich edit demo did not correctly both read and write any format of Unicode text file -- for every Unicode text file format, the demo either misread the file or miswrote the file.

In version 3.4.1b, all of the changes in 3.3.1k that were in 3.4.1a were removed, except for the justification bug fix. The 3.4.1b rich edit demo has been reverted to the 3.3.1 version. Thus the several weeks of work I did developing, testing, and documenting version 3.3.1k, including the heavy modifications of the rich edit demo, have been discarded.

It appears to me that there was some attempt to incorportate these changes into 3.4.1, but unfortunately whoever did this used only the changes I propsed to the .prg and .c files, while ignoring the changes I proposed to the .ch files. I am confident that using all of the changes I proposed will work properly, since I thoroughly tested them in the rich edit demo.

I am willing to redevelop my proposal as a set of changes to 3.4.1, but I would first like some assurance that this proposal will not be ignored.

Below is a detailed list of source code changes in my previous proposal and their disposal in 3.4.1.

Version numbers used below
  3.3.1k - enhancements I suggested for 3.3.1 in November 2014
  3.4.1a - official HMG version 3.4.1 that I downloaded in July 2015
  3.4.1b - official HMG version 3.4.1 that I downloaded in September 2015

New function GetRtfTxtFileType( cFile, lUtf8Test ) --> nFileType
Returns file type which can be used in RtfTxtLoadFile and RtfTxtSaveFile methods of RichEditBox control
  SOURCE\h_richeditbox.prg
    3.3.1k lines 508-576
    3.4.1a lines 508-576
    3.4.1b missing

New function Utf16ByteSwap( cInFile, cOutFile )
Supports UTF-16 BE (big endian) file type for RtfTxtLoadFile and RtfTxtSaveFile methods of RichEditBox control
  SOURCE\h_richeditbox.prg
    3.3.1k lines 579-621
    3.4.1a lines 579-621
    3.4.1b missing

New manifest constants RTFTXTFILE_ANSI etc.
RTF and TXT file types returned by GetRtfTxtFileType()
Can be used by RtfTxtLoadFile and RtfTxtSaveFile methods of RichEditBox control
  INCLUDE\i_richeditbox.ch
    3.3.1k lines 159-169
    3.4.1a missing
    3.4.1b missing

Fixed rich edit justification bug
viewtopic.php?f=20&t=3995
  SOURCE\c_richeditbox.c - InitRichEditBox()
    3.3.1k line 185
    3.4.1a line 185
    3.4.1b line 140

Fixed RichEditBox_StreamIn( hWndControl, cFileName, lSelection, nDataFormat ) --> lSuccess
Skips over BOM in text files if present
  SOURCE\c_richeditbox.c
    3.3.1k lines 226-291
    3.4.1a lines 226-291
    3.4.1b missing

Fixed RichEditBox_StreamOut( hWndControl, cFileName, lSelection, nDataFormat ) --> lSuccess
Writes BOM to text files
  SOURCE\c_richeditbox.c
    3.3.1k lines 305-360
    3.4.1a lines 305-360
    3.4.1b missing

Enhanced rich edit method RtfLoadFile( cFile, lSelection, nType ) --> lSuccess
Uses file type returned by GetRtfTxtFileType()
Skips over byte order mark in Unicode text file
Supports UTF-16 BE (big endian Unicode text file)
  SOURCE\h_controlmisc.prg
    3.3.1k lines 9468-9469
    3.4.1a lines 9468-9469
    3.4.1b missing
Calls new function RichEditBox_RtfTxtLoadFile()
  SOURCE\h_richeditbox.prg
    3.3.1k lines 441-475
    3.4.1a lines 441-475
    3.4.1b missing

Enhanced rich edit method RtfSaveFile( cFile, lSelection, nType ) --> lSuccess
Uses file type returned by GetRtfTxtFileType()
Writes byte order mark to Unicode text file
Supports UTF-16 BE (big endian Unicode text file)
  SOURCE\h_controlmisc.prg
    3.3.1k lines 9473-9474
    3.4.1a lines 9473-9474
    3.4.1b missing
Calls new function RichEditBox_RtfTxtSaveFile()
  SOURCE\h_richeditbox.prg
    3.3.1k lines 478-505
    3.4.1a lines 478-505
    3.4.1b missing

New rich edit method RtfTxtLoadFile( cFile, lSelection, nType ) --> lSuccess
Synonym for RtfLoadFile method
  SOURCE\h_controlmisc.prg
    3.3.1k line 9468
    3.4.1a line 9468
    3.4.1b missing
  INCLUDE\i_window.ch
    3.3.1k lines 162-163, 165
    3.4.1a missing
    3.4.1b missing

New rich edit method RtfTxtSaveFile( cFile, lSelection, nType ) --> lSuccess
Synonym for RtfSaveFile
  SOURCE\h_controlmisc.prg
    3.3.1k line 9473
    3.4.1a line 9473
    3.4.1b missing
  INCLUDE\i_window.ch
    3.3.1k lines 162-163, 165
    3.4.1a missing
    3.4.1b missing

New rich edit property HasUnicodeChars (read only)
Detects whether rich edit control contains non-ASCII Unicode characters
  SOURCE\h_controlmisc.prg
    3.3.1k lines 9293-9296
    3.4.1a lines 9293-9296
    3.4.1b missing
  INCLUDE\i_window.ch
    3.3.1k line 154
    3.4.1a missing
    3.4.1b missing
Calls new function RichEditBox_HasUnicodeChars()
  SOURCE\h_richeditbox.prg
    3.3.1k lines 414-438
    3.4.1a lines 414-438
    3.4.1b missing

New rich edit method SelPasteSpecial
Paste special -- needs documentation of clipboard format argument
  SOURCE\h_controlmisc.prg
    3.3.1k lines 9486-9488
    3.4.1a lines 9486-9488
    3.4.1b missing
  INCLUDE\i_window.ch
    3.3.1k line 169
    3.4.1a missing
    3.4.1b missing

Enhanced function GetFile( [aFilter], [cTitle], [cIniFolder], [lMultiSelect], [lNoChangeDir], [nFilterIndex] ) --> cFileName | aFileNames | NIL
viewtopic.php?f=8&t=4009
Added nFilterIndex to control default file filter
  SOURCE\c_dialogs.c
    3.3.1k lines 174, 189-190, 222
    3.4.1a lines 174, 189-190, 222
    3.4.1b missing
  SOURCE\h_dialogs.prg
    3.3.1k lines 94, 124-126, 130, 133
    3.4.1a lines 94, 124-126, 130, 133
    3.4.1b lines 93, missing, 123, 125

Enhanced function Putfile( [aFilter], [cTitle], [cIniFolder], [lNoChangeDir], [cDefaultFileName], [cExtFile], [nFilterIndex] ) --> cFileName | NIL
viewtopic.php?f=8&t=4009
Added nFilterInddex to control default file filter
If passed by reference, nFilterIndex returns index of file filter selected by user
  SOURCE\c_dialogs.c
    3.3.1k lines 269, 277-280, 312, 328-331
    3.4.1a lines 269, 277-280, 312, 328-331
    3.4.1b missing
  SOURCE\h_dialogs.prg
    3.3.1k lines 155, 176-178, 186
    3.4.1a lines 155, 176-178, 186
    3.4.1b lines 146, missing, 171

Enhanced function DoMethod ( Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9 )
Enabled it to return value from RichEditBox method
  SOURCE\h_controlmisc.prg
    3.3.1k lines 7944, 7956-7958, 9445
    3.4.1a lines 7944, 7956-7958, 9445
    3.4.1b missing

Overhauled Rich Edit Demo
viewtopic.php?f=9&t=4030
New features
  Main menu
  List of recently used files
  Resizable windows
  Ctrl-B, Ctrl-I, Ctrl-U supported
  File name in title, file name and page in status bar
  Modified flag, caps lock, num lock, insert status on status bar
  Window size, font name and size, file locations, file filters, recently used file names stored in registry
  Paragraph numbering
  Read and write text files
  Many other enhancements
Uses enhancements described above
  GetFile function
  PutFile function
  GetRtfTxtFileType function
  RtfTxtLoadFile method
  RtfTxtSaveFile method
  HasUnicodeChars property
  justification bug fix
  These in turn use all of the other enhancements described above (except for SelPasteSpecial)
Source
  3.3.1
    SAMPLES\Controls\RichEditBox\demo.prg
    SAMPLES\Controls\RichEditBox\demo.rc
    SAMPLES\Controls\RichEditBox\FilesRes\*.*
  3.3.1k
    SAMPLES\Controls\RichEditBox\demo.prg
    SAMPLES\Controls\RichEditBox\demo.rc
    SAMPLES\Controls\RichEditBox\Res\*.*
      heavily modified from 3.3.1
  3.4.1a
    SAMPLES\Controls\RichEditBox\demo.prg
    SAMPLES\Controls\RichEditBox\demo.rc
    SAMPLES\Controls\RichEditBox\Res\*.*
      much the same as 3.3.1k, but bugs introduced in modified portions
  3.4.1b
    SAMPLES\Controls\RichEditBox\demo.prg
    SAMPLES\Controls\RichEditBox\demo.rc
    SAMPLES\Controls\RichEditBox\FilesRes\*.*
      identical to 3.3.1
Carlos Britos
Posts: 245
Joined: Sat Aug 02, 2008 5:03 pm

Re: Status of source code changes suggested in November 2014

Post by Carlos Britos »

Maybe is a false positive, but Avast report infection DRep and the file Demo.exe is deleted
Regards/Saludos, Carlos (bcd12a)
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Status of source code changes suggested in November 2014

Post by srvet_claudio »

Hi Kevin,
thanks for reminding me, these suggestions are noted on my to-do list.
They were still not implemented these changes because I have focused on other aspects that I has seemed more priority.

These changes are implemented in all patches of HMG.3.4.1
kcarmody wrote: Enhanced function GetFile( [aFilter], [cTitle], [cIniFolder], [lMultiSelect], [lNoChangeDir], [nFilterIndex] ) --> cFileName | aFileNames | NIL
Added nFilterIndex to control default file filter

Enhanced function Putfile( [aFilter], [cTitle], [cIniFolder], [lNoChangeDir], [cDefaultFileName], [cExtFile], [nFilterIndex] ) --> cFileName | NIL
Added nFilterInddex to control default file filter
If passed by reference, nFilterIndex returns index of file filter selected by user
I think these suggestions not missing because I never implemented in HMG.
kcarmody wrote: New function GetRtfTxtFileType( cFile, lUtf8Test ) --> nFileType
New function Utf16ByteSwap( cInFile, cOutFile )
Supports UTF-16 BE (big endian) file type for RtfTxtLoadFile and RtfTxtSaveFile methods of RichEditBox control
  SOURCE\h_richeditbox.prg
    3.3.1k lines 579-621
    3.4.1a lines 579-621
    3.4.1b missing

New manifest constants RTFTXTFILE_ANSI etc.
RTF and TXT file types returned by GetRtfTxtFileType()
Can be used by RtfTxtLoadFile and RtfTxtSaveFile methods of RichEditBox control
  INCLUDE\i_richeditbox.ch
    3.3.1k lines 159-169
    3.4.1a missing
    3.4.1b missing

Fixed rich edit justification bug
viewtopic.php?f=20&t=3995
  SOURCE\c_richeditbox.c - InitRichEditBox()
    3.3.1k line 185
    3.4.1a line 185
    3.4.1b line 140

Fixed RichEditBox_StreamIn( hWndControl, cFileName, lSelection, nDataFormat ) --> lSuccess
Skips over BOM in text files if present
  SOURCE\c_richeditbox.c
    3.3.1k lines 226-291
    3.4.1a lines 226-291
    3.4.1b missing

Fixed RichEditBox_StreamOut( hWndControl, cFileName, lSelection, nDataFormat ) --> lSuccess
Writes BOM to text files
  SOURCE\c_richeditbox.c
    3.3.1k lines 305-360
    3.4.1a lines 305-360
    3.4.1b missing

Enhanced rich edit method RtfLoadFile( cFile, lSelection, nType ) --> lSuccess
Uses file type returned by GetRtfTxtFileType()
Skips over byte order mark in Unicode text file
Supports UTF-16 BE (big endian Unicode text file)
  SOURCE\h_controlmisc.prg
    3.3.1k lines 9468-9469
    3.4.1a lines 9468-9469
    3.4.1b missing
Calls new function RichEditBox_RtfTxtLoadFile()
  SOURCE\h_richeditbox.prg
    3.3.1k lines 441-475
    3.4.1a lines 441-475
    3.4.1b missing

Enhanced rich edit method RtfSaveFile( cFile, lSelection, nType ) --> lSuccess
Uses file type returned by GetRtfTxtFileType()
Writes byte order mark to Unicode text file
Supports UTF-16 BE (big endian Unicode text file)
  SOURCE\h_controlmisc.prg
    3.3.1k lines 9473-9474
    3.4.1a lines 9473-9474
    3.4.1b missing
Calls new function RichEditBox_RtfTxtSaveFile()
  SOURCE\h_richeditbox.prg
    3.3.1k lines 478-505
    3.4.1a lines 478-505
    3.4.1b missing

New rich edit method RtfTxtLoadFile( cFile, lSelection, nType ) --> lSuccess
Synonym for RtfLoadFile method
  SOURCE\h_controlmisc.prg
    3.3.1k line 9468
    3.4.1a line 9468
    3.4.1b missing
  INCLUDE\i_window.ch
    3.3.1k lines 162-163, 165
    3.4.1a missing
    3.4.1b missing

New rich edit method RtfTxtSaveFile( cFile, lSelection, nType ) --> lSuccess
Synonym for RtfSaveFile
  SOURCE\h_controlmisc.prg
    3.3.1k line 9473
    3.4.1a line 9473
    3.4.1b missing
  INCLUDE\i_window.ch
    3.3.1k lines 162-163, 165
    3.4.1a missing
    3.4.1b missing

New rich edit property HasUnicodeChars (read only)
Detects whether rich edit control contains non-ASCII Unicode characters
  SOURCE\h_controlmisc.prg
    3.3.1k lines 9293-9296
    3.4.1a lines 9293-9296
    3.4.1b missing
  INCLUDE\i_window.ch
    3.3.1k line 154
    3.4.1a missing
    3.4.1b missing
Calls new function RichEditBox_HasUnicodeChars()
  SOURCE\h_richeditbox.prg
    3.3.1k lines 414-438
    3.4.1a lines 414-438
    3.4.1b missing

New rich edit method SelPasteSpecial
Paste special -- needs documentation of clipboard format argument
  SOURCE\h_controlmisc.prg
    3.3.1k lines 9486-9488
    3.4.1a lines 9486-9488
    3.4.1b missing
  INCLUDE\i_window.ch
    3.3.1k line 169
    3.4.1a missing
    3.4.1b missing
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Re: Status of source code changes suggested in November 2014

Post by kcarmody »

Carlos Britos wrote:Maybe is a false positive, but Avast report infection DRep and the file Demo.exe is deleted
I think it must be a false positive. I have run this demo since last November. AVG has never reported a problem with it, and I have never seen any symptoms of any problems. It is constructed from a modified version of HMG, with all modified source code in the folders around it.
User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Re: Status of source code changes suggested in November 2014

Post by kcarmody »

srvet_claudio wrote:I think these suggestions not missing because I never implemented in HMG.
kcarmody wrote: New function GetRtfTxtFileType( cFile, lUtf8Test ) --> nFileType
New function Utf16ByteSwap( cInFile, cOutFile )
Supports UTF-16 BE (big endian) file type for RtfTxtLoadFile and RtfTxtSaveFile methods of RichEditBox control
  SOURCE\h_richeditbox.prg
    3.3.1k lines 579-621
    3.4.1a lines 579-621
    3.4.1b missing
...
Someone implemented them in HMG for a while. All the changes marked 3.4.1a were part of the 3.4.1 release in July, but were removed from the release version some time after that, and those are marked 3.4.1b.

You did not mention the rich edit demo. As I said, my version of the rich edit demo (version 3.3.1k) was modified and put into HMG in July (version 3.4.1a), but this version was buggy and unusable for text files. After that (version 3.4.1b), the rich edit demo was reset to the form it was in 3.3.1.
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Status of source code changes suggested in November 2014

Post by srvet_claudio »

kcarmody wrote:
srvet_claudio wrote:I think these suggestions not missing because I never implemented in HMG.
kcarmody wrote: New function GetRtfTxtFileType( cFile, lUtf8Test ) --> nFileType
New function Utf16ByteSwap( cInFile, cOutFile )
Supports UTF-16 BE (big endian) file type for RtfTxtLoadFile and RtfTxtSaveFile methods of RichEditBox control
  SOURCE\h_richeditbox.prg
    3.3.1k lines 579-621
    3.4.1a lines 579-621
    3.4.1b missing
...
Someone implemented them in HMG for a while. All the changes marked 3.4.1a were part of the 3.4.1 release in July, but were removed from the release version some time after that, and those are marked 3.4.1b.

You did not mention the rich edit demo. As I said, my version of the rich edit demo (version 3.3.1k) was modified and put into HMG in July (version 3.4.1a), but this version was buggy and unusable for text files. After that (version 3.4.1b), the rich edit demo was reset to the form it was in 3.3.1.
Maybe I copied your files into the source folder of HMG and not checked, honestly I don't remember, I think I'm getting old.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Status of source code changes suggested in November 2014

Post by bpd2000 »

kcarmody wrote:
Carlos Britos wrote:Maybe is a false positive, but Avast report infection DRep and the file Demo.exe is deleted
I think it must be a false positive. I have run this demo since last November. AVG has never reported a problem with it, and I have never seen any symptoms of any problems. It is constructed from a modified version of HMG, with all modified source code in the folders around it.
My antivirus Symantec found risk Quarined Demo.exe
Attachments
untitled.PNG
untitled.PNG (66.29 KiB) Viewed 9994 times
BPD
Convert Dream into Reality through HMG
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Status of source code changes suggested in November 2014

Post by andyglezl »

Hola kcarmody
El AVIRA tambien me detecto algo y lo borró.

Me he dado cuenta que el utilizar el "UPX.EXE" para empacar los *.exe,
los antivirus detectan algo, pero si estamos seguros de que no hay peligro,
podemos restaurarlo de la cuarentena. ( yo no se, si sea el caso de kcarmody )
--------------------------------------------------------------------------------------------
Hello kcarmody
AVIRA I also found something and deleted it.

I've noticed that using the "UPX.EXE" to pack the * .exe,
antivirus detected something, but if we are sure it is safe,
We can restore it from quarantine. (I do not know if the case of kcarmody)
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Re: Status of source code changes suggested in November 2014

Post by kcarmody »

bpd2000 wrote:
kcarmody wrote:
Carlos Britos wrote:Maybe is a false positive, but Avast report infection DRep and the file Demo.exe is deleted
I think it must be a false positive. I have run this demo since last November. AVG has never reported a problem with it, and I have never seen any symptoms of any problems. It is constructed from a modified version of HMG, with all modified source code in the folders around it.
My antivirus Symantec found risk Quarined Demo.exe
The executable I posted is made from a lightly modified version of HMG. If it has a virus, then other HMG executables may also have viruses. Have you tried running this antivirus program on other HMG executables? I have AVG, which has protected me well against viruses in the past, and it has never complained about this executable.
User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Re: Status of source code changes suggested in November 2014

Post by kcarmody »

andyglezl wrote:Hola kcarmody
El AVIRA tambien me detecto algo y lo borró.

Me he dado cuenta que el utilizar el "UPX.EXE" para empacar los *.exe,
los antivirus detectan algo, pero si estamos seguros de que no hay peligro,
podemos restaurarlo de la cuarentena. ( yo no se, si sea el caso de kcarmody )
--------------------------------------------------------------------------------------------
Hello kcarmody
AVIRA I also found something and deleted it.

I've noticed that using the "UPX.EXE" to pack the * .exe,
antivirus detected something, but if we are sure it is safe,
We can restore it from quarantine. (I do not know if the case of kcarmody)
Did the antivirus detect a problem with UPX.exe or with demo.exe? I have AVG antivirus, and it has never said there was a problem with demo.exe. If your antivirus programs say there is a problem with demo.exe, then perhaps you should check executables from other HMG samples, since demo.exe is created from a lightly modified version of HMG.
Post Reply