Jump to content

objects crash ?


Busti
 Share

Recommended Posts

hi guys (and girls :P),

why does this code crash ?

; Author:   Kåre Johansson
; AutoIt Version: 3.1.1.55
; Description: Very Simple example: Embedding RICHTEXT object
; Needs: MSCOMCT2.OCX in system32 but it's probably already there
; Date: 3 jul 2005

#include <GUIConstants.au3>
$oRP = ObjCreate("RICHTEXT.RichtextCtrl.1")

GUICreate ( "Embedded RICHTEXT control Test", 320, 200, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS))
$TagsPageC = GuiCtrlCreateLabel('Visit Tags Page', 5, 180, 100, 15, $SS_CENTER)
GuiCtrlSetFont($TagsPageC,9,400,4)
GuiCtrlSetColor($TagsPageC,0x0000ff)
GuiCtrlSetCursor($TagsPageC,0)
$AboutC = GUICtrlCreateButton('About',105,177,70,20)
$PrefsC = GUICtrlCreateButton('FontSize',175,177,70,20)
$StatC = GUICtrlCreateButton('Plain Style',245,177,70,20)

$GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 400 , 260 )
GUICtrlSetPos($GUIActiveX,10,10,300,160)
$LinkoRP = ObjEvent($oRP,"IEEvent_","FolderView"); this is a dummy event handle

With $oRP; Object tag pool
    .OLEDrag()
    .SelBullet = True
    .text = "hello - Au3 supports ActiveX components like the RICHTEXT thanks to SvenP" & @CRLF & 'Try write some text and quit to reload'
    If FileExists("C:\RichText.rtf") Then .LoadFile("C:\RichText.rtf", 0)
    .Enabled = True
    .HideSelection = False
    .SaveFile("C:\RichText.rtf", 0 )
    .SelStart = 0
    .SelLength = StringLen(.Text)
    .SelFontSize = 14
    .SelBold = True
    .SelItalic = True
    .SelUnderline = True
EndWith

GUISetState ();Show GUI

While 1
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            $oRP.SaveFile("C:\RichText.rtf", 0 )
            ExitLoop
        Case $msg = $TagsPageC
            Run(@ComSpec & ' /c start http://www.officecomputertraining.com/vbtutorial/tutpages/page36.asp','', @SW_HIDE)
        Case $msg = $AboutC
            $oRP.AboutBox()
        Case $msg = $PrefsC
            $oRP.SelFontSize = 12
        Case $msg = $StatC
            $oRP.SelBold = False
            $oRP.SelItalic = False
            $oRP.SelUnderline = False
    EndSelect
WEnd

$oRP = 0
GUIDelete ()
Exit

with the error :

>"E:\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:\Dokumente und Einstellungen\AndiT\Desktop\script0r\Tests & includes\ritchtextbox.au3" /autoit3dir "E:\AutoIt3" /UserParams    
+> Starting AutoIt3Wrapper v.1.7.1
>Running:(3.1.1.133):E:\AutoIt3\autoit3.exe "D:\Dokumente und Einstellungen\AndiT\Desktop\script0r\Tests & includes\ritchtextbox.au3"    
D:\Dokumente und Einstellungen\AndiT\Desktop\script0r\Tests & includes\ritchtextbox.au3 (23) : ==> Only Object-type variables allowed in an "With" statement.: 
With $oRP 
With ^ ERROR
+>AutoIT3.exe ended.rc:0
>Exit code: 0    Time: 2.062
My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity
Link to comment
Share on other sites

Looks like the example out of the helpfile. You perhaps have the same problem that I have of not being a licensed user of the RICHTEXT object :P . Installing an IDE... that has the object available for use may license the OS to use the RICHTEXT control.

Link to comment
Share on other sites

were to get the ide ?

Visual Studio IDE and the likes are distributed by Microsoft. Not sure of other distributers available. You may need something more then the basic version to get the richedit control to use. But even then, any pc that the autoit script would run on would also need the license to use the richedit control. I have not found an easy way to enable the license for the richedit control without installing a programming IDE such as mentioned previously.
Link to comment
Share on other sites

can you give me dl links or say me how i get it ? becouse before i formattet my computer it worked..

I have no idea for a easy fix. I'm personally not installing a full development IDE for the sake of just a rich edit control licence. Your one up on me if you have had it working before.
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...