You have to use “extern “C” __declspec(dllexport)” before void to make it for export.
C++ code:
int WINAPI MessageBox(
_In_opt_ HWND hWnd,
_In_opt_ LPCTSTR lpText,
_In_opt_ LPCTSTR lpCaption,
_In_ UINT uType
);
extern “C” __declspec(dllexport) void MsgBox()
{
MessageBox(NULL,TEXT(“LOL”), TEXT(“LEL”),0x00000000L);
}
С# Code:
[DllImport(“MessageBoxShow.dll”, CharSet = CharSet.Unicode)]
public static extern void MessageBoxShow();
private void button1_Click(object sender, EventArgs e)
{
MessageBoxShow();
}
Nguồn:https://wijstaanvooronzegrondrechten.org/
В моем случаи пришлось делать так:
[DllImport("DllName", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
Thanks.. спасибо брат
Thanks!
Super tutorial, Thanks!
This would have been more useful if we saw a string being passed in from the C# side.
music links?
Oh my god. The music scared the shit out of me.
music?
Thanks. It worked for me.
MAGICALLY CODE APPEARS.