Here is a simple gradiant progress bar ocx that i've been using as a 'learning' project in spare time.
The spare time is gone so I though I would post it.
I attempted to get this to work with Excel with limited success.

Any feedback welcome.

http://home.att.net/~lotech/AsmGPB.zip
Posted on 2005-04-20 12:08:33 by Wayne

Hello Wayne,

I tried your sample and found an error ... in an include I had written, OBJBASE.INC.
Inside this file there a 2 macros defined, SUCCEEDED() and FAILED(), which both are not correct.
The correct version should be:

SUCCEEDED macro x
ifb <x>
exitm <!SIGN?>
else
if (OPATTR(x)) and 10h
test x,x
exitm <!SIGN?>
else
exitm <x !>= 0>
endif
endif
endm

FAILED macro x
ifb <x>
exitm <SIGN?>
else
if (OPATTR(x)) and 10h
test x,x
exitm <SIGN?>
else
exitm <x !< 0>
endif
endif
endm


Please note the difference: OPATTR() has to be enclosed in braces!

Japheth

Posted on 2005-04-22 07:30:51 by japheth
hi Japheth,

Thanks for the feedback.

I'm am curious on what you were testing that caused you to find the error, and what effect the error caused.

Wayne
Posted on 2005-04-23 09:29:14 by Wayne

Hi Wayne,

the error is severe, lines like


  .if SUCCEEDED(eax)

will then be translated wrong by MASM, because it doesn't know that eax should be treated as signed value in this context. The result was several GPFs inside your control.
Posted on 2005-04-23 10:33:17 by japheth
hi Japheth,

I am a bit taken back by your last post. I have exersized the control quite a bit (VB & Excel only) and have not seen any GPF's. I hope tommorrow to have some time to look into this as it is a bit confusing. I have tested on 2 machines( 2k & 98).

Wayne
Posted on 2005-04-23 11:34:22 by Wayne

Hi Wayne,

don't worry, the problems only occur with containers that don't implement IPropertyNotifySink.

I noticed some additions to olecntrl.inc. But I wonder if this code I found


invoke vf(m_pOleClientSite, IUnknown, QueryInterface),addr IID_IPropertyNotifySink, ADDR pPropertyNotifySink
.if SUCCEEDED(eax)
invoke vf(pPropertyNotifySink, IPropertyNotifySink, OnChanged), nDISPID
invoke vf(m_pOleClientSite, IPropertyNotifySink, Release)
.endif


is correct. Possibly you wanted to write:


invoke vf(m_pOleClientSite, IUnknown, QueryInterface),addr IID_IPropertyNotifySink, ADDR pPropertyNotifySink
.if SUCCEEDED(eax)
invoke vf(pPropertyNotifySink, IPropertyNotifySink, OnChanged), nDISPID
invoke vf(pPropertyNotifySink, IPropertyNotifySink, Release)
.endif


?
Posted on 2005-04-24 04:15:57 by japheth
hi Japheth,

Thanks for catching that.

When I read your comment about additions to olecntrl.inc it hit me that I had overlooked adding some files to this project.
I had intended to include the Asmctrl Readme file so folks knew where to get the include files to build the? control.
Secondly, I was going to include a readme file to explain the condition of this project. In my haste, I forgot.

I will update the zip file as soon as I can get to it.

I thought I had commented all additions to olecntrl,but a quick look reveals I may have missed some.
I will go thru it and document all changes/additions.

Wayne
Posted on 2005-04-24 10:02:26 by Wayne
updated at link above.

Posted on 2005-04-24 12:59:48 by Wayne