OLE with byref sample (SOLVED)

Post Reply
toninhofwi
Posts: 161
Joined: Tue Oct 18, 2005 10:01 am

OLE with byref sample (SOLVED)

Post 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.
Last edited by toninhofwi on Thu Aug 13, 2009 11:51 am, edited 1 time in total.
toninhofwi
Posts: 161
Joined: Tue Oct 18, 2005 10:01 am

Re: OLE with byref sample

Post by toninhofwi »

Antonio, do you have a sample please?

Viktor is asking me...

Regards,

Toninho.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: OLE with byref sample

Post 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 :-(
regards, saludos

Antonio Linares
www.fivetechsoft.com
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: OLE with byref sample

Post by lailton.webmaster »

I´ve same problem...

how solve it ?

we can change source of xharbour ?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: OLE with byref sample

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: OLE with byref sample

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: OLE with byref sample

Post 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 ? :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: OLE with byref sample

Post 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
toninhofwi
Posts: 161
Joined: Tue Oct 18, 2005 10:01 am

Re: OLE with byref sample

Post 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.
toninhofwi
Posts: 161
Joined: Tue Oct 18, 2005 10:01 am

Re: OLE with byref sample (SOLVED)

Post 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.
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: OLE with byref sample (SOLVED)

Post by lailton.webmaster »

What i need change to use in xharbour ?

you can provide a sample toninho with it solved ?

thanks
toninhofwi
Posts: 161
Joined: Tue Oct 18, 2005 10:01 am

Re: OLE with byref sample (SOLVED)

Post 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.
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: OLE with byref sample (SOLVED)

Post by lailton.webmaster »

Hi Toninho,

I have fivewin 902

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

thanks
toninhofwi
Posts: 161
Joined: Tue Oct 18, 2005 10:01 am

Re: OLE with byref sample (SOLVED)

Post 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.
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: OLE with byref sample (SOLVED)

Post 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:
Post Reply