Xojo Conferences
XDCMay2019MiamiUSA

REALGetControlEnabled not working (Real Studio Plugins Mailinglist archive)

Back to the thread list
Previous thread: stack overflow - more!
Next thread: [ANN] GraphicsX 1.1


Re: [ANN] GraphicsX 1.1   -   Christian Schmitz
  REALGetControlEnabled not working   -   Will Cosgrove
   Re: REALGetControlEnabled not working   -   Chris Little
    Re: REALGetControlEnabled not working   -   Will Cosgrove
     Re: REALGetControlEnabled not working   -   Joseph J. Strout
     Re: REALGetControlEnabled not working   -   Peter Robinson

REALGetControlEnabled not working
Date: 24.09.02 17:10 (Tue, 24 Sep 2002 11:10:49 -0500)
From: Will Cosgrove
Hi All,
I just compiled one of my old plugins with the newest SDK and found out
that the call REALGetControlEnabled() doesn't work in the IDE or in the
IDE at runtime in RB 3.5 or 4.0, but it used to with the old SDK. The
only time it does work is in a compiled app. It always returns false
regardless of if the "enabled" checkbox is actually selected or not.

Can anyone else confirm this problem? This is a MAJOR problem for
people using the older versions of RB.

Thanks,
Will C.

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: REALGetControlEnabled not working
Date: 24.09.02 20:03 (Tue, 24 Sep 2002 15:03:05 -0400)
From: Chris Little
on 9/24/02 12:10 PM, Will Cosgrove at <email address removed> wrote:

> Hi All,
> I just compiled one of my old plugins with the newest SDK and found out
> that the call REALGetControlEnabled() doesn't work in the IDE or in the
> IDE at runtime in RB 3.5 or 4.0, but it used to with the old SDK. The
> only time it does work is in a compiled app. It always returns false
> regardless of if the "enabled" checkbox is actually selected or not.
>
> Can anyone else confirm this problem? This is a MAJOR problem for
> people using the older versions of RB.
>
> Thanks,
> Will C.

Will,

Peter Robinson did some research on this back in July. I couldn't come up
with a search using RS's search engine (I wish it would allow one keyword).

Chris

Here's the appropriate section of Peter's email,

I have now had time to look at this properly. It is definitely a bug
in the SDK, although it does not manifest itself with IDE version
4.5fc4 (it does in 4.01, which is what I am using normally).

Summary for those not interested in the gory details:
any plug-in built with SDK 4.5a.x that calls the C function
REALGetControlEnabled() will not work with IDE 4.01 or earlier.

To reproduce the bug, drop the (supplied binary) `DialControl
Plug-In' into the plug-ins folder of RB 4.0.1 (or earlier) and run
the corresponding example project `Dial Sample.rb'. The dial control
will never appear enabled and will not respond to clicks (although if
you use the focus button, it will respond to the keyboard).

The C function REALGetControlEnabled() from PluginMain.cpp has
changed as below (modulo line wrap)

------------- PluginMain.cpp SDK 4a1
Boolean REALGetControlEnabled(REALcontrolInstance instance)
{
static int (*pGetControlEnabled)(REALcontrolInstance, long);
if (!pGetControlEnabled)
pGetControlEnabled = (int (*)(REALcontrolInstance, long))
CallResolver("controlEnabledGetter");
return (Boolean)pGetControlEnabled(instance, 0);
}
------------- end

------------- PluginMain.cpp SDK 4.5a2
Boolean REALGetControlEnabled(REALcontrolInstance instance)
{
static Boolean (*pGetControlEnabled)(REALcontrolInstance) = nil;
if (!pGetControlEnabled)
pGetControlEnabled = (Boolean (*)(REALcontrolInstance))
CallResolver("REALGetControlEnabled");
if (pGetControlEnabled) return pGetControlEnabled(instance);
else return (Boolean)0;
}
------------- end

The trouble is that CallResolver("REALGetControlEnabled") returns nil
for RB 4.01 and presumably also for earlier versions of the IDE.
This means that any plug-in built with SDK 4.5a.x that calls the C
function REALGetControlEnabled() will not work with IDE 4.01 or
earlier.

I would like to REALbug this, with a fix, but I can't decide which
possible solutions is appropriate. Joe, why was this change made?
Is there any advantage of CallResolver("REALGetControlEnabled") over
CallResolver("controlEnabledGetter")---they both work with RB 4.5fc4.
What's the purpose of the extra zero parameter to
"controlEnabledGetter"?

If CallResolver("REALGetControlEnabled") really is better in a
non-trivial way, then the solution would be to have the SDK try
CallResolver("REALGetControlEnabled") first, and fall back to
CallResolver("controlEnabledGetter") if the former returned nil.

BTW, I am glad you added the extra check on the return value of
CallResolver.

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: REALGetControlEnabled not working
Date: 24.09.02 20:58 (Tue, 24 Sep 2002 14:58:49 -0500)
From: Will Cosgrove
Hola,
Thanks for the info Chris. Joe, could you tell us when the next
(hopefully fixed) version of the SDK is going to be out, or at least
give us more info on what you guys are planning to do about the problem?

Thanks,
Will C.

>> I just compiled one of my old plugins with the newest SDK and found
>> out
>> that the call REALGetControlEnabled() doesn't work in the IDE or in
>> the
>> IDE at runtime in RB 3.5 or 4.0, but it used to with the old SDK. The
>> only time it does work is in a compiled app. It always returns false
>> regardless of if the "enabled" checkbox is actually selected or not.
>>
>> Can anyone else confirm this problem? This is a MAJOR problem for
>> people using the older versions of RB.
>>
>> Thanks,
>> Will C.
>
> Will,
>
> Peter Robinson did some research on this back in July. I couldn't
> come up
> with a search using RS's search engine (I wish it would allow one
> keyword).
>
> Chris
>
> Here's the appropriate section of Peter's email,
>
> I have now had time to look at this properly. It is definitely a bug
> in the SDK, although it does not manifest itself with IDE version
> 4.5fc4 (it does in 4.01, which is what I am using normally).

[snip]

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: REALGetControlEnabled not working
Date: 24.09.02 21:08 (Tue, 24 Sep 2002 13:08:00 -0700)
From: Joseph J. Strout
At 2:58 PM -0500 9/24/02, Will Cosgrove wrote:

>Thanks for the info Chris. Joe, could you tell us when the next
>(hopefully fixed) version of the SDK is going to be out, or at least
>give us more info on what you guys are planning to do about the
>problem?

No, I'm sorry to say that I can't. I can't confirm (or deny) Peter's
analysis of the problem, or say when we might be able to do anything
about it.

Best,
- Joe

Re: REALGetControlEnabled not working
Date: 30.09.02 12:43 (Mon, 30 Sep 2002 12:43:13 +0100)
From: Peter Robinson
At 2:58 pm -0500 on 24/9/02, Will Cosgrove wrote:

>Joe, could you tell us when the next (hopefully fixed) version of
>the SDK is going to be out, or at least give us more info on what
>you guys are planning to do about the problem?

Will, can I suggest that you, or someone who this affects, resubmit
this as a bug using the new feedback system, in case it slips through
the net. I don't have a serial number for RB or I'd do it myself
(I'm only interested in plug-ins ATM).

Peter

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>