Here is my code:
#include "stdafx.h"
#include <Windows.h>
extern "C" int __stdcall myfunction ();
BOOL WINAPI DllMain ( HINSTANCE hin, DWORD reason, LPVOID lpvReserved );
int __stdcall myfunction ()
{
MessageBoxW(NULL,L"Question",L"Title",MB_OK);
return 0;
}
BOOL WINAPI DllMain ( HINSTANCE hin, DWORD reason, LPVOID lpvReserved )
{
return TRUE;
}
When i compile show these errors:
error LNK2028: reference to simbol (token) unresolved (0A000027) "extern "C" int stdcall MessageBoxW(struct HWND *,wchar_t const *,wchar_t const *,unsigned int)" (?MessageBoxW@@$$J216YGHPAUHWND__@@PB_W1I@Z) in the function "extern "C" int __stdcall myfunction(void)" (?myfunction@@$$J10YGHXZ)
error LNK2019: External symbol "extern "C" int stdcall MessageBoxW(struct HWND *,wchar_t const *,wchar_t const *,unsigned int)" (?MessageBoxW@@$$J216YGHPAUHWND__@@PB_W1I@Z) unresolved used in the function "extern "C" int __stdcall myfunction(void)" (?myfunction@@$$J10YGHXZ)
I dont understand where is the error and their cause. If someone can help me to fix it I will thanks alot :)