Rapid-Q Documentation by William Yu (c)1999 Appendix A: QOLECONTAINER

QOLECONTAINER Component

QOleContainer is an ActiveX container whose properties and methods can be accessed similar to QOleObject. My best guess is that Rapid-Q uses the COM IDispatch interface for this component. The component is mostly unfinished but has some basic functionality. There is no documented way to trap an EVENT such as OnClick, etc. You can get a COM object viewer from the MS VC++ software development kit or from :
http://www.microsoft.com/com/resources/oleview.asp
http://download.microsoft.com/download/ole/ole2v/3.5/W351/EN-US/Ole2v.exe

QOleContainer Properties
FieldTypeR/WDefault




AlignINTEGERRWalNone
AllowInPlaceINTEGERRWTrue
AutoShowINTEGERRWTrue
BorderStyleINTEGERRWbsSingle
ColorINTEGERRW
CursorINTEGERRWcrDefault
EnabledINTEGERRWTrue
HandleINTEGERR
HeightINTEGERRW
HintSTRINGRW
LeftINTEGERRW0
ModifiedINTEGERRWFalse
ParentQFORM/QPANEL/QTABCONTROLW
ShowHintINTEGERRWFalse
SizeModeINTEGERRWsmClip
StateINTEGERRWosEmpty
TabOrderINTEGERRW
TagINTEGERRW
TopINTEGERRW0
WidthINTEGERRW
VisibleINTEGERRWTrue

QOleContainer Methods
MethodTypeDescriptionParams




CreateObjectFUNCTION (ClassName AS STRING) AS INTEGERCreate new embedded object1
FreeSUBRelease object0
InvokeFUNCTIONI (ID AS STRING, Params, ...) AS VARIANTInvoke method/propertyInfinite

QOleContainer Events
EventTypeOccurs when...Params




OnKeyDownSUB (Key AS Word, Shift AS INTEGER)Key held down2
OnKeyPressSUB (Key AS BYTE)User presses a key1
OnKeyUpSUB (Key AS Word, Shift AS INTEGER)User releases a key2
OnMouseDownSUB (Button%, X%, Y%, Shift%)Mouse button held down4
OnMouseMoveSUB (X%, Y%, Shift%)Mouse moves3
OnMouseUpSUB (Button%, X%, Y%, Shift%)Mouse button is released4
OnObjectMoveSUB (Rect AS QRECT)OLE Object has moved or resized1
OnResizeVOIDAfter OLE container is resized0


QOleContainer Examples

' This example requires GIF89.DLL which can be found on
' Rapid-Q's knowledge base page.
' Make sure to register the .DLL if you haven't already
' c:\blah> regsvr32 gif89.dll
' Note, example works best if you load an animated GIF file.

CREATE Form AS QFORM
    Caption = "Animated GIFs"
    Center
    Visible = 1
    CREATE GifAnimation AS QOLECONTAINER
        Align = alClient
        CreateObject("Gif89.Gif89.1")
        '-- FileName is a property in GIF89.DLL
        FileName = "anim.gif"
    END CREATE
    Visible = 0
END CREATE
Form.ShowModal
GifAnimation.Free

Example #2 (shockwave player)
You need to have an edit in the Flash Movie with a variable
named 'texto' (dynamic).
CREATE Form AS QFORM
    Caption = "Swf"
    Center
    Visible = 1
    CREATE swf AS QOLECONTAINER
        CreateObject("ShockwaveFlash.ShockwaveFlash.5")
        movie= "c:\windows\escritorio\p1.swf"
        setvariable ("t","texto")
        height =200
        width = 200
    END CREATE
    Visible = 0
END CREATE  

Form.ShowModal
'need to call this before program ends:
swf.Free

Example #3 (Create your own web page)
' ----------------------------------
$ESCAPECHARS ON
$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"
Declare Sub OnClose_frmRapidView
'
Sub DummyProc
End Sub
CREATE frmRapidView AS QFORM
     Autoscroll = false
     WindowState = wsMaximized
     Caption =  "Demo RQ & HTML"
     Visible = True
     WndProc = DummyProc
     CREATE msHTML AS QOLECONTAINER
         Align = alClient
         createObject("Shell.Explorer.1")
     END CREATE
     Visible = False
     Onclose = OnClose_frmRapidView
