I already spent whole day to trouble shoot this problem, but no luck yet. In my project, I set the Use of ATL property to Static Link to ATL on the General property page and set the Runtime Library property to Multi-threaded (/MT) on the Code Generation property page (C/C++ folder). However DependencyWalker still shows Atl71.dll dependency.
I googled and found this page http://www.eggheadcafe.com/forumarchives/vcatl/Mar2006/post26077463.asp with a solution of adding atlwin.h right after atlbase.h. This solution did help to reduce the dependency on atl71.dll. However it introduce a new problem, which is CreateWindow CAN NOT work correctly..
// Creates the Web Browser control and navigates to the
// specified web page.
HWND hWnd = ::CreateWindow("AtlAxWin", "http://www.microsoft.com",
WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL,
::GetModuleHandle(NULL), NULL);
The hwnd is NULL.
So the solution of adding atlwin.h can NOT be used, I wonder if anybody came across the similar static link problem before? How to resolve it?
Environment: VS 2003 .Net
Thanks!