OLE with byref sample (SOLVED)

OLE with byref sample (SOLVED)

Postby toninhofwi » Mon Aug 10, 2009 11:44 am

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: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: OLE with byref sample

Postby toninhofwi » Mon Aug 10, 2009 6:01 pm

Antonio, do you have a sample please?

Viktor is asking me...

Regards,

Toninho.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: OLE with byref sample

Postby Antonio Linares » Mon Aug 10, 2009 11:13 pm

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

Re: OLE with byref sample

Postby lailton.webmaster » Tue Aug 11, 2009 9:29 am

I´ve same problem...

how solve it ?

we can change source of xharbour ?
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: OLE with byref sample

Postby Antonio Linares » Tue Aug 11, 2009 9:50 am

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

Re: OLE with byref sample

Postby lailton.webmaster » Tue Aug 11, 2009 10:06 am

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

Re: OLE with byref sample

Postby Antonio Linares » Tue Aug 11, 2009 11:38 am

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

Re: OLE with byref sample

Postby lailton.webmaster » Tue Aug 11, 2009 11:50 am

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

Re: OLE with byref sample

Postby toninhofwi » Wed Aug 12, 2009 12:04 am

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: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: OLE with byref sample (SOLVED)

Postby toninhofwi » Thu Aug 13, 2009 11:52 am

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_[U]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.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: OLE with byref sample (SOLVED)

Postby lailton.webmaster » Thu Aug 13, 2009 3:21 pm

What i need change to use in xharbour ?

you can provide a sample toninho with it solved ?

thanks
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: OLE with byref sample (SOLVED)

Postby toninhofwi » Thu Aug 13, 2009 7:00 pm

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

Re: OLE with byref sample (SOLVED)

Postby lailton.webmaster » Thu Aug 13, 2009 7:20 pm

Hi Toninho,

I have fivewin 902

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

thanks
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: OLE with byref sample (SOLVED)

Postby toninhofwi » Fri Aug 14, 2009 12:11 pm

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

Re: OLE with byref sample (SOLVED)

Postby lailton.webmaster » Fri Aug 14, 2009 10:30 pm

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], MaxP, Natter and 77 guests