I'm trying to make a multithreaded program.
I can compile it successfully, but my program always crashes.
Here is my code snippet :
// in global declaration
typedef struct MyData {
int nSumber;
char *szFileName;
} MYDATA, *PMYDATA;
PMYDATA pData[MAX_THREAD];
// in my OpenDialog function
OPENFILENAME ofn;
char szFile[MAX_PATH];
ofn.lpstrFile = szFile;
ofn.lpstrFile[0] = '\0';
if(GetOpenFileName(&ofn))
// I think this line that makes my program crash
pData[0]->szFileName = ofn.lpstrFile;
Am I doing it wrong?
Thanks in advance!