I have a external DLL file with functions names as "Test123::MyFunction", the problem here is that i can call DLL names successfully if the name do not contains "::" character, how can i pass the full function name "Test123::MyFunction" in the DLL call?
Full soure code:
#include "pch.h"
#include <stdio.h>
#include <Windows.h>
#include <iostream>
int MyFunction(char* buf);
int main(int argc, char** argv)
{
/* get handle to dll */
HINSTANCE hGetProcIDDLL = LoadLibrary(L"CallMe.dll");
/* get pointer to the function in the dll*/
FARPROC lpfnGetProcessID = GetProcAddress(HMODULE(hGetProcIDDLL), "MyFunction"); // Here the name MyFunction should be Test123::MyFunction
typedef int(__stdcall * pICFUNC)(char *);
pICFUNC MyFunction;
MyFunction = pICFUNC(lpfnGetProcessID);
/* The actual call to the function contained in the dll */
int intMyReturnVal = MyFunction(argv[1]);
/* Release the Dll */
FreeLibrary(hGetProcIDDLL);
return intMyReturnVal;
/* The return val from the dll */
}
Thank you