Bugs and vermeintliche | | | | - Page 1 - |
| Dieter Zornow | i think its another trouble in XProfan 11, have straight too over again The OCX - Examples of Uwe Pascal n. tested. under XProfan 10 runs everything yet correct. under XProfan 11 RC 8 only Abstürze each example.
greeting
Dieter |
| | | Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2 | 06/29/08 ▲ |
| |
| | | | | - Page 1 - |
| | Nutzt Delphi there Heaps [...] ? |
| | | | |
| | RGH | ... and so as looks, walk on my computer To dwell (XP per SP3) The Examples of Uwe Pascal werder under XProfan 10 yet under XProfan 11. it comes always The Message CallMethod - Unbekannter name. (Yes, I have The ComCtl32.ocx registered ....) in the firm (XP per SP2 has it worked.)
then must I well still others Topics zuwenden ...
Greeting Roland |
| | | Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 06/30/08 ▲ |
| |
| | Uwe ''Pascal'' Niemeier | Hello people!
first of all time: I have in the momentum weder XP SP3 yet XProfan 11 available, therefore can ichs not self testing.
but: The of Roland reklamierten variables having in this Version the OCX-routines directly nothing with the ActiveX-functions To do: CompileMarkSeparation
proc ocxCreate----------------------------------ocxCreate-------------------------------
parameters ProgID$,Wnd&,xa%,ya%,xb%,yb%,ObjAddr&,CtrlAddr&
declare Control&,IUnknown&,Object&
Control&=control(AtlAxWin,ProgID$,$50000000,xa%,ya%,xb%,yb%,Wnd&,0,0,0)
~AtlAxGetControl(Control&,addr(IUnknown&))
Object&=QueryInterface(IUnknown&,~IID_IDispatch)
CallMethod(IUnknown&,~Release)
long ObjAddr&,0=Object&
long CtrlAddr&,0=Control&
endproc---------------------------------------------------------------------------------
declare Object&,Control&
ocxCreate(MSCAL.Calendar.7,%hwnd,10,100,350,250,addr(Object&),addr(Control&)
The both Pointer come in Proc as ObjAddr& and CtrlAddr& on, Object& and Control& go pub again declared and end the Proc go The - as Parameter übergebenen - Pointer with LONG filled.
The problem could means too in the direct Übergabe of addr(Variable&) as Parameter for a procedure lying or in the local Deklaration of/ one global already vorhandenen Variable...
PS: in the example becomes Version 1 the OCX-routines uses. How see it because with Version 2 from?
SeeYou Pascal |
| | | | |
| | | | - Page 2 - |
| | RGH | Hi,
I have me The thing yesterday evening once more accurate angeschaut. its too furthermore so, that a variable during yours Gültigkeit your address not changes. From therefore means a the all-clear!
The problem lying in Pascals Create-routine, or. the Übergabe the variables from this back: CompileMarkSeparation
Proc ocxCreate----------------------------------ocxCreate-------------------------------
parameters ProgID$,Wnd&,xa%,ya%,xb%,yb%,ObjAddr&,CtrlAddr&
declare Control&,IUnknown&,Object&
Control&=control(AtlAxWin,ProgID$,$50000000,xa%,ya%,xb%,yb%,Wnd&,0,0,0)
~AtlAxGetControl(Control&,addr(IUnknown&))
Object&=QueryInterface(IUnknown&,~IID_IDispatch)
CallMethod(IUnknown&,~Release)
long ObjAddr&,0=Object&
long CtrlAddr&,0=Control&
endproc--------------------------------------------------------------------------------span>
About PARAMETERS go the two Adressen into local variables ObjAddr& and CtrlAddr& stored. its Adressen go but with leave the procedure null. In XProfan 11 having Object& and Control& the value 0 ... what then unweigerlich to that Crash lead. want one several values a procedure zurückerhalten wempfiehlt itself always the lane over a structure or over one Objekt, there - How in almost all Languages - Structures and Objects by address transfer go. so sees The angepaßte Create-procedure from: CompileMarkSeparation
proc ocxCreate----------------------------------ocxCreate-------------------------------
parameters ProgID$,Wnd&,xa%,ya%,xb%,yb%,Uebergabe#
declare IUnknown&
Uebergabe#.Control&=control(AtlAxWin,ProgID$,$50000000,xa%,ya%,xb%,yb%,Wnd&,0,0,0)
~AtlAxGetControl(Uebergabe#.Control&,Addr(IUnknown&))
Uebergabe#.Object&=QueryInterface(IUnknown&,~IID_IDispatch)
CallMethod(IUnknown&,~Release)
endproc---------------------------------------------------------------------------------
too The procedure QueryInterface() must properly angepaßt go (appeal of CallMethod()): CompileMarkSeparation
proc QueryInterface-------------------------------------------------------------
parameters IFace1&,IID$
declare IFace2#,Error&
dim IFace2#,4
StringToGUID(IID$,IID#)
Error&=CallMethod(IFace1&,0,IID#,IFace2#)
case Error&<0:ErrorMessage(Error&,QueryInterface)
CallMethod(IFace1&,~Release)
return long(IFace2#, 0)
endproc-----------------------------------------------------------------------
And so now the Beispielprogramm: CompileMarkSeparationwindow 100,10-500,500
usermessages 16
$H windows.ph
$H OCX.ph
$I OCX.inc
only to demonstration. usually would one The Übergabestruktur in OCX.ph define
Struct SUebergabe = Object&, Control&
declare u#
dim u#, SUebergabe
declare ATL&,Var#,Disp#,IID#
ocxInit()
ocxCreate(MSCAL.Calendar.7,%hwnd,10,100,350,250,u#)
ocxMethod(u#.Object&,Today)
numwidth 3
while 1
locate 0,0
print day ,ocxGet(u#.Object&,Day)
print month ,ocxGet(u#.Object&,Month)
print year ,ocxGet(u#.Object&,Year)
waitinput
case %umessage=16:break
endwhile
ocxMethod(u#.Object&,AboutBox)
destroywindow(u#.Control&)
ocxDeInit()
Greeting Roland |
| | | Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 07/01/08 ▲ |
| |
| | RGH | yet short to Statement for Insider:
In Xrofan 11 go objectively with leave of/ one procedure The Adressen the local variables again null and the suitable memory becomes again spare given.
To including XProfan 10 watts the memory for all possible variables Yes at Start available set.* at that leave the procedure watts of course the Zeiger on The latest Variable reset, so that on The local variables the procedure not any more zugegriffen go could and the memory for Deklaration new variables again available stood, but the memory watts not released. And so long this not through new Declares used watts, stayed teh folks values there stand.
Greeting Roland
* with Strings, Arrays and reaches though only The Zeiger on the memory ... but the would now one other Topic ... |
| | | Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 07/01/08 ▲ |
| |
| | Sebastian König | RGH
About PARAMETERS go the two Adressen into local variables ObjAddr& and CtrlAddr& stored. its Adressen go but with leave the procedure null. In XProfan 11 having Object& and Control& the value 0 ... what then unweigerlich to that Crash lead.
the argument understand I somehow not... into Parameters ObjAddr& and CtrlAddr& go still The Adressen of global variables transfer (see Pascals code supra). What exactly is then the trouble with of/ one Zuweisung the shape long ObjAddr&,0=Object&? on what very ObjAddr& now shows, power from visibility the procedure Yes none Difference and that Object& now a local Variable is, might too no role play.
so How I The Description understand, is the whole still equivalent to a such example: CompileMarkSeparation |
| |
| | RGH | Yes, rOlf, I suspect you have right: my Statement was something To short clutched. fact is, that The properly changed and of me geposteten Source code too under XProfan 11 correct functions. (at least here on the job-PC. home on my computer works quite nothing with ActiveX - weder in XProfan 10 yet 11. I must time to check on, whether my ComCtl32.ocx The right is.)
Möglicherweise depends the trouble too so together, that local variables on ActiveX-functions given go, also to the leave the procedure yet active are and so suddenly on not any more gültige Adressen grab. i'll with opportunity weiterforschen. important is here, that we a Solution for the trouble and have Uwe Pascals Source code too for XProfan11-User open stand.
Greeting Roland |
| | | Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 07/01/08 ▲ |
| |
| | Frank Abbing | If the trouble only local variables concerns and not The Global, can I so thoroughly life. Dass local variables with erneutem appeal of/ one Prozedure deleted go, is Yes thoroughly gängige practice. So I'm it too of Assembler from dwelt. |
| | | | |
| | Uwe ''Pascal'' Niemeier | Hello people!
Möglicherweise depends the trouble too so together, that local variables on ActiveX-functions given go, also to the leave the procedure yet active are and so suddenly on not any more gültige Adressen grab.
the could but only on IUnknown& zutreffen, what but apparently not the case is. The values for/of Control& and Object& (pub) go directly allocated ; it go no Pointer uses. accordingly can also no späterer grabbed hereon erfolgen. because of QueryInterface() must I time look...
important is here, that we a Solution for the trouble and have Uwe Pascals Source code too for XProfan11-User open stand.
me went it indeed therefore, The routines possible far abwärtskompatibel To hold, therefore have I on OOP waived. But already for OCX-Package Version 3 vorgemerkt. would be but nevertheless well, this trouble by then clarified to have. The Übergabe of Pointern, circa variables To fill ought to Yes - withal OOP - thoroughly not unusual his.
PS: The difficulty with SP3 I will me soon distinguished.
SeeYou Pascal |
| | | | |
| | RGH | Hello Pascal,
The Übergabe of Pointern, circa variables To fill, is - How Rolf indeed already fixes has - not the eigentliche trouble. The problem suspect I even in the area, where Adressen lokaler variables on functions transfer go, also to termination the aufrufenden procedure (and the Ungültigwerden even this Adressen) yet weiterlaufen. For this, count evident ActiveX-Objects. On attempt can I in Your code of course no derartigen Aufrufe with Adressen lokaler variables discern, but ActiveX has there möglicherweise Eigenheiten, The me not yet familiar are. Since I momentarily on my Entwicklungsrechner The Examples not times under XProfan 10 running get, must I a further analysis on The Time to the Release of XProfan 11 move. (there I will my computer one new Motherboard with besserem processor grant. to the Release counts integrally severe: Never Change A Running system.) and ought to I really then check, I in XProfan what do can, speaks Yes nothing against one free Update on one XProfan 11.0a or quite 11.1.
If it no real ShowStopper More gives, becomes XProfan 11 soon festgeklopft and finally on JDS supplied. i'm eh already (teils through berufliche and private Auslastung, teils through Maßlosigkeit at installation new Features) about 2 months behind my ursprünglichen schedule.
Greeting Roland |
| | | Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 07/02/08 ▲ |
| |
| | RGH | Hello Pascal, I have not let can and my Frühstückspause on the Arbeitsplatzrechner geopfert:
The supra gepostete code shining not 100%ig steady To his. If I the Declare in the procedure CallMethod by more than three variables erweitere, fractures the program with of/ one Fehlermerldung ex. Very befremdlich, the! means have I something moreover experimerntiert.
it xcheint objectively with the QueryInterface zusammenzuhängen. I have time geschaut, I in XProfan at HTML-Window differently make: Since I Yes only the control zurückgebe, make I jedesmal one new QueryInterface, around the Objektadresse To detect (and naturally to use the Objektes one Releasen). the have I time in Your OCX.INC umgesetzt. first of all one ocxCreateC() (the C standing for Control): CompileMarkSeparation
proc ocxCreateC ----------------------------------ocxCreate-------------------------------
parameters ProgID$,Wnd&,xa%,ya%,xb%,yb%
return control(AtlAxWin,ProgID$,$50000000,xa%,ya%,xb%,yb%,Wnd&,0,0,0)
endproc --------------------------------------------------------------------------------- then The Proceduren ocxGet, ocxPut and ocxMethod as ocGetC, ocxPutC and ocxMethodC copies and properly extended. as example here ocxGetC(): CompileMarkSeparation
proc ocxGetC-------------------------------------ocxGet----------------------------------
parameters Control&,name$
declare Object&,IUnknown&
declare DispID&,v&,v$
~AtlAxGetControl(Control&,addr(IUnknown&))
Object&=QueryInterface(IUnknown&,~IID_IDispatch)
clear Var#,Disp#,IID#
name$=MultiToWideEx(name$)
v&=addr(name$)--GetIDsOfNames need Pointer on Pointer
CallMethod(Object&,5,IID#,addr(v&),1,0,addr(DispID&))--GetIDsOfNames
CallMethod(Object&,6,DispID&,IID#,0,~DISPATCH_PROPERTYGET,Disp#,Var#,0,0)--Invoke
if Var#.vt%=~VT_BSTR------OLE-String
v$=WideToMultiEx(Var#.Val&)
else----------------------numerischer worth
v$=st$(Var#.Val&)
endif
~VariantClear(Var#)
CallMethod(IUnknown&,~Release)
return v$
endproc---------------------------------------------------------------------------------
ocxQueryInterface have I so let, How supra posted (with IFace2#). and already works everything (at least here on the job ;) )
only ne remotely theory, or rather hypothesis: Presumably can itself the ActiveX-Objekt in memory move, what but with the static Speicherverwaltung in XProfan 10 with whom Beispielprogrammen not vorkam, there there Yes nirgendwo new memory angefordert watts. now ermittle I over QueryInterface The Objektadresse (Object&) jedesmal new and the trouble shining fixed.
Greeting Roland |
| | | Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 07/02/08 ▲ |
| |
| | Uwe ''Pascal'' Niemeier | Hello Roland!
only ne remotely theory, or rather hypothesis: Presumably can itself the ActiveX-Objekt in memory move, what but with the static Speicherverwaltung in XProfan 10 with whom Beispielprogrammen not vorkam, there there Yes nirgendwo new memory angefordert watts.
sound ventured... with the development the OCX-routines have I no Notes on so one behaviour found. though becomes with Programmiersprachen with ActiveX-Support Yes so quite everything as self-evident presupposed (what The Umsetzung to Profan Yes so heavy power). Möglicherweise go since the Pointer automatically nachgeführt or so.
will be me again dahinterklemmen, if it on the Time is.
If it no real ShowStopper More gives, becomes XProfan 11 soon festgeklopft and finally on JDS supplied.
has In any drop priority! if the To october works, hol ichs me personally with JDS ex (in the autumn zelten on the sea is what fine )
and a Workaround having we Yes now too
thanks for trouble!
SeeYou Pascal |
| | | | |
|
AnswerThemeninformationenthis Topic has 6 subscriber: |