Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost.tuple] issue
From: Sean Farrow (sean.farrow_at_[hidden])
Date: 2010-07-04 10:14:28

Hi Neils:
The code of the function is:
boost::tuple<bool, HWND> Speech::CheckWindowExists(std::wstring
WindowName, std::wstring WindowClass)
        HWND TempWindow;
LPCTSTR WndClass, WndName =NULL;
if (WindowClass.length() >0 )
WndClass =WindowClass.c_str();
if (WindowName.length() >0)
WndName =WindowName.c_str();
TempWindow =FindWindow(WndClass, WndName);
if (TempWindow ==NULL)
return boost::make_tuple(false, NULL);
return boost::make_tuple(true, TempWindow);
And the errors are:
error C2440: 'initializing' : cannot convert from 'const int' to 'HWND__
*' tuple_basic.hpp 451 Speech
error C2439: 'boost::tuples::cons<HT,TT>::head' : member could not be
initialized tuple_basic.hpp 451
Hope this helps diagnose the problem.
-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Niels Dekker -
address until 2010-10-10
Sent: 04 July 2010 15:00
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [boost.tuple] issue

On 2010-07-04-Sun 15:18, Sean Farrow wrote:
> I've got a tuple defined as:
> Boost::tuple<bool, HWND>
> And when I do:
> Boost::make_tuple(true, TempWindow);
> I get the error
> C2440 cannot convert from int to hwnd__*
> Anyone got any ideas?
> Visual c++ 2008, and boost 1.43.

I guess the type of your TempWindow might not be HWND...?

Otherwise maybe you should post a code snippet to clarify what you're
trying to compile!



Niels Dekker
Scientific programmer at LKEB, Leiden University Medical Center
Boost-users mailing list

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at