Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Dec 10, 2017 9:18 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How to refer to MD5Digest in plugin?
PostPosted: Thu Feb 21, 2008 4:15 pm 
Offline

Joined: Sat Oct 01, 2005 5:13 am
Posts: 603
Location: Shanghai, China
Thanks Aaron for explaining why MD5 method couldn't be loaded via REALLoadGlobalMethod. So I started trying MD5Digest class, but also fail.

In PluginEntry, I keep a refer of MD5Digest as the document said.
_myMD5Ref = REALGetClassRef("MD5Digest");


Plugin method
void myTest(void)
{
   REALobject md5 = REALnewInstance(_myMD5Ref);

   if (md5) {
      printf("OK!\n");
   } else {
      printf("Oops!\n");
   }
   
}


After I built the plugin and tested with RB, I found: the function point md5 is always NULL (and I couldn't find RBMD5.rbx_0.dylib in Framework folder of the app bundle), except I created a new instance in RB first:

Dim md5obj As New MD5Digest
MyPlugin.MD5Test

-- it works.

It seems that the internal plugin, RBMD5.rbx, hasn't been linked with the app.

_________________
ToringoCrypto Plugin - RSA (128 to 1024), DES/3DES/TDEA, etc.
ToringoDRMInfo Plugin - Uniquely identify computers via hardware information.
【My Company: Are you looking for someone to help you work on your projects?


Last edited by Zhu on Thu Feb 21, 2008 4:20 pm, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: How to refer to MD5Digest in plugin?
PostPosted: Thu Feb 21, 2008 4:16 pm 
Offline

Joined: Sat Oct 01, 2005 5:13 am
Posts: 603
Location: Shanghai, China
Is there anything I did which is not right? I tried to access FolderItem class in plugin and succeeded. However, it seems folderitem also resides in intrinsic framework.

_________________
ToringoCrypto Plugin - RSA (128 to 1024), DES/3DES/TDEA, etc.
ToringoDRMInfo Plugin - Uniquely identify computers via hardware information.
【My Company: Are you looking for someone to help you work on your projects?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Feb 21, 2008 5:33 pm 
Offline
User avatar

Joined: Wed Sep 28, 2005 8:39 am
Posts: 9341
Location: St Augusta, MN
The code you wrote appears to be correct. Calling REALGetClassRef should alert the compiler to not dead-strip out the call. It sounds like the compiler is ignoring plugins for some reason -- you should file (another) bug report about that.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 22, 2008 1:13 pm 
Offline
User avatar

Joined: Wed Sep 28, 2005 8:39 am
Posts: 9341
Location: St Augusta, MN
Well, there was a piece to that puzzle which was missing -- now that I've seen your bug report, I can tell you that there isn't actually a bug here. Just a simple misunderstanding.

You have to define at least one class within your plugin for dependency tracking of this variety. If your plugin exposes only modules (like yours does), there's no place for the IDE to generate a dependency tracker! Those can only be tracked in one of two ways: implicitly, from within a class and explicitly, by using the dependency as a parameter of some sort.

One thing which may work out for you is to make a property that is *private* on the module, whose type is MD5Digest. Like this:

{ "", "NotUsed", "MD5Digest", REALScopePrivate }

Add that property to the module, and it may be enough to trigger the depedency to be linked in. If that works for you, let me know.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 22, 2008 1:32 pm 
Offline
User avatar

Joined: Wed Sep 28, 2005 8:39 am
Posts: 9341
Location: St Augusta, MN
Hmm.. nevermind... I don't think that my workaround will actually work. The dead stripper will remove the dependency because nothing actually calls it. Basically -- you can't do this if your plugin contains only modules.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Feb 22, 2008 1:49 pm 
Offline

Joined: Sat Oct 01, 2005 5:13 am
Posts: 603
Location: Shanghai, China
:D Thank you for your explaining.

_________________
ToringoCrypto Plugin - RSA (128 to 1024), DES/3DES/TDEA, etc.
ToringoDRMInfo Plugin - Uniquely identify computers via hardware information.
【My Company: Are you looking for someone to help you work on your projects?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group