Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

using my dll in autohotkey


  • Please log in to reply
3 replies to this topic
Pein
  • Members
  • 4 posts
  • Last active: Aug 16 2014 11:38 AM
  • Joined: 15 Aug 2014

I created some dll in C++
Now I want use this dll in autohotkey script
this is a header of function in dll:

extern "C" _declspec(dllexport) int ProcessData(float begin, float end, int typeOfInterpolation, std::string fileName);

I try to use this function in autohotkey script:

 
Result := DllCall("MyDll\ProcessData", float, 0.0, float, 475.0, int, 1, str, "test.txt")
 
but it don't work
How I can fix it?

 



nnnik
  • Members
  • 1625 posts
  • Last active: Jan 24 2019 02:19 PM
  • Joined: 28 Jul 2012
The problem is that part:
std::string fileName
You have to pass a std::string obj, However Autohotkey passes an char* or wchar_t* depending on the Autohotkey build.
You will need to change your function.

Visit the new forum ahkscript.org.

http://ahkscript.org


Pein
  • Members
  • 4 posts
  • Last active: Aug 16 2014 11:38 AM
  • Joined: 15 Aug 2014

What you mean?
I try this:

extern "C" _declspec(dllexport) int ProcessData(float begin, float end, int typeOfInterpolation, char* fileName);

but ErrorLevel is -1



Pein
  • Members
  • 4 posts
  • Last active: Aug 16 2014 11:38 AM
  • Joined: 15 Aug 2014

I fixed it) Thanks)