Jump to content

Recommended Posts

Posted

Creating multilanguage assemblies is complicated. It requires compiling code to modules and then linking modules. The way managed C++ works is even more complicated and I'm not familiar with partially native, partially managed assemblies.

  • 5 months later...
Posted

Hmm... since October 18, the US preseidential election, economic turmoil, politics as usual, some screamingly bad TV programming, and not much else.

Try using the search function to find whatever it is you're looking for. Or hell, do as most others do and post in the help forum. Post exactly what you're trying to do, and any code you've already tried to do it with, and someone will most likely help you, or refer you to the information you need. This stomping around on random threads and whining doesn't do anyone any good.

  • 1 month later...
Posted

Just a quick question.

PluginOpen and PluginClose are no longer in the help file so that left me trying to determine what PluginOpen is supposed to return. I thought that it returned a handle but from what I can tell it always returns 0. VarGetType returns Int32. @error is 0 even if the plugin fails to load. If the script continues on, it ends prematurely with an "Unknown function name.:" error.

What is the proper way to check if the plugin loaded?

Posted (edited)

There are several plugins out already and others I'm sure will create more. Regardless of whether experimental or not, the question remains valid.

Edited by eltorro
Posted (edited)

I remember seeing that there is an Au3Check option for adding function names that don't exist... If you find it, add PluginOpen and PluginClose. As for the return value, I have no idea what is supposed to be returned.

If I'm completely wrong on that Au3Check option, I don't know, sorry.

Edited by Richard Robertson
Posted

Just a quick question.

PluginOpen and PluginClose are no longer in the help file so that left me trying to determine what PluginOpen is supposed to return. I thought that it returned a handle but from what I can tell it always returns 0. VarGetType returns Int32. @error is 0 even if the plugin fails to load. If the script continues on, it ends prematurely with an "Unknown function name.:" error.

What is the proper way to check if the plugin loaded?

Turn your brain on, please. If the function from the plugin is not found, then the plugin is not loading correctly. Hence the 0 return value. That's a really big duh right there and is worth about seven face-palms on your part. So figure out why the plugin isn't loading and solve that issue and I bet you'll magically have a non-zero return value and the function from the plugin will work. Amazing!
Posted

Here's the au3_check flag for plugin function names.

#AutoIt3Wrapper_plugin_funcs= _FuncOne, _FuncTwo, _FuncISkippedAFewTen, _FuncN, _FuncThaFunc, _PlayThatFuncyMusicWhiteboy

I too get a return of "0" for a loaded plugin, regardless of the plugin. I have several, just tested a bunch and they all return 0. However, the ones I tested all work, some written in FB, others c, others c++.

So, they work fine, but $plugin always returns 0, whether successful or not.

The following works whether you have a real "plugin.dll" or not.

$plugin = PluginOpen("plugin.dll")
MsgBox("0","wutsit", $plugin)

It hard crashes on load failure (wrong dll name) or using a nonexistent function (wrong function name.) In each case it returns "ERROR: _SomeFunc(): undefined function"

Posted

We are probably not going to use the PluginOpen/Close syntax in favour of a #plugin directive at the top of the script which will have some additional benefits especially with compiled scripts. The PluginOpen thing is just for easy testing of the DLL part to make sure that the concept works.

It looks like PluginOpen wasn't intended as the ultimate solution, so probably wasn't written with robust debugging or returns in place.

http://www.autoitscript.com/trac/autoit/ticket/263

Maybe instead of the #import directive, it might be easier to return 1 for valid load of a plugin, 0 for fail. Then the current solution would be working as intended, and the directive system could be put off until there's time or need for it?

Either way, its just a convenience for those of us using plugins, as it all still works, it just doesn't tell us explicitly.

Posted

Bleh, I should punch Jon in the soul. You're both wrong but it's not obvious. The first handle is 0, the next is 1 and so forth. Just like FileOpen(). It's a stupid system (handle should have been arbitrary or should have started at one). The problem is PluginOpen() returns 0 for failure, too, instead of the convention of -1. I'll change it to -1 tomorrow or whenever I remember. So in 3.3.1.0 it will return -1 on failure and >= 0 on success.

Posted

Valik,

Thanks for the update on that. I am still quite excited about Plugin's being able to more fully access AutoIt's capabilities, and this is one step in the right direction.

Jarvis

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)

  • Moderators
Posted

Bleh, I should punch Jon in the soul. You're both wrong but it's not obvious. The first handle is 0, the next is 1 and so forth. Just like FileOpen(). It's a stupid system (handle should have been arbitrary or should have started at one). The problem is PluginOpen() returns 0 for failure, too, instead of the convention of -1. I'll change it to -1 tomorrow or whenever I remember. So in 3.3.1.0 it will return -1 on failure and >= 0 on success.

While you're at it... could you make it return arrays as well? :)

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.

  • Moderators
Posted

Why would PluginOpen return an array?

It wouldn't Richard :) . He's already fixing the PluginOpen() issue.

I threw a bit of sarcasm his way to fix the other issues that some of the users requested.

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.

Posted

Bleh, I should punch Jon in the soul. You're both wrong but it's not obvious. The first handle is 0, the next is 1 and so forth. Just like FileOpen(). It's a stupid system (handle should have been arbitrary or should have started at one). The problem is PluginOpen() returns 0 for failure, too, instead of the convention of -1. I'll change it to -1 tomorrow or whenever I remember. So in 3.3.1.0 it will return -1 on failure and >= 0 on success.

Thanks Valik.

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
  • Recently Browsing   0 members

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