OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Fred Tomke on February 01, 2010, 07:37:43 AM

Title: ActiveX sample and news of A21
Post by: Fred Tomke on February 01, 2010, 07:37:43 AM
Hello, Owen, I'm not sure whether to post as a reply on sourceforge.net (http://sourceforge.net/projects/opendcl/forums/forum/658811/topic/3537805) or better here. That's why I do it here.

I'm going to build up a ActiveX sample for OpenDCL. I hope that I only used standard controls so I hope everybody can load and show the project. While playing around with the controls I discovered some problems which I don't know whether they are bugs or not.

I post them without any order of importance.


Fred
Title: Re: ActiveX sample and news of A21
Post by: owenwengerd on February 01, 2010, 07:58:16 AM
Thanks Fred, this is exactly the kind of feedback I was hoping for! I will go through your list as time permits and respond when I have someting to add.
Title: Re: ActiveX sample and news of A21
Post by: owenwengerd on February 01, 2010, 08:33:54 AM
I did a quick test with the HHCtrl control. The problem is that the exact reason for the failure is not returned from the MFC function that handles control creation. It does display some debug utput when running under the debugger:

SetClientSite on OLE control {ADB880A6-D8FF-11CF-9377-00AA003B7A11} failed.
>>> Result code: 0x80004002

This might indicate that the control is not happy with the window where it is being created, but that's just a guess. In other cases of failure, the reasons could be even more obscure. There could be a generic error message, but its only benefit would be to verify that control creation failed for some unknown reason.
Title: Re: ActiveX sample and news of A21
Post by: Fred Tomke on February 01, 2010, 08:37:42 AM
Owen, thank you for your reply. I'm glad that my post matches your desires :) .

Meanwhile I was searching for a reference sample you've mentioned in you sourceforge post. And I have found a method:
Item method of the IButtons collection of the toolbar. But the control browser show a very special data type: I also found a 'Variant but in this case there is a single ' .

There is another thing left. Does anybody have experiences in linking a imagelist control to a control's imagelist property? My toolbar shows no images because I didn't linked a imagelist yet. Can I link it also at design time or only at runtime or even no time?

Fred
Title: Re: ActiveX sample and news of A21
Post by: Fred Tomke on February 01, 2010, 08:45:49 AM
Quote from: owenwengerd on February 01, 2010, 08:33:54 AM
There could be a generic error message, but its only benefit would be to verify that control creation failed for some unknown reason.

Owen, it's just like in a marriage: communication is everything  :D . It's better to say that a control cannot be placed just before someone is coming up thinking it's a bug because nothing happens.

Fred
Title: Re: ActiveX sample and news of A21
Post by: owenwengerd on February 01, 2010, 09:50:09 AM
Quote from: Fred Tomke on February 01, 2010, 08:45:49 AM
Owen, it's just like in a marriage: communication is everything  :D . It's better to say that a control cannot be placed just before someone is coming up thinking it's a bug because nothing happens.

I agree that feedback would be good. I'm not sure what form it should take, though. A modal message box would irritate me. I'd prefer a less intrusive form of feedback.
Title: Re: ActiveX sample and news of A21
Post by: owenwengerd on February 08, 2010, 07:20:56 PM
Quote from: Fred Tomke on February 01, 2010, 07:37:43 AM
  • Normally I can get the event function name of an activated event by calling something like (dcl_control_getproperty oControl "Clicked"). To avoid globale variables I tried to get the EnterCell event function name of the FlexGrid control in the project. It returned nil and I cannot set another function name at runtime. I don't know whether it's a bug or not.

That's a bug, now fixed for the next build.
Title: Re: ActiveX sample and news of A21
Post by: owenwengerd on February 08, 2010, 09:41:11 PM
Quote from: Fred Tomke on February 01, 2010, 07:37:43 AM
Have a look at the function statusbar_text. There you can see a line  (dcl_AxObject_Get oPanel nil "Text"). If I call only (dcl_AxObject_Get oPanel "Text") instead then I get an error of too less arguments. I've found out that another argument must passed between control object and property name. The syntax in the control browser does not show this additional argument. Unfortunately, changing the text of the second panel has no effect. Maybe it is caused by the additional argument.

There was a bug in the argument processing code that caused it to skip an argument. That is now fixed for the next build. The oher problem is unrelated. I don't know why, but the control returns an error when attempting to set any properties (as evidenced by the dcl_AxObject_Put function returning NIL). The error is "parameter not found", but as best I can tell, everything is correct when the Invoke function is called.
Title: Re: ActiveX sample and news of A21
Post by: owenwengerd on February 08, 2010, 10:16:08 PM
Quote from: Fred Tomke on February 01, 2010, 07:37:43 AM
Some properties seem to be read-only although they're officially not. So I tried to make the vertical scrollbar of the richtext control visible. Maybe someone else has much more luck.

I had no luck making the property writeable (it retuns an exception saying that it's read-only -- probably because they don't allow that property to be changed after the control is visible), but while investigating this problem I figured out how to get the status bar panels working.
Title: Re: ActiveX sample and news of A21
Post by: owenwengerd on February 08, 2010, 11:02:43 PM
Quote from: Fred Tomke on February 01, 2010, 08:37:42 AM
Meanwhile I was searching for a reference sample you've mentioned in you sourceforge post. And I have found a method:
Item method of the IButtons collection of the toolbar. But the control browser show a very special data type: I also found a 'Variant but in this case there is a single ' .

This is now fixed for the next build.

Quote from: Fred Tomke on February 01, 2010, 08:37:42 AM
There is another thing left. Does anybody have experiences in linking a imagelist control to a control's imagelist property? My toolbar shows no images because I didn't linked a imagelist yet. Can I link it also at design time or only at runtime or even no time?

It doesn't look like there is any way to set that at design time. If there was some certain way to determine programmatically that the property expects an image list COM object, I could add code to create the image list at design time via the property wizard, but unlike fonts and colors, there doesn't seem to be any standard way to determine that for the e list property.