I have a ATL with dialog program, where the dialog consists of CTreeCtrl. When I declare a variable of HTREEITEM data type:

HTREEITEM hItem1;

Errors are shown as below:

C:\TestATL\MyDlg.h(60) : error C2501: 'HTREEITEM' : missing storage-class or type specifiers
C:\TestATL\MyDlg.h(60) : error C2501: 'hItem1' : missing storage-class or type specifiers
C:\TestATL\MyDlg.cpp(72) : error C2065: 'hItem1' : undeclared identifier


Hence, I included the afxcmn.h into the stdafx.h, and the error comes to this:

mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in TestATL.obj
mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in TestATL.obj; second definition ignored
Creating library Debug/TestATL.lib and object Debug/TestATL.exp
Debug/TestATL.dll : fatal error LNK1169: one or more multiply defined symbols found


Can anyone help??? Thank you.