1
votes

I am migrating my C++ ATL Executable application from VS2003 to VS2013.

In VS 2003

class CExeModule : public CComModule

In VS2013 (its been changed to)

class CExeModule : public ATL::CAtlExeModuleT< CExeModule >

I have successfully migrated the project, during compilation i am facing a issue

**

error C2664: 'ATL::CHandle::CHandle(HANDLE) throw()' : cannot convert argument 1 from 'bool' to 'ATL::CHandle &'

**

I don't get this error if i comment the following code

_AtlModule.WinMain(nShowCmd);

Can someone help here to solve this error ?

Additional info

C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlbase.h(3628): error C2664: 'ATL::CHandle::CHandle(HANDLE) throw()' : cannot convert argument 1 from 'bool' to 'ATL::CHandle &' C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlbase.h(3608) : while compiling class template member function 'HRESULT ATL::CAtlExeModuleT::PreMessageLoop(int) throw()' C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\include\atlbase.h(3695) : see reference to function template instantiation 'HRESULT ATL::CAtlExeModuleT::PreMessageLoop(int) throw()' being compiled

stdafx.h(107) : see reference to class template instantiation 'ATL::CAtlExeModuleT' being compiled

1
I suppose the problem is in your CExeModule::PreMessageLoop which you don't show.Roman R.
I do not have any PreMessageLoop in my code...that is where i am surprised ...Coder Coder
Something else then interferes (some header included in stdafx.h or else where etc). You could create a clean ATL EXE project in VS2013 to make sure it build, and it is known to be buildable fine. The line with WinMain includes a chain of calls in this class which eventually hits a collision. I don't think the line is bad on its own (looks good).Roman R.
Yes, i tried the same by creating a new ATL project in VS2013 , and found it is building fine (without adding any new code). and the line has nothing wrong "_AtlModule.WinMain(nShowCmd);"Coder Coder
The line it's choking on is CHandle h(pT->StartMonitor()); Does CExeModule have a method StartMonitor returning bool, by any chance? Another possibility - do you maybe have a macro or a typedef redefining HANDLE somewhere in your program? Also check preprocessor definitions in project properties.Igor Tandetnik

1 Answers

0
votes

Thanks Igor Tandetnik....

I solved the issue after changing the function name in the class CExeModule bool StratMonitor()