Jump to content

Plugins (deprecated)


Jon
 Share

Recommended Posts

Is it possible for the Plugin functions to recive the values directly instead of having to recieve an array of Variants?

???

#)

Link to comment
Share on other sites

Nevermind... I just had a solution:

CUT CODE:

AU3_PLUGIN_DEFINE(MyFunc){
   AU3_PLUGIN_VAR   *pMyResult;
   char * result = MyFunc_Actual(AU3_GetString(&p_AU3_Params[0]),AU3_GetString(&p_AU3_Params[1]));
   pMyResult = AU3_AllocVar();
   AU3_SetString(pMyResult, result);
   *p_AU3_Result        = pMyResult;
   *n_AU3_ErrorCode = 0;
   *n_AU3_ExtCode       = 0;
   return AU3_PLUGIN_OK;
}
char * MyFunc_Actual(char* a, char* b){
   //..do stuff with aand b...
}

simple.. actually, (why didn't i think of that earlier?)

#)

Edited by nfwu
Link to comment
Share on other sites

Why not just pass the Result, Error, and Exit codes by reference to the second function? Faster exec and better handling of the other variables (error, exit) when using that second function.

If you do it by passing the references, you won't have to return a value either. Maybe it's just me, I like to not have to pass much stuff back (usually just menus or searches)

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

  • 1 month later...

I dont know if this is a bug or not, that is why I submitted it here...

Please check out the following:

http://www.autoitscript.com/forum/index.ph...ic=21010&st=45#

And read to the end of the topic.

Basically on the plugin for my MD5 Hash, someone was using FileOpenDialog() to get the $fileName filled. For it to not error out the FileOpenDialog had to be inside PluginOpen(). This seems like a bug as I can manually set a path inside or outside the PluginOpen() and it will work just like normal.

Please advise,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

FileOpenDialog() changes the working directory, so the relative addressing used for PluginOpen() would fail. To avoid, use PluginOpen() at the top of the script before FileOpenDialog() is used.

Edited by MHz
Link to comment
Share on other sites

FileOpenDialog() changes the working directory, so the relative addressing used for PluginOpen() would fail. To avoid, use PluginOpen() at the top of the script before FileOpenDialog() is used.

Oh okay... I see... Thanks for explaining that. I didnt realize FileOpenDialog() did that.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

  • 3 weeks later...

Will be in release version of AutoIt (which perhaps will be soon) changed PluginOpen syntax to #plugin type directive as Jon said?

Perhaps not in the next release still some work to finalize :)
Link to comment
Share on other sites

Hi all !

I am currently learning to program in C and was playing around with the sdk and the included example. I have successfully returned strings and integers from C to AutoIT, but what about data that has zero bytes (BinaryString) ? Is it possible with the current functions from the sdk to pass a 'BinaryString' to AutoIT or does the sdk need nother function like AU3_SetBinaryString for it to work ? Obiously, when I use the AU3_SetString function my data gets truncated where the first zero byte occurs. Can someone clear things up for me a bit please ?

- Daniel

Link to comment
Share on other sites

  • 2 weeks later...

Hi Jon !

I tried with the SDK, the latest DevC++ (4.9.9.2) and AU v3.1.1.122, the sample code doesn't work :D

The compiled dll seems OK.

AutoIt Code :

$handle = PluginOpen("example.dll")
$retval = PluginFunc1("Hello", "Test") 
msgbox(0,"",$retval)
PluginClose($handle)

The answer :

exemple.au3(2,38) : ERROR: PluginFunc1(): undefined function.

Is the SDK the latest version ??

Or where can I find it ?

Thanks !

Apzo.

Link to comment
Share on other sites

Hi Jon !

I tried with the SDK, the latest DevC++ (4.9.9.2) and AU v3.1.1.122, the sample code doesn't work :D

The compiled dll seems OK.

AutoIt Code :

$handle = PluginOpen("example.dll")
$retval = PluginFunc1("Hello", "Test") 
msgbox(0,"",$retval)
PluginClose($handle)

The answer :

exemple.au3(2,38) : ERROR: PluginFunc1(): undefined function.

Is the SDK the latest version ??

Or where can I find it ?

Thanks !

Apzo.

Apzo,

Glad to see you are interested in plugins they are quite useful and handy.

One thing one must do is first off use the beta of AutoIt v3. Another thing to do is include "#compiler_plugin_funcs = PluginFunc1" If you have more than one seperate them with a comma. That way AutoIt will know where the functions are to be found.

Let me know if I can further assist you.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Apzo,

Glad to see you are interested in plugins they are quite useful and handy.

One thing one must do is first off use the beta of AutoIt v3. Another thing to do is include "#compiler_plugin_funcs = PluginFunc1" If you have more than one seperate them with a comma. That way AutoIt will know where the functions are to be found.

Let me know if I can further assist you.

JS

JS, that is not an AutoIt pre-processor statement. That is for Au3Check, it has no affect on AutoIt.
Link to comment
Share on other sites

JS, that is not an AutoIt pre-processor statement. That is for Au3Check, it has no affect on AutoIt.

My mistake. Thanks for the pointer.

@Apzo

Are you using SciTE4AutoIt3?

Are you using AutoIt3 Beta Edition?

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

  • Moderators

@Apzo... are you spelling example wrong on the example?

Edit:

P.S. - This is just a stab in the dark, because I noticed your dll was named example.dll and your .au3 was exemple.au3.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Hello again, and thanks for your responses :D

I found my problem, the code is good BUT does not work when launched from Scite :D

(even with the latest beta version).

Run from right mouse click and compilation does it right.

BTW is it possible to return a net socket from a DLL ?

Many thanks again, plugins are really a great feature !!!

Apzo.

Link to comment
Share on other sites

Hello again, and thanks for your responses :D

I found my problem, the code is good BUT does not work when launched from Scite :D

(even with the latest beta version).

Apzo.

I suspect that's because AutoIt is looking for the DLL in the current working directory instead of relative to the script directory.

Oh no. As JS pointed out; Scite does not continue because Au3Check returns a warning/error.

Edited by SlimShady
Link to comment
Share on other sites

  • 3 weeks later...

I wanted to point out that instead of using Dev's C++ I tried using Code::Blocks, and the Plugin architecture compiled without errors or warnings.

I am going to try to compile the source using the Dev's project file, and see how it works, we may need to offer the source using the Code::Blocks project file because it can use so many different compilers and it is open source.

Just wanted to let everyone know.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

  • 2 weeks later...

QUOTE(Holger @ Aug 31 2005, 03:36 PM)

@Jon: don't know if it is right positioned in Idealab but if this "plugin"-functionality works and is ready so far (with the #plugin) then maybe there should be a new forum entry like "Plugins" where everyone can post her/his plugins.

@Jon: An extra forum for plug-ins would a good idea.

Cheers

Kurt

I think that DLL plugins which are ready for use could be accessible from one point for end users

1) maybe like in extra forum for ready plugins

2) or in Downloads section of autoit3 web pages

3) or in new Plugins directory (or Extras/Plugins or Include/Plugins) in AutoIt instal package (like au3 UDFs in Include directory)

4) or somewhere else ...

Now when new release version of Autoit is comming, it would be good to collect best DLL plugins and place them somewhere :D

I would prefer:

method 2) and 3) use for best plugins

method 1) use for share/discus/support/source of all plugins

Edited by Zedna
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...