Jump to content

Plugin SDK Problem with VC++ 2010 Express


Recommended Posts

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.

Spoiler

"This then is the message which we have heard of him, and declare unto you, that God is light, and in him is no darkness at all. If we say that we have fellowship with him, and walk in darkness, we lie, and do not the truth: But if we walk in the light, as he is in the light, we have fellowship one with another, and the blood of Jesus Christ his Son cleanseth us from all sin. If we say that we have no sin, we deceive ourselves, and the truth is not in us. If we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness. If we say that we have not sinned, we make him a liar, and his word is not in us." (I John 1:5-10)

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Spoiler

"This then is the message which we have heard of him, and declare unto you, that God is light, and in him is no darkness at all. If we say that we have fellowship with him, and walk in darkness, we lie, and do not the truth: But if we walk in the light, as he is in the light, we have fellowship one with another, and the blood of Jesus Christ his Son cleanseth us from all sin. If we say that we have no sin, we deceive ourselves, and the truth is not in us. If we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness. If we say that we have not sinned, we make him a liar, and his word is not in us." (I John 1:5-10)

 

Link to comment
Share on other sites

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