I know how to program "Member Get" but how do I program "Property Get"
in a PB generated inc file?
Bob
in a PB generated inc file?
Bob
CLASS MyClass INSTANCE lCustomerNum AS LONG INTERFACE MyInterface INHERIT IUNKNOWN PROPERTY GET CustomerNum PROPERTY = lCustomerNum END PROPERTY PROPERTY SET CustomerNum(lValue) lCustomerNum = lValue END PROPERTY END INTERFACE END CLASS
INTERFACE IDBIND MyInterface MEMBER GET CustomerNum AS LONG MEMBER SET CustomerNum(IN lValue AS LONG) END INTERFACE
CLASS MyClass ... PROPERTY GET CustomerNum As VarType PROPERTY = lCustomerNum END PROPERTY PROPERTY SET CustomerNum(lValue As VarType) lCustomerNum = lValue END PROPERTY ...
Option Explicit Public authorisation As New FrameAuthorise Public theEx As New FrameEx Public theSession As FMSession Private Sub TakeControl_Click() Dim oDoc As FMDocument Set theSession = theEx.Session If Not theSession.Initialise(authorisation) = 1 Then MsgBox "Failed to connect with FrameMaker!" Exit Sub End If Set oDoc = theSession.ActiveDoc
#DEBUG ERROR ON #COMPILE EXE #DIM ALL #IF NOT %DEF(%WINAPI) #INCLUDE "win32api.inc" 'add win32api if not already added #ENDIF #INCLUDE "FrameACType.inc" #INCLUDE "FrameAC.inc" #INCLUDE "FDKTypes2.inc" #INCLUDE "FrameACUDT.inc" GLOBAL authorisation AS IFrameAuthorise GLOBAL theEx AS IFrameEx GLOBAL theSession AS IFMSession FUNCTION PBMAIN () AS LONG LOCAL oDoc AS IFMDocument theEx = NEWCOM CLSID $CLSID_FRAMEACLib_FrameEx ' ISNOTHING(theEx) returns valid object OBJECT GET theEx.session TO theSession END FUNCTION
PowerBASIC for Windows PB/Win Version 9.01 Copyright (c) 1996-2009 PowerBasic Inc. Venice, Florida USA All Rights Reserved Error 533 in C:\D_Drive\PBDLL90\Projects\FRAMEA~1\MekonTest.bas(22:012): Dispatch Object variable expected Line 22: OBJECT GET theEx.session TO theSession ============================== Compile failed at 09:28:32 on 24/07/2009
' Interface Indentifiers
$IID_FRAMEACLib_IFrameEx = GUID$("{E6E0DD00-A895-11D3-91B3-0050BAAE27FB}")
$IID_FRAMEACLib_IFrameAuthorise = GUID$("{E6E0DD02-A895-11D3-91B3-0050BAAE27FB}")
$IID_FRAMEACLib_IFrameAuthorise2 = GUID$("{E5477EB0-AD66-11D3-91B5-0050BAAE27FB}")
' Interface Name : IFrameEx
' Description : IFrameEx Interface
' Class Name : FrameEx
' ClassID : $CLSID_FRAMEACLib_FrameEx
' ProgID : $PROGID_FRAMEACLib_FrameEx
' Version ProgID : $PROGID_FRAMEACLib_FrameEx1
Interface IFrameEx $IID_FRAMEACLib_IFrameEx
Inherit IDispatch
Method Initialise <1> (ByRef pIFDK As IDispatch, ByRef cmdFirst As Long)
Method Destroy <2> ()
Property Get Connected <3> () As Long
Property Get FDK <4> () As IDispatch
Property Get Session <5> () As IDispatch
End Interface
' Interface Name : IFMSession ' Class Name : FMSession ' ClassID : $CLSID_FACLib_FMSession Interface IFMSession $IID_FACLib_IFMSession Inherit IDispatch Property Get Id <1> () As Long Property Set Id <1> (ByVal Rhs As Long) Property Get docId <2> () As Long Property Set docId <2> (ByVal Rhs As Long) Property Get UserString <3> () As String Property Set UserString <3> (ByVal Rhs As String) Property Get ObjectType <4> () As Long Method Delete <5> () As Long Method GetText <6> (Byval flags As Long, Byval Flags2 As Long) As Variant Method ObjectValid <7> () As Long Method GetPropVals <8> () As Variant Method SetPropVals <9> (Byval PB_Properties As Variant) As Long Property Get ActiveBook <10> () As IFMBook Property Set ActiveBook <10> (ByVal pVal As IFMBook) Property Get ActiveDoc <11> () As IFMDocument --- Method Initialise <95> (Byval AuthObject As IDispatch) As Long ---
OBJECT GET theEx.session TO theSession
theSession = theEx.session
#DEBUG ERROR ON
#COMPILE EXE
#DIM ALL
#IF NOT %DEF(%WINAPI)
#INCLUDE "win32api.inc" 'add win32api if not already added
#ENDIF
#INCLUDE "FrameACType.inc"
#INCLUDE "FrameAC.inc"
#INCLUDE "FDKTypes2.inc"
#INCLUDE "FrameACUDT.inc"
GLOBAL authorisation AS IFrameAuthorise
GLOBAL theEx AS IFrameEx
GLOBAL theSession AS IFMSession
FUNCTION PBMAIN () AS LONG
LOCAL oDoc AS IFMDocument
LOCAL tempv AS LONG
LOCAL temps AS STRING
theEx = NEWCOM CLSID $CLSID_FRAMEACLib_FrameEx ' ISNOTHING(theEx) returns valid object
authorisation = NEWCOM CLSID $CLSID_FRAMEACLib_FrameAuthorise
IF ISNOTHING(authorisation)OR ERR THEN
MSGBOX "Bad"
ELSE
MSGBOX "good" 'returns here
END IF
theSession = theEx.session
IF ISNOTHING(theSession)OR ERR THEN
MSGBOX "Bad"
ELSE
MSGBOX "good" 'returns here
END IF
tempv = theSession.Initialise(authorisation)
IF tempv <> 1 THEN
MSGBOX "Not connected to FrameMaker" 'returns here with large number
EXIT FUNCTION
END IF
SET oDoc = theSession.ActiveDoc
temps = oDoc.Name
MSGBOX temps
END FUNCTION
#DIM ALL #IF NOT %DEF(%WINAPI) #INCLUDE "win32api.inc" 'add win32api if not already added #ENDIF #INCLUDE "IBIND_FrameAC.inc" #INCLUDE "IBIND_FrameACType.inc" '#INCLUDE "FDKTypes2.inc" '#INCLUDE "FrameACUDT.inc" GLOBAL theFrameEx AS DISPATCH GLOBAL myFrameEx AS DISPATCH GLOBAL myFrameAuthorise AS DISPATCH GLOBAL mySession AS DISPATCH GLOBAL myDocument AS DISPATCH GLOBAL tempv AS LONG GLOBAL vtemp AS VARIANT FUNCTION PBMAIN () AS LONG theFrameEx = NEW DISPATCH IN "FrameAC.FrameEx" myFrameAuthorise = NEW DISPATCH IN "FrameAC.FrameAuthorise" OBJECT GET theFrameEx.Session TO mySession OBJECT CALL mySession.Initialise(myFrameAuthorise) TO tempv IF tempv <> 1 THEN MSGBOX "Failed to connect to FrameMaker END IF OBJECT GET mySession.ActiveDoc TO myDocument OBJECT GET myDocument.Name TO vtemp MSGBOX VARIANT$(vtemp) END FUNCTION
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment