Page 1 of 1

OLE with byref sample (SOLVED)

Posted: Mon Aug 10, 2009 11:44 am
by toninhofwi
Hi friends,

Anybody know if there are example of default XP OLE components that works by reference ?

Something like:

---cut---
local a1, a2
oOle = CreateOle()
oOle:Test( @a1, @a2 )
---cut---

The sample is needed to fix a bug in Harbour OLE.

Thanks and Best Regards,

Toninho.

Re: OLE with byref sample

Posted: Mon Aug 10, 2009 6:01 pm
by toninhofwi
Antonio, do you have a sample please?

Viktor is asking me...

Regards,

Toninho.

Re: OLE with byref sample

Posted: Mon Aug 10, 2009 11:13 pm
by Antonio Linares
Toninho,

There are lots of examples for ole auto in these forums if you make a search for CreateObject.

But right now I can not remember any example that uses a parameter by reference :-(

Re: OLE with byref sample

Posted: Tue Aug 11, 2009 9:29 am
by lailton.webmaster
I´ve same problem...

how solve it ?

we can change source of xharbour ?

Re: OLE with byref sample

Posted: Tue Aug 11, 2009 9:50 am
by Antonio Linares
It has to be reported to the Harbour and xHarbour developers list (both).

Usually a test example (without using FWH) is required in order to check the problem and solve it.

Re: OLE with byref sample

Posted: Tue Aug 11, 2009 10:06 am
by lailton.webmaster
Antonio tu poderia usar meu exemplo como referencia a este problema,
yo no consegui passar p/ CreateObjecto pero tu pode hacer isto abaixo segue lo exemplo:

Code: Select all

#include "fivewin.ch"
function main()
 public oWnd,oCommandbar,oToolA
 public Left:=Top:=Right:=Bottom:=0
 define window ownd

  oCommandBar:= TOleWevent():New("Codejock.CommandBars.13.0.0",Ownd)
   oCommandBar:AttachToWindow( oWnd:hWnd )
   cToolA:=oCommandBar:Add("ToolBar", 0)
   cToolA:GetWindowRect( @Left, @Top, @Right, @Bottom )  // GPF
   // Gpf yet here  
    MsgInfo(Left)
    MsgInfo(Top)
    MsgInfo(Right)
    MsgInfo(Bottom)

activate window ownd
return

Re: OLE with byref sample

Posted: Tue Aug 11, 2009 11:38 am
by Antonio Linares
Lailton,

You have to post an example to the Harbour and xHarbour developer list that does not use FWH and does not use a commercial ActiveX. You must use a Windows own ActiveX so other developers can test it.

No FWH, no CodeJock, got it ? :-)

Re: OLE with byref sample

Posted: Tue Aug 11, 2009 11:50 am
by lailton.webmaster
Toninho,

that activeX you to be using ? can send to antonio ?

Antonio,

if Toninho don´t have it, so think that us need create something in VB
to send for they :lol:

I will try create it in Visual Basic a ocx.

Thanks

Re: OLE with byref sample

Posted: Wed Aug 12, 2009 12:04 am
by toninhofwi
Hi Antonio,

I posted this message in harbour dev list, but Viktor can't fix it because my sample need register a DLL...

Please download this: http://www.fwi.com.br/nfe.zip.

You need dotnetfx.exe 2.0 or above installed, and you need register dll, because is OLE. There
are a registraDLL.bat file in that package.

to test:

--cut---
local oOle, nRet := 0, QtdErros := 0, Mensagem := ""
oOle = Win_OleCreateObject( "NFe_Util_PL005a.Util" )
oOle:ValidaXMLXHarbour( "", 1, @Mensagem, @QtdErros, @nRet )
? Mensagem, QtdErros, nRet
---cut---

The result NEED be:

---cut---
Erro: Arquivo de Schema Inexistente
0
3
---cut---


Best regards,

Toninho.

Re: OLE with byref sample (SOLVED)

Posted: Thu Aug 13, 2009 11:52 am
by toninhofwi
2009-08-12 18:26 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbwin/olecore.c
! fixed memory leak in PutParams()
! fixed parameters order in PutParams()
! fixed possible GPF due calling VariantClear() without VariantInit()
for C stack VARIANT item.
! fixed reverted #if condition - VT_I8 was not supported
+ implemented passing parameters by reference
Not tested at all - I do not have Windows and I'm not familiar
with OLE code/servers. I hope that Windows users can test it
and it Windows developers can update this code if necessary.


Regards,

Toninho.

Re: OLE with byref sample (SOLVED)

Posted: Thu Aug 13, 2009 3:21 pm
by lailton.webmaster
What i need change to use in xharbour ?

you can provide a sample toninho with it solved ?

thanks

Re: OLE with byref sample (SOLVED)

Posted: Thu Aug 13, 2009 7:00 pm
by toninhofwi
Hi Lailton.

I´m currently using Harbour, but xharbour works with OLE by reference too.

Do you have latest FWH ? There are a way to you test with Harbour to compare results ?

Regards,

Toninho.

Re: OLE with byref sample (SOLVED)

Posted: Thu Aug 13, 2009 7:20 pm
by lailton.webmaster
Hi Toninho,

I have fivewin 902

i have this problem and i dont know how solve it.

thanks

Re: OLE with byref sample (SOLVED)

Posted: Fri Aug 14, 2009 12:11 pm
by toninhofwi
Lailton, please do a test with Harbour.

The problem that I posted here is for pure OLE, without ActiveX, but Harbour ActiveX as implemented in the same way, so maybe it can work for you.

Sorry, but I can´t test it in XHarbour for while.

Regards,

Toninho.

Re: OLE with byref sample (SOLVED)

Posted: Fri Aug 14, 2009 10:30 pm
by lailton.webmaster
No Problem TOninho thanks

I have too this problem, but i´m using Activex too, when i send for ref
give-me erro. i no use harbour.

but thanks. i think that a day it will go solved =]

:lol: