ich zerbreche mir gerade die Finger bei der Einbindung einer OCX-Komponente. (WPViewPDF von WPCubed http://www.wpcubed.de - Sehr gute Komponenten - habe rtf2pdf seit Jahren im Einsatz und will vom AcrobatReader weg!)
Nun schaffe ich es nicht etwas anzuzeigen, was wie folgt beschrieben ist.
//---------------------------------------------------------------------------------
The component is implemented as "WindowClass" which makes it possible to use it in almost any development system under Windows. We provide a wrapper for Delphi/C++Builder and .NET and an OCX. The advantage for You is that the investment in this product is save.
We choose the design as window class because it can be used so easily: simply specify the name in the CreateWindow API function. Of course the viewer DLL must be loaded first, a simple LoadLibrary(dllname) is sufficient.
//---------------------------------------------------------------------------------
Kann mir bitte jemand auf die Sprünge helfen?
Hier das Stück Quellcode:
Code: Alles auswählen
function ShowPDF(cPDFDatei)
// PDF-Objekt erzeugen
oPDF := CreateObject( "ViewPDF01.WPViewPDFX")
IF oPDF == NIL
runshell('ViewPDF02.ocx /s','regsvr32.exe')
MsgBox("Eine einmalige OCX-Modulregistrierung wurde durchgeführt! Bitte wiederholen!")
lOK := .F.
else
// Create an ActiveXObject from the AutomationObject
// returned by the CreateObject() function
oPDF := oPDF:dynamicCast( ActiveXObject() )
cDLL := 'wPDFViewDemo02.dll'
cName := ''
cKey := ''
nWert := 0
erg := oPDF:ViewerStart(cDLL,@cName,cKey,nWert) // erg anschließend NIL
erg := oPDF:CommandStr(101,'Test.pdf') // <- Funktioniert
erg := oPDF:Command(45) // <- Funktioniert
erg := oPDF:AppendFromFile('Test.pdf') // <- Funktioniert
erg := oPDF:LoadFromFile('Test.pdf') // <- Funktioniert
erg := oPDF:PageCount // <- Funktioniert
erg := oPDF:Version // <- Funktioniert = 2272
erg := oPDF:Command(1) // <- Funktioniert aber Fenster oben links zu 3/4 unsichtbar
erg := oPDF:Command(6) // <- Weißes Fenster ohne Funktion
erg := oPDF:Command(31) // Drucken <- Funktioniert
/*if oPDF <> NIL
oPDF:destroy()
endif*/
endif
return .T.