Hello , once again i need some help.
So i have few dlls in one solution each of them exports some functions , which are declared with
extern "C" <type> __stdcall <name>(<params>)
and each of them uses .def file for the exports.
The pointers are
typedef <type> (CALLBACK * <name> )(<type of params>)
The problem is with one of the dlls , which are loaded with LoadLibrary.
I know the signatures of the functions ,i use GetProcAddress() , i used the right number and types of paramethers , no errors are thrown but the functions of the dll arent't executed. The other which are using the same methods of creating function pointers and using them described above are working properly.
Because i have some old versions of the dlls i used dumpbin /export and i saw something strange.
In the older version of the dll there is a
name of the function = @ILT+some number(_name of the function@number)
and for the new dll i see only <name of="" the="" function=""> without the rest
I know that the function pointer should get that _name of the function @ number which is some encoding of the function's name in the memory but it doesn't.
I think maybe i did something wrong with the creation of the dll maybe a option or something but i have no idea what .
Any ideas are welcome.
Thanks a lot for the help ... again :)
P.S
When i checked the dll with dumpbin /headers i noticed that 2 header sections are missing : .idata and .textbss can someone give me more info about what exactly is a header in a dll and how should it be created
P.S 2
HMODULE hDllHandle = LoadLibrary(TEXT(strDllName));
if (hDllHandle != NULL)
{
PFuncA pFunctionA = (PFuncA)GetProcAddress(hDllHandle, TEXT("FunctionA"));
DWORD errSetParam = GetLastError();
PFuncB pFunctionB = (PFuncB)GetProcAddress(hDllHandle, TEXT("FunctionB"));
DWORD errExecute = GetLastError();
ASSERT(pFunctionA != NULL);
ASSERT(pFunctionB != NULL);
pFunctionA((char* const)ParamName.GetString(), (char* const)ParamValue.GetString());
nFileUpdated = pFunctionB((char* const) param1.GetString(),(char* const)param2.GetString(), (char* const)param3.GetString(),(char* const)param4.GetString(),(char* const)param5.GetString(),
(char* const)param6.GetString(),(char* const)param7.GetString(),(char* const)param8.GetString(),param9);
typedef int (CALLBACK* PFuncA)(LPCSTR, LPCSTR);
typedef int (CALLBACK* PFuncB) (LPCSTR, LPCSTR, LPCSTR, \
LPCSTR, LPCSTR, \
LPCSTR, LPCSTR, LPCSTR, bool);
}