End Create

DIM c as string
c = "about:<head><basefont face=\"courrier\"></head><body scroll=\"no\">"
c = c + "<center><br><h1>Text Out, Anything you want<BR> One more line<br>WILL BE TOO SLOW</center></h1>"
c = c + "<H2><HR><U>GOOD LUCK</U></H2></basefont></head>"
msHTML.navigate(c)

Sub OnClose_frmRapidView
     application.Terminate
     End
End Sub
'
' ********************************************
frmRapidView.ShowModal
' ********************************************

Example #4 (Simple web browser)
' frmTestOle        J.Philippe, Frbruary 12th, 2003
$TYPECHECK ON
$INCLUDE "RapidQ.inc"
Const CRLF = Chr$(10) & Chr$(13)
'web site with properties and methods
DefStr sURL = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dninvbs/html/theinternetexplorerobjectmodel.asp"
Declare Function DeleteUrlCacheEntry Lib "wininet.dll" Alias_
 "DeleteUrlCacheEntryA" (ByRef lpszUrlName As String) As Long
'
Declare Sub OnClose_frmTestOle
Declare Sub OnClic_AnyMenu (Sender As QMenuItem)
'
Create frmTestOle As QForm
    WindowState = 2 ' wsMaximized
    Caption = "frmTestOle V 1.0.0       Loading URL in INTERNET EXPLORER" 
    OnClose = OnClose_frmTestOle
    Visible = True
    Create oleIE As QOleContainer
        Align = 5 ' =alClient
        createObject("Shell.Explorer.1")  'also try  "Shell.Explorer.2"     
    End Create
    Visible = False
End Create
frmTestOle.Show
DeleteUrlCacheEntry (sURL)  ' Delete the entry from the cache, forces a new download
oleIE.Navigate (sUrl)
Do               ' bugs without this
    DoEvents
Loop Until oleIE.Busy = False
'
frmTestOle.Caption = "frmTestOle V 1.0.0               Loaded"
'
' OLE IE PROPERTIES TEST
DefInt iReturn = MessageDlg (("        Application = " & Str$(oleIe.Application)            & "     ???" _
   & CRLF & "          Busy Flag = " & Str$(oleIE.Busy)                   & "     Work  0, -1)" _
   & CRLF & "           Document = " & Str$(oleIE.Document)               & "     ???" _
   & CRLF & "             Height = " & Str$(oleIE.Height)                 & "     in OLeContainer" _
   & CRLF & "              Width = " & Str$(oleIE.Width)                  & "     in OleContainer" _
   & CRLF & "       LocationName = " & oleIE.LocationName                 & "     Works" _
   & CRLF & "        LocationUrl = " & oleIE.LocationUrl                  & "     Works" _
   & CRLF & "             Parent = " & Str$(oleIE.Parent)                 & "     " _
   & CRLF & "  TopLevelContainer = " & Str$(oleIE.TopLevelContainer)      & "     " _
   & CRLF & "               Type = " & oleIE.Type                         & "     "), 2, 4, 0) 'mtInformation,MBOK
'
' The Following Properties Bug :
'             & "\n FullScreen = " & Str$(oleIE.FullScreen)  ' bugs
'             & "\n   FullName = " & oleIE.FullName          ' bugs
'             & "\n       Name = " & oleIE.Name              ' bugs
'             & "\n       Path = " & oleIE.Path              ' bugs
'             & "\n  StatusBar = " & Str$(oleIE.StatusBar)   ' bugs
'             & "\n    StatusText = " & oleIE.StatusText     ' bugs             
'             & "\n       ToolBar = " & Str$(oleIE.ToolBar)  ' bugs
'             & "\n       Visible = " & Str$(oleIE.Visible)  ' bugs yet in OleContainer ???
'  I Dont even try Methods :)
'
frmTestOle.Caption = "frmTestOle V 1.0.0" 
'
' *************************************
frmTestOle.Visible = False
frmTestOle.ShowModal
' *************************************
'
Sub OnClose_frmTestOle
    oleIE.Quit
    oleIE.Free
    Application.Terminate
    End
End Sub
'

Prev Component Contents Next Component