Click to See Complete Forum and Search --> : Thread function parameter


alberthyc
August 8th, 2007, 06:07 PM
i want to pass a struct as the parameter to my thread function.

typedef struct tagTHREADPARMS {
CWnd* pWnd;
CEvent* pKillEvent;
CEvent* pOutputEvent;
CMultithreadingTestDlg* pDlg;//error here
} THREADPARMS;

i got plenty of syntax errors, such as:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int


i found out that if i change CMultithreadingTestDlg* pDlg to CDialog* pDlg, the error is gone,

but i need a pointer to CMultithreadingTestDlg class, since i need the parameter in this class



any way to fix this?

MrViggy
August 8th, 2007, 06:37 PM
Include the header file that contains that class, or make a forward declaration. Is this typedef in a header file or source file?

If a header file, just put:
class CMultithreadingTestDlg;
above the typedef. If this is in source code, you can just include the header file for CMultithreadingTestDlg.

Viggy