Jump to content

Recommended Posts

Posted

I have just recently downloaded the AutoIt Plugin SDK, and have included the two files au3plugin.c and au3plugin.h in my VC++ 2010 Express project. I had expected it to compile, but it generated an error and it seemed that the cause was my mingling of C and C++ code. There were some resolutions to this problem on the web, but I could not succeed with any of them. Is there some way that I can still use C++ to implement my plugins? C is not suitable for me, and its stricter rules I don't like too much. I just want to use the C plugin functions in my C++ code. Is that possible? Thanks.

  Reveal hidden contents

 

Posted (edited)

C code compiles under C++ without modification. If you rename the file from .c to .cpp Visual Studio should stop complaining.

Clarification: C code compiles under C++ when the C++ compiler is written correctly. MVC++ can compile C just fine in my experience if you just rename it.

Edited by Richard Robertson
Posted

Thanks for the help, but now I have another problem.

Is it possible to access elements in an array from within a plugin, and to return arrays as well? This would work very well for my project, but I don't see anyway to do it.

  Reveal hidden contents

 

Posted

  On 8/15/2010 at 9:01 PM, 'WaitingForZion said:

Thanks for the help, but now I have another problem.

Is it possible to access elements in an array from within a plugin, and to return arrays as well? This would work very well for my project, but I don't see anyway to do it.

You can do it with DLLStructs. You can allocate the memory in your plugin, and pass on a pointer to it and it's size to AU3. The opposite would also work: create the DLLStruct in AutoIt, and pass your plugin a pointer to it so it can do the work.

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