Xojo Conferences
XDCMay2019MiamiUSA

Why is wrapping necessary? (Real Studio Plugins Mailinglist archive)

Back to the thread list
Previous thread: TARGET MACOS missing
Next thread: Re: Need a little more string detail


Re: Plugins website   -   Troy A. Dix
  Why is wrapping necessary?   -   Theodore H. Smith
   Re: Why is wrapping necessary?   -   Christian Schmitz
    Re: Why is wrapping necessary?   -   Theodore H. Smith

Why is wrapping necessary?
Date: 07.06.02 13:28 (Fri, 7 Jun 2002 14:28:36 +0200)
From: Theodore H. Smith
To speed up getting and setting of string encodings, I cached the
function pointers into an extern variable in one of my .cpp files.
I wanted to get a fast way to get an encoding from inside RB.

I tried making a plugin REALmethodDefinition function that
simply links to that function, so RB will be directly calling
itself.

The result, is, a crash :o(

I tried wrapping the function like this:

long WrapGetStringEncoding(REALstring s) {
return (long)REALGetStringEncoding(s);
}

Works, but its lame. Why can't I stick REALGetStringEncoding into
my method definition instead of WrapGetStringEncoding?

I did this technique fine with OpenGL before! Instead of wrapping
hundreds of items, I just passed the pointers to the OpenGL
functions. Faster, and smaller, and easier to code. It was great.

Re: Why is wrapping necessary?
Date: 07.06.02 19:47 (Fri, 7 Jun 2002 20:47:18 +0200)
From: Christian Schmitz
> To speed up getting and setting of string encodings, I cached the
> function pointers into an extern variable in one of my .cpp files.
> I wanted to get a fast way to get an encoding from inside RB.

Why? The SDK itself has just a function pointer which is checked if it
should be loaded.

Mfg
Christian

Re: Why is wrapping necessary?
Date: 08.06.02 12:05 (Sat, 8 Jun 2002 13:05:38 +0200)
From: Theodore H. Smith
>> To speed up getting and setting of string encodings, I cached the
>> function pointers into an extern variable in one of my .cpp files.
>> I wanted to get a fast way to get an encoding from inside RB.
>
> Why? The SDK itself has just a function pointer which is checked if it
> should be loaded.

So I don't go through an extra method, and it's conditional code.