Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > General Discussion
  New Posts New Posts RSS Feed - Consistency of "Cancel" parameter in events
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Consistency of "Cancel" parameter in events

 Post Reply Post Reply
Author
Message
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post Topic: Consistency of "Cancel" parameter in events
    Posted: 16 March 2011 at 12:40pm
Hi,

In some CJ events there is a parameter, usualy called "Cancel", that allow us to cancel a operation.
This parameter is, in the majority of the cases, a boolean, but in some cases is a "Variant". When it happens the operation is never canceled when I change the parameter value to TRUE, and I need to wrap the control in VB6 to change the parameter type to boolean. Ermm

I believe that there isn't a real reason to define the "Cancel" parameter as a Variant, and it's just a programmer decision at the moment.

There are only a few cases in just a few CJ Controls (KeyBindings, TabControl, TabToolbar, PropertyGrid, ReportControl and TrackControl). In all other cases the parameter is properly defined as a boolean.

As I don't think I'm the only one (potentially) having problems with this, do you think it's possible to change it in the future?

Thank you
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2011 at 2:20am
Never tried Visual Objects, but maybe you need something Cancel = VARIANT_TRUE or something like that ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2011 at 6:56am
Thanks for replying so fast

Yes, I'm sure the problem is in Visual Objects side as it doesn't support the VB variant type, but it's more or less common with non MS languages, I believe.

Still, unless there's a reason to not do so, it seems logical that the Cancel parameter should be always a boolean for product consistency, efficiency and performance.
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2011 at 8:30am
still please try VARIANT_TRUE or ((VARIANT_BOOL)0xffff)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2011 at 2:56pm
Originally posted by oleg oleg wrote:

still please try VARIANT_TRUE or ((VARIANT_BOOL)0xffff)

I don't have that, but I will investigate.

Thanks
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8
Back to Top
Carlos Rocha View Drop Down
Groupie
Groupie


Joined: 11 February 2008
Location: Portugal
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carlos Rocha Quote  Post ReplyReply Direct Link To This Post Posted: 19 March 2011 at 10:52pm
Originally posted by Carlos Rocha Carlos Rocha wrote:

Originally posted by oleg oleg wrote:

still please try VARIANT_TRUE or ((VARIANT_BOOL)0xffff)

I don't have that, but I will investigate.

Thanks

It doesn't work. Besides, nothing works. 
Visual Objects transforms the parameter in an internal type, named USUAL, with half the struct VARIANT size. I can't even cast it. I was able to create a Variant in my side and assign 0xfff to it, but I can't replace the parameter with it Ouch

Maybe someday you'll define those Cancel as boolean Approve

SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.