Página 1 de 1

win32ole.prg and Optional parameters

Publicado: Mié Dic 06, 2006 9:19 am
por Oleg
Dear developers!
I found that if I call any OLE object method, which have optional
parameters,
the program fails with GPF in the folowing cases:
oListview:ListItems:Add() - works OK, all parameters are omitted
oListview:ListItems:Add(1,'',cText) - works OK, last parameters are
omitted
oListview:ListItems:Add(,,cText) - fails with GPF, first parameters are
omitted
I fixed Win32Ole.prg and added special function EmplyOleParam() to support
passing empty parameters
in such cases (like EmptyParam constant in Delphi):
oListview:ListItems:Add(EmptyOleParam(),EmptyOleParam(),cTex t) - works OK,
first parameters are omitted
I attached my sample project with fixed Win32Ole.prg. My fixes are marked
with "// added by OM".
Maybe you will review it and if it is correct, patch Win32Ole.prg in
xHarbour CVS.
Regards, Oleg


Attached files test10.zip (23.2 KB)Â

win32ole.prg and Optional parameters

Publicado: Vie Dic 08, 2006 7:39 pm
por jfgimenez
Oleg,
> I found that if I call any OLE object method, which have optional
> parameters,
> the program fails with GPF in the folowing cases:
>
> oListview:ListItems:Add() - works OK, all parameters are omitted
> oListview:ListItems:Add(1,'',cText) - works OK, last parameters are
> omitted
> oListview:ListItems:Add(,,cText) - fails with GPF, first parameters are
> omitted
>
> I fixed Win32Ole.prg and added special function EmplyOleParam() to support
> passing empty parameters
> in such cases (like EmptyParam constant in Delphi):
> oListview:ListItems:Add(EmptyOleParam(),EmptyOleParam(),cTex t) - works
> OK,
> first parameters are omitted
>
> I attached my sample project with fixed Win32Ole.prg. My fixes are marked
> with "// added by OM".
> Maybe you will review it and if it is correct, patch Win32Ole.prg in
> xHarbour CVS.
Thank you very much. We apreciate your help.
However, I'm not sure about your fix; I need to study it in deepth.
--
Regards,
Jose F. Gimenez
http://www.xailer.com

win32ole.prg and Optional parameters

Publicado: Vie Dic 08, 2006 7:39 pm
por jfgimenez
Oleg,
> I found that if I call any OLE object method, which have optional
> parameters,
> the program fails with GPF in the folowing cases:
>
> oListview:ListItems:Add() - works OK, all parameters are omitted
> oListview:ListItems:Add(1,'',cText) - works OK, last parameters are
> omitted
> oListview:ListItems:Add(,,cText) - fails with GPF, first parameters are
> omitted
>
> I fixed Win32Ole.prg and added special function EmplyOleParam() to support
> passing empty parameters
> in such cases (like EmptyParam constant in Delphi):
> oListview:ListItems:Add(EmptyOleParam(),EmptyOleParam(),cTex t) - works
> OK,
> first parameters are omitted
>
> I attached my sample project with fixed Win32Ole.prg. My fixes are marked
> with "// added by OM".
> Maybe you will review it and if it is correct, patch Win32Ole.prg in
> xHarbour CVS.
Thank you very much. We apreciate your help.
However, I'm not sure about your fix; I need to study it in deepth.
--
Regards,
Jose F. Gimenez
http://www.xailer.com

win32ole.prg and Optional parameters

Publicado: Lun Dic 11, 2006 9:49 am
por Oleg
Jose,
> However, I'm not sure about your fix; I need to study it in deepth.
Ok. You may provide your own fix. I just want you or some
other xHarbour developer to confirm and fix this problem with optional
parameters by some way.
Regards, Oleg.

win32ole.prg and Optional parameters

Publicado: Lun Dic 11, 2006 9:49 am
por Oleg
Jose,
> However, I'm not sure about your fix; I need to study it in deepth.
Ok. You may provide your own fix. I just want you or some
other xHarbour developer to confirm and fix this problem with optional
parameters by some way.
Regards, Oleg.