I need to convert the image to hex after getting the image(not image file) on the screen.
Since the Autohotkey does not have this function, i'd like to make a dll file of c++ which contains a function that gets a hex from screen image
The problem I face is two things.
1. How to create a function to convert a screen image directly into hex without creating an image file in c++ win32 programming environment
I got a part of the script that was suitable for my purpose through search on various websites. But I don't know where to put this script in win32 programming environment.
There are Winmain and wndproc, where should I insert my script?
2. How can I make it a dll file if all the scripts fit my purpose?
My script environment is not console c++ but win32 project. in this situation, How can l create a dll file?
please help me
[C++]Create a dll file with a function that I want to have
- Delta Pythagorean
- Posts: 628
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: [C++]Create a dll file with a function that I want to have
Instead of C++, I suggest to use C#
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
Re: [C++]Create a dll file with a function that I want to have
Why do you recommend c#? I know that c# is incompatible with AutoHotkey.
At first, I also created a dll file with c#, but dll file made by c# is not called by dllcall function in Autohotkey.
So I tried a simple test to call very simple C# dll file that have a function that value of return is String variable of "abcdef12345"
then I called a my dll file by means of dllcall function in Autohotkey but it is not called
it is my dll file script for test
Below are the ways I tried to call my dll file
dllcall("Mydll.dll\ScreenShot")
dllcall("Mydll.dll\ScreenShot","Str")
dllcall("Mydll.dll\ScreenShot","Cdecl Str")
dllcall("Mydll.dll\ScreenShot","Ptr")
dllcall("Mydll.dll\ScreenShot","Cdecl Str")
dllcall("Mydll.dll\ScreenShot","AStr")
dllcall("Mydll.dll\ScreenShot","WStr")
dllcall("Mydll.dll\ScreenShot","Cdecl AStr")
dllcall("Mydll.dll\ScreenShot","Cdecl WStr")
At first, I also created a dll file with c#, but dll file made by c# is not called by dllcall function in Autohotkey.
So I tried a simple test to call very simple C# dll file that have a function that value of return is String variable of "abcdef12345"
then I called a my dll file by means of dllcall function in Autohotkey but it is not called
it is my dll file script for test
Code: Select all
namespace Mydll
{
public class MyClass
{
public string MyFunct()
{
string res = "0E154324D324321"; //I made a very simple function for testing purpose
return res;
}
}
}
Below are the ways I tried to call my dll file
dllcall("Mydll.dll\ScreenShot")
dllcall("Mydll.dll\ScreenShot","Str")
dllcall("Mydll.dll\ScreenShot","Cdecl Str")
dllcall("Mydll.dll\ScreenShot","Ptr")
dllcall("Mydll.dll\ScreenShot","Cdecl Str")
dllcall("Mydll.dll\ScreenShot","AStr")
dllcall("Mydll.dll\ScreenShot","WStr")
dllcall("Mydll.dll\ScreenShot","Cdecl AStr")
dllcall("Mydll.dll\ScreenShot","Cdecl WStr")
Re: [C++]Create a dll file with a function that I want to have
For doing something like this in AHK, this might be useful:
Gdip: image binary data to hex string for OCR - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=35339
And then, if something like that works for you, you could try to convert it to C++.
Gdip: image binary data to hex string for OCR - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=35339
And then, if something like that works for you, you could try to convert it to C++.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: [C++]Create a dll file with a function that I want to have
Here’s something in C, that I’ve used with ahk.
https://github.com/joedf/Qonsole/blob/m ... /SizeCon.c
https://github.com/joedf/Qonsole/blob/m ... /SizeCon.c
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Who is online
Users browsing this forum: No registered users and 12 guests