Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: x64 compiler warning



Permlink Replies: 1 - Last Post: Oct 17, 2016 7:48 AM Last Post By: Antonio Estevez
Istan Velo

Posts: 47
Registered: 3/2/02
x64 compiler warning
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 17, 2016 3:46 AM
First attempt retuns warning:
TResourceStream * res = new TResourceStream( (int)HInstance, "MYLOGO", L"MYDATA" ) ;

2nd attempt returns warning:
System::WideChar * str = L"MYDATA";
TResourceStream * res = new TResourceStream( (int)HInstance, "MYLOGO", str ) ;

3rd attempt fails:
const System::WideChar * str = L"MYDATA";
TResourceStream * res = new TResourceStream( (int)HInstance, "MYLOGO", str ) ;

4th attempt is ok:
const System::WideChar * str = L"MYDATA";
TResourceStream * res = new TResourceStream( (int)HInstance, "MYLOGO", (System::WideChar *) str ) ;

What an improvement!!
Antonio Estevez

Posts: 665
Registered: 4/12/00
Re: x64 compiler warning
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 17, 2016 7:48 AM   in response to: Istan Velo in response to: Istan Velo
El 17/10/2016 a las 12:46, Istan Velo escribió:
First attempt retuns warning:
TResourceStream * res = new TResourceStream( (int)HInstance, "MYLOGO", L"MYDATA" ) ;

2nd attempt returns warning:
System::WideChar * str = L"MYDATA";
TResourceStream * res = new TResourceStream( (int)HInstance, "MYLOGO", str ) ;

3rd attempt fails:
const System::WideChar * str = L"MYDATA";
TResourceStream * res = new TResourceStream( (int)HInstance, "MYLOGO", str ) ;

4th attempt is ok:
const System::WideChar * str = L"MYDATA";
TResourceStream * res = new TResourceStream( (int)HInstance, "MYLOGO", (System::WideChar *) str ) ;

What an improvement!!

You should typecast HInstance to NativeUInt intead of int

    TResourceStream * res = new TResourceStream( (NativeUInt)HInstance, 
"MYLOGO", (System::WideChar *) str ) ;


"int" is a 32-bit integer in both Win32 and Win64 platforms.

HInstance is a 64-bit integer in Win64 platform and a 32-bit integer in
Win32 platform.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02