Aapjuh 0 Posted April 29, 2022 Share Posted April 29, 2022 Hi again, Soooo... this is awkward.... i went through my code did a little cleaning and tidying up, switched and changed some stuff here and there... added other things... lo and behold it suddenly works fine... What was it you ask? well... its like... you know... i have no clue :P I even tried to break it again by commenting out new things and a few changes i did to revert them but it stays working. I'm happy tho :P Link to post Share on other sites
Aapjuh 0 Posted May 4, 2022 Share Posted May 4, 2022 (edited) I'm getting a: ; |2 - DLL call error - extended set as follows: ; |2 - SendMessage failure what does this mean? Error msgbox with the parameters and the 2 error codes $StringInfo = _StringSize($Talker_Name,$TempFontSize,$TempFontWeight,0,$TempFontType,$GuiWidth-$TempLabelSpacingH-12,$hGUI) Edit: GUISwitch($hGUI) prior to calling _StringSize seems to get around it Edited May 4, 2022 by Aapjuh Link to post Share on other sites
Moderators Melba23 3,789 Posted May 5, 2022 Author Moderators Share Posted May 5, 2022 Aapjuh, 18 hours ago, Aapjuh said: what does this mean? Exactly what it says - there was an error in the SendMessage call (which returns the current font) to the GUI you specified in the StringSize call. Using GUISwitch to get that particular GUI active would have been my suggestion, so I am delighted to see that doing so solved the problem! M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to post Share on other sites
Aapjuh 0 Posted May 5, 2022 Share Posted May 5, 2022 (edited) Me again Getting error 3 (|3 - Font too large for chosen max width - a word will not fit ) ; Check at least 1 word completed or return error This part in your code says it checks if 'at least 1 fits' but its actually 'if 1 word doesn't fit throw error' if i have a maxwidth of 50, and the string passed is "bla bla bla blaaaaaaaaaaaaaaaaa" even tho 'bla bla bla' each fit, there's 1 word that doesn't and it throws the error. it would be nice to wrap 'blaaaaaaaaaaaaaaaaa' like: bla bla bla b l a a a a a a a Reason im asking is because the program im making read chatlog and removes the usual system stuf like color codes and time stamps, but people in chat are prone to spam dramatic 'Noooooooooooo...!!' Edited May 5, 2022 by Aapjuh Link to post Share on other sites
Moderators Melba23 3,789 Posted May 5, 2022 Author Moderators Share Posted May 5, 2022 Aapjuh, Two possible solutions: 1. Increase the MaxWidth parameter - 50 is not very wide. 2. Preprocess your string so that you split words that are too long - here is a simple example based on your string above: #include <Array.au3> #include <StringSize.au3> $sText = "bla bla bla blaaaaaaaaaaaaaaaaa" $aSplit_1 = StringSplit($sText, " ") _ArrayDisplay($aSplit_1, "", Default, 8) For $i = 1 To $aSplit_1[0] $aRet = _StringSize($aSplit_1[$i]) If $aRet[2] > 50 Then $aSplit_2 = StringSplit($aSplit_1[$i], "") For $j = 1 To $aSplit_2[0] ConsoleWrite($aSplit_2[$j] & @CRLF) Next Else ConsoleWrite($aSplit_1[$i] & @CRLF) EndIf Next That gives you the result you require - but you have to do the work to split the overlong string. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to post Share on other sites
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now