Hello,
I have a DLL written in C, which I must use. It is ok, but in one place I get an error.
int getHourTime()
{
struct tm *psttm;
time_t timet = //is initialzed correctly
psttm = localtime(&timet);
int nHour = psttm->tm_hour;
return nHour;
}
I am calling it in C# using DLLImport. When getting to line: "psttm->tm_hour" I get an error (throw) that "Attempted to read or write to protected memory". I understand that it is because it returns a pointer to an inner place of struct tm, but how can I solve this?
Thanks