ProtoType Bug ?
Verfasst: 05.03.2006 16:14
Habe versucht ein Prototype in einer Procedure aufzurufen.
Bekomme aber einer Fehlermedlungh vom IDE.
Bekomme aber einer Fehlermedlungh vom IDE.
Code: Alles auswählen
;-TOP
; Kommentar : ALT Helper
; Datei : AtlHelper.pb
; Version : 1.0
; Erstellt : 05.02.2006
; Geändert :
; ---------------------------------------------------------
Global Lastmessage.s
Global LastError.l
Prototype.l ProtoAtlAxWinInit()
Prototype.l ProtoAtlAxCreateControl(Control.p-unicode, hWnd.l, *pStream, *ppContainer.IUnknown)
Prototype.l ProtoAtlAxGetControl(hWnd.l, *Obj.IDispatch)
Procedure InitAtl()
If OpenLibrary(0, "ATL.dll") = 0
LastMessage = "Fehler OpenLibrary"
LastError = $80080001
ProcedureReturn 0
EndIf
;- Init Functions
AtlAxWinInit.ProtoAtlAxWinInit = GetFunction(0, "AtlAxWinInit")
AtlAxCreateControl.ProtoAtlAxCreateControl = GetFunction(0, "AtlAxCreateControl")
AtlAxGetControl.ProtoAtlAxGetControl = GetFunction(0, "AtlAxGetControl")
ProcedureReturn 1
EndProcedure
; ---------------------------------------------------------
Procedure.l CreateControl(Control.s, hWnd.l) ; Result IUnknown
If AtlAxWinInit() = 0
LastMessage = "Fehler AtlAxWinInit"
LastError = $80080002
ProcedureReturn 0
EndIf
AtlAxCreateControl(Control, hWnd, 0, @*Container.IUnknown)
If *Container = 0
LastMessage = "Fehler AtlAxCreateControl: " + Control
LastError = $80080003
ProcedureReturn 0
Else
ProcedureReturn *Container
EndIf
EndProcedure
; ---------------------------------------------------------
Procedure ReleaseControl(*Container.IUnknown)
If *Container
*Container\Release()
EndIf
EndProcedure
; ---------------------------------------------------------
Procedure.l GetControl(hWnd.l) ; Result IDispatch
AtlAxGetControl(hWnd, @*Obj.IDispatch)
If *Obj = 0
LastMessage = "Fehler AtlAxGetControl"
LastError = $80080004
ProcedureReturn 0
Else
ProcedureReturn *Obj
EndIf
EndProcedure
; ---------------------------------------------------------
Procedure COMLIB_Init()
CoInitialize_(#Null)
EndProcedure
Procedure COMLIB_End()
CoUninitialize_()
EndProcedure