Skip to content

Instantly share code, notes, and snippets.

@LivingInSyn
Created May 30, 2018 16:20
Show Gist options
  • Save LivingInSyn/ee19783b5eb848317440e1dd50860a94 to your computer and use it in GitHub Desktop.
Save LivingInSyn/ee19783b5eb848317440e1dd50860a94 to your computer and use it in GitHub Desktop.
#include "stdafx.h"
#include "TranslateOutput.h"
typedef SomeStruct(CALLBACK* GetSomeStructType)();
int main()
{
HINSTANCE dllHandle = NULL;
dllHandle = LoadLibrary(L"translator_test.dll");
GetSomeStructType GetSomeStructPtr = NULL;
if (dllHandle != NULL)
{
GetSomeStructPtr = (GetSomeStructType)GetProcAddress(dllHandle, "GetSomeStruct");
SomeStruct somestruct = GetSomeStructPtr();
printf("Val of foo is %d", somestruct.foo);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment