Passing full LPCSTR to C ++ dll from python text
I have a simple C ++ dll that calls MessageBox to display text
#include <Windows.h>
#define LIBDLL extern "C" __declspec(dllexport)
LIBDLL void Display(LPCTSTR lpInput) {
MessageBox(0, lpInput, 0, 0);
}
bool __stdcall DllMain(void* hModule, unsigned long dwReason, void* lpReserved) {
switch (dwReason)
{
case 1:
break;
case 0:
break;
case 2:
break;
case 3:
break;
}
return true;
}
And the Python code only passes the Display string to the DLL, it looks like
import ctypes
sampledll = ctypes.WinDLL('SampleDll.dll')
sampledll.Display('Some Text')
And it only displays the first letter even if I use std :: cout
How do I display all the text that I have passed to it?
+3
source to share