Hello every body !
Few days back I have posted a problem regarding static variables in structure.
I have got solution for that problem.
But now I have new problem related to that.
It is as follow:
I am sending parameters from main CPP file to DLL cpp file.
But in DLL I am not able to get these parameters...
the code is as follow:
DLL file:
code:
Code:
//This is dll header file where structure is define
//dll.h
typedef struct{
static char szOriginalAddress[0x100];
static char szRecipientAddress[0x100];
static char szFileName[0x100];
}TExternalFilter;
EXPORT DWORD MerakFilterProc(TExternalFilter*);
//This is dll.cpp
#include "dll.h"
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}
char TExternalFilter::szOriginalAddress[0x100];
char TExternalFilter::szRecipientAddress[0x100];
char TExternalFilter::szFileName[0x100];
EXPORT DWORD MerakFilterProc(TExternalFilter*)
{
char temp1[256];
std:: string temp1;
strcpy(temp1,TExternalFilter::szOriginalAddress);
strcpy(temp2,TExternalFilter::szRecipientAddress);
strcpy(temp3,TExternalFilter::szFileName);
}
// I am not to fetch values here
Now this DLL is called by main CPP program which is as follow:
Code:
int main(int argc, char* argv[])
{
TExternalFilter ExternalFilter={"[email protected]","[email protected]","sdfsd"};
ch = MerakFilterProc(&ExternalFilter);
}
//This program call DLL and value return by DLL is recieved in ch
//but this is not working
Onething I want to clear that when I used char in place of static char then no
problem there,but I need solution with static char only.
so please help me..
Thanks
Bhagwat