Jump to content



Recommended Posts

  • Replies 96
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I can't get it to work from the source code - I get this:

==> Can not redeclare a constant.:

Global Const $ILC_MASK = 0x0001

I have searched in the include files and found that $ILC_MASK exists in:




I don't have the skill to fix it - has anybody got BetaPad v. 3.0 source code working using Autoit v3.2.10.0?

It seems an excellent rich text editor.

Ta :)

Edit - looks like some global variables need to be commented out in ModernMenu.au3 (this is a part of BetaPad) because the variables are now declared in Autoit v3.2.10.0 standard includes.

And, some function names have changed in GuiStatusBar.au3.

I sort of have it working, but a spurious input box appears in the top right-hand corner. If I can fix it I'll post the modifications, but I'm not really sure what I'm doing.

Edited by ToyleY
Link to comment
Share on other sites

ToyleY: "I don't have Microsoft office installed - how come the rich text stuff works?"


could you look please (only if you want to and have time ....) and try to find out which

of your applications could have installed "rich edit"?

I would then try to find out the "minimum" files that are needed to get BetaPad to work?

(comparing it with what ms office installs)

thanks (if not, doesn't matter)


Edited by grham
Link to comment
Share on other sites

grham - I installed Open Office (but I had MS Office on my comp before that and uninstalled it).

I don't know what the absolute minimum is to be able to use rich text formatting - I would like to know as well, and also if rtf is copyrighted etc.

EDIT - found out something

"Rich Text Controls are implemented by a DLL file in the Windows System32 folder. The filename varies depending on the version used."

riched32.dll (version 1) = Windows 95

riched20.dll (version 2) = Windows 98

riched20.dll (version 3) = Windows ME / 2000 / XP

msftedit.dll (version 4.1) = Windows XP SP1 / SP2 (latest version)

richtx32.ocx - activeX stuff ?

(I'm not sure about Vista but the Web says:- )

msftedit.dll (version 4.1) = Windows Vista (msftedit.dll release

On my Comp I have: (but some of it might be redundant trash [hello mum])

riched32.dll (version 1) = Windows 95 (only 4k but it's a wrapper Dll for Richedit 1.0)

riched20.dll (version 3) = Windows ME / 2000 / XP (424k)

msftedit.dll (version 4.1) = Windows XP SP1 / SP2 (latest version) (540k)

richtx32.ocx (version - activeX stuff ? (208k)

Edited by ToyleY
Link to comment
Share on other sites

... we just couldn't get it to install richtext ...

I notice in the prog it has the line:

$GUIActiveX = GUICtrlCreateObj($DocEd1, 10, 70)

Which means (I think) it uses richtx32.ocx (ActiveX control) to do all the parsing etc.

Anyway, I used RegSvr32.exe /n richtx32.ocx in a batch file to deregister richtx32.ocx, and BetaPad fell over (no rtf control). Then I registered it again and BetaPad worked.

I'll have to do a clean install of Windows on an old HD or a memory card to play around with installing and registering these rtf control files -

riched32.dll (version 1)

riched20.dll (version 3)

msftedit.dll (version 4.1)

richtx32.ocx (version

(I think all of them are needed for Windows XP and maybe Vista)

and see if it works out :)

Edited by ToyleY
Link to comment
Share on other sites

Did a bit of work on it -

1. status bar now shows on start up

2. dumped the search

3. dumped speech

4. got rid of line artefact when opening file (that brings up scroll bar)

5. re-enabled drag and drop

6. got printing working OK - just used this (the MS viewer):

$printProg = "C:\Program Files\Microsoft Office\OFFICE11\WORDVIEW.EXE " ; printing prog and path

$printFile = "test.rtf" ; name of file to print

$WorkingDir = "C:\Documents and Settings\User\My Documents" ; directory where file to print resides

$CommandLine = $printProg & $printFile ; make the command line

run($CommandLine, $WorkingDir, @SW_MAXIMIZE) ; run the print program

$PrintWinName = $printFile & " - Microsoft Word Viewer" ; build the print window name

WinWaitActive($PrintWinName) ; wait till print program is active

Send("!f") ; send 'Alt+f' to print program to bring up print prog menu

sleep(10) ; allow for slowness

Send("p") ; send 'p' to print program to bring up print dialogue

7. Enabled EM_AUTOURLDETECT so hyper-links are properly under-lined / colour change, cursor changes to hand etc. (this needs some work in main loop to make hyper-link do stuff [open mail] web page etc. - looking for EN_LINK I think and then shell to default browser).

Global Const $EM_AUTOURLDETECT = ($WM_USER + 91)


_SendMessage($rt_handle, $EM_AUTOURLDETECT, True, 0)

I'll fiddle about with it a bit to get picture handling working, and then post the code.

Edited by ToyleY
Link to comment
Share on other sites

  • 6 months later...


For those who wanted to print the TEXT and PICTURES too.

#include <GUIConstantsEx.au3>

; Initialize error handler 
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

Global $DocEd1 = ObjCreate("RICHTEXT.RichTextCtrl")

If Not IsObj ($textortf) And Not IsObj($commdlg1) then Exit

$hfile = FileOpenDialog("Open RTF File ...","", "Images (*.Rtf)", 1)
If $hfile = "" Then Exit



With $textortf
        .sellength= Number(stringlen(.textrtf))
ConsoleWrite($textoRTF.SelLength & @CRLF)

$CommDlg1.Flags = $cdlPDReturnDC + $cdlPDNoPageNums 
if $textoRTF.SelLength = 0 then
$CommDlg1.Flags = $CommDlg1.Flags + $cdlPDAllPages 
$CommDlg1.Flags = $CommDlg1.Flags + $cdlPDSelection 

If $CommDlg1.hdc < 0 Then Exit

;------------------------------ This is a COM Error handler --------------------------------
Func MyErrFunc()
  Msgbox(0,"COM Error Test","We intercepted a COM Error !"       & @CRLF  & @CRLF & _
             "err.description is: "    & @TAB & $oMyError.description    & @CRLF & _
             "err.windescription:"     & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "         & @TAB & $HexNumber              & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "     & @TAB & $oMyError.scriptline     & @CRLF & _
             "err.source is: "         & @TAB & $oMyError.source         & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile       & @CRLF & _
             "err.helpcontext is: "    & @TAB & $oMyError.helpcontext _
  SetError(1)  ; to check for after this function returns

Enjoy !!



Link to comment
Share on other sites

  • 1 month later...
  • 5 years later...

I can't get betapad to compile:

autoitBetaPadBetaPad.au3 (78) : ==> Variable used without being declared.:
$BetaPad = GUICreate("", 735, 600, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX))
$BetaPad = GUICreate("", 735, 600, -1, -1, BitOR(^ ERROR
>Exit code: 1    Time: 0.467
Link to comment
Share on other sites

  • Moderators


As the code dates from 6 years ago there are probably many things which prevent it from compiling with new versions of AutoIt. In this case I think it will be missing #include files - around that time the original huge files were split into many smaller ones to keep the code reasonably sized. :)

I suggest you work through the errors and add the missing files. The function here is GUICreate - look at possible parameters in the Help file and follow the link to "GUI Control Styles Appendix". There you will see that you need the WindowsConstants.au3 include file to get the $GUI_SS_DEFAULT_GUI constant. Do the same sort of thing for each error that is signalled and you will finally get the script to compile - and learn a lot about AutoIt while doing it. ;)


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:


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

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

  • Recently Browsing   0 members

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