Jump to content

_GUICtrlRichEdit_StreamFromFile


Recommended Posts

Please create smallest repro script which will fire this issue, and attach them here with yours SciTE console log.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

There is a bug in the in function or help file is incorrect.  Default encoding in the function is ANSI not UTF-8.  Make sure you specify the $FO_UTF8 encoding while reading file.

Link to comment
Share on other sites

Link to comment
Share on other sites

  • Moderators

mike1950r,

Quote

is there an option to log this crash?

Not really because it apparently works for everyone else. I have just tried the script and file and it loaded perfectly, so you would get a "Works for me" response to any Trac ticket.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

21 minutes ago, Melba23 said:

mike1950r,

Not really because it apparently works for everyone else. I have just tried the script and file and it loaded perfectly, so you would get a "Works for me" response to any Trac ticket.

M23

Hi,

i think you misunderstood me.

i ment, is there an option in autoit program to log the execution of scripts, so that you can find the problem.

cheers mike

Link to comment
Share on other sites

Are you running the latest "Release" version of AutoIt (3.3.14.5)?  If not, what version are you running?

Link to comment
Share on other sites

  • Moderators

mike1950r,

I did misunderstand - my apologies.

To log the script you can use ConsoleWrite from time to time if you run a script from within SciTE - or there is a Debug library in the standard includes, plus a number of other UDFs, you can use to write to a log file.

And I have compiled the script as x64 - still no problems.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

i think i found the reason:

the bug is not when using  GuiRichEdit.au3 version 3.3.14.5.

But i updated this lib to version 3.3.15.3.

This was because 3.3.14.5 has a bug , which did not make it possible to detect $WM_LBUTTONDBLCLK.

I googled this problem and someone wrote, that this was resoved with beta version 3.3.15.3.

And it was working when i updated the lib to this version.

My goodness 😕

Now $WM_LBUTTONDBLCLK is working and _GUICtrlRichEdit_StreamFromFile not.

I have the choice now, I mean loading from file is not very complicate, i can do this with my own procedure easily.

the doubleclick detection is essential for me.

May be the editor of GuiRichEdit.au3 can make an update, where both are working.

I attach this lib with another file, which is wanted from GuiRichEdit.au3 version 3.3.15.3

cheers and thanks for everybody.

mike

GuiRichEdit.au3 GuiCtrlInternals.au3

Link to comment
Share on other sites

  • Moderators

mike1950r,

Quote

This was because 3.3.14.5 has a bug , which did not make it possible to detect $WM_LBUTTONDBLCLK.

I googled this problem and someone wrote, that this was resoved with beta version 3.3.15.3.

Do you have a link to where this was discussed on the forum?

M23?

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Confirming the problem with beta version in x64.

But have found the bug.  In 3.3.14.5 the definition of the TAG is

Global Const $tagEDITSTREAM = "align 4;dword_ptr dwCookie;dword dwError;ptr pfnCallback"

While in beta 3.3.15.3, it is 

Global Const $tagEDITSTREAM = "struct;dword_ptr dwCookie;dword dwError;ptr pfnCallback;endstruct"

Which in 64 bits is misaligning the structure.  It needs to be align as 32bits.

Just change the definition of the tag in the 3.3.15.3 UDF file to the correct one and it should work.

Link to comment
Share on other sites

29 minutes ago, Nine said:

Confirming the problem with beta version in x64.

But have found the bug.  In 3.3.14.5 the definition of the TAG is

Global Const $tagEDITSTREAM = "align 4;dword_ptr dwCookie;dword dwError;ptr pfnCallback"

While in beta 3.3.15.3, it is 

Global Const $tagEDITSTREAM = "struct;dword_ptr dwCookie;dword dwError;ptr pfnCallback;endstruct"

Which in 64 bits is misaligning the structure.  It needs to be align as 32bits.

Just change the definition of the tag in the 3.3.15.3 UDF file to the correct one and it should work.

Yes indeed,

changing this line resolves the problem.

Great, should be passed to the editor of the lib.

thank you.

cheers mike

Link to comment
Share on other sites

1 hour ago, Melba23 said:

mike1950r,

Do you have a link to where this was discussed on the forum?

M23?

i was looking in my saved links,

but i just found the link afterwards, where the beta update could be downloaded.

it resolved the problem of the procedure to detect the double click.

--------------------------------------------------------------------------------------------------------------------------------------

_GUICtrlRichEdit_SetEventMask($hRichEdit, $ENM_MOUSEEVENTS)

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")


Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    Local $hWndFrom, $iCode, $tMsgFilter, $tNMHDR

    #forceref $hWnd, $iMsg, $wParam

    $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iCode = DllStructGetData($tNMHDR, "Code")

    Switch $hWndFrom
                Case $EN_MSGFILTER
                    $tMsgFilter = DllStructCreate($tagMSGFILTER, $lParam)

                    If DllStructGetData($tMsgFilter, "msg") = $WM_LBUTTONDBLCLK Then

                        DO SOMETHING !!!

                        Return 0
                    EndIf
            EndSwitch
    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

--------------------------------------------------------------------------------------------------------------------------------------

 

cheers mike

 

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...