Jump to content

Plugins (deprecated)


Jon
 Share

Recommended Posts

Read it here folks because it's not in the changelog:

Revision: 4365
Author: Valik
Date: 10:16:58 PM, Thursday, May 14, 2009
Message:
Fixed: PluginOpen() returns -1 on failure.
Changed: PlluginClose() now returns a boolean.
----
Modified : /trunk/autoit/src/script_process.cpp
Link to comment
Share on other sites

Read it here folks because it's not in the changelog:

Revision: 4365
Author: Valik
Date: 10:16:58 PM, Thursday, May 14, 2009
Message:
Fixed: PluginOpen() returns -1 on failure.
Changed: PlluginClose() now returns a boolean.
----
Modified : /trunk/autoit/src/script_process.cpp
Valik,

I wanted to personally thank you for working on the Plugin code. I know it may not have been much of your time, but I know your time is quite valuable so thank you.

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)

Link to comment
Share on other sites

  • 2 weeks later...

I'm going to sound like a n00b now, but how the fuck do I link to the plugin sdk?

My failing routine (Visual Studio 2008):

  • Creating a new Win32 Project with Dll as configuration type
  • Adding the AU3_PLUGIN_SDK folder to the projects additional include directories
  • Creating a new source file (main.cpp) and copying and pasting the contents of the sdk example in it.
  • Adding the plugin source file to my project (right click and choosing add->from existing item)
  • Compile
  • Link time -- > Unresolved external symbol error!

Going insane. I have an old project that compiles just fine, but I cannot remember how I configured it and I cannot see any differences from my above tactic.

Anothing thing, why does it work when I change configuration type to static library (.lib)?

Edited by monoceres

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

I'm going to sound like a n00b now, but how the fuck do I link to the plugin sdk?

My failing routine (Visual Studio 2008):

  • Creating a new Win32 Project with Dll as configuration type
  • Adding the AU3_PLUGIN_SDK folder to the projects additional include directories
  • Creating a new source file (main.cpp) and copying and pasting the contents of the sdk example in it.
  • Adding the plugin source file to my project (right click and choosing add->from existing item)
  • Compile
  • Link time -- > Unresolved external symbol error!

Going insane. I have an old project that compiles just fine, but I cannot remember how I configured it and I cannot see any differences from my above tactic.

Anothing thing, why does it work when I change configuration type to static library (.lib)?

I haven't used VS to compile it at all. I always used Code::Blocks. I don't have the computer I did that on in front of me to remember what I did.......hrm. Will try to figure it out when I get an extra moment to pull that computer out.

Thanks,

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)

Link to comment
Share on other sites

I thought the plugin SDK was a project? I think it was. I just made a copy of it and built right on top of it.

No, it's practically just au3plugin.c and au3plugin.h. There is a Dev-Cpp project included but that's kinda useless when you're using Visual Studio.

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Are you 200% sure you're actually compiling au3plugin.c as part of the project? You only showed linker output. Do a /rebuild and show the full output from that so we can see the compiled files, too.

Also, the reason it compiles as a static library is obvious: Libraries are compile-time files so the linker can resolve missing symbols in a library file. In other words, the linker doesn't know those symbols aren't missing intentionally to be resolved by another library somewhere when you attempt to use this library.

Link to comment
Share on other sites

Are you 200% sure you're actually compiling au3plugin.c as part of the project? You only showed linker output. Do a /rebuild and show the full output from that so we can see the compiled files, too.

No, however au3plugin.c do get listed when recompiling.

Full log:

http://monoceres.se/Uploads/fail/BuildLog2.htm

Also, the reason it compiles as a static library is obvious: Libraries are compile-time files so the linker can resolve missing symbols in a library file. In other words, the linker doesn't know those symbols aren't missing intentionally to be resolved by another library somewhere when you attempt to use this library.

Of course :)

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Hmph at knowing what was wrong all along. It's a linkage issue due to mixed C and C++. It's an SDK issue you can fix one of two ways. The way we'll fix it is to do the following:

#ifdef __cplusplus
extern "C" {
#endif  // C++
/* Helper functions for working with variant like variables */
AU3_PLUGIN_VAR *    AU3_AllocVar(void);
AU3_PLUGINAPI void  AU3_FreeVar(AU3_PLUGIN_VAR *pVar);
void                AU3_ResetVar(AU3_PLUGIN_VAR *pVar);
int                 AU3_GetType(const AU3_PLUGIN_VAR *pVar);
void                AU3_SetString(AU3_PLUGIN_VAR *pVar, const char *szString);
char *              AU3_GetString(const AU3_PLUGIN_VAR *pVar);
void                AU3_FreeString(char *szString);
void                AU3_SetInt32(AU3_PLUGIN_VAR *pVar, int nValue);
int                 AU3_GetInt32(const AU3_PLUGIN_VAR *pVar);
void                AU3_SetInt64(AU3_PLUGIN_VAR *pVar, __int64 n64Value);
__int64             AU3_GetInt64(const AU3_PLUGIN_VAR *pVar);
void                AU3_SetDouble(AU3_PLUGIN_VAR *pVar, double fValue);
double              AU3_GetDouble(const AU3_PLUGIN_VAR *pVar);
void                AU3_SethWnd(AU3_PLUGIN_VAR *pVar, HWND hWnd);
HWND                AU3_GethWnd(const AU3_PLUGIN_VAR *pVar);
int                 AU3_HexToDec(const char *szHex);
#ifdef __cplusplus
}
#endif  // C++

That will be fixed in the SDK shortly.

The alternative is to right-click au3plugin.c and change the "Compile as" option to C++ (it's C by default). I don't recommend this since you'll likely forget. Besides this is trivial to solve in the SDK itself.

Link to comment
Share on other sites

IIRC the SDK was written before AutoIt was UNICODE. It needs a lot of work and that is just one of the many things that it needs to better do.

Edited by Valik
Link to comment
Share on other sites

IIRC the SDK was written before AutoIt was UNICODE. It needs a lot of work and that is just one of the many things that it needs to better do.

Yes it was definitely written before AutoIt went UNICODE. It does need work. I would love to see this section completed. There are so many things that can now be done with Plugins, and I think it would help make many things quite powerful, and potentially quicker than some UDF's.

Till then, I sit with patience,

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)

Link to comment
Share on other sites

  • 2 weeks later...

I have updated the SDK download in the first post with a new version (SFX format instead of ZIP). The new version just fixes the C++ linkage issue.

Edited by Valik
Typo.
Link to comment
Share on other sites

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...