[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-atl
Subject:    $)CRE: OT: What is wrong here (C++ question ).
From:       "$)CKen Perregaux" <kperregaux () MANTRASOFT ! COM>
Date:       2000-03-31 15:47:23
[Download RAW message or body]


 $)Cyou shouldn't have to cast it if you use an LPTSTR!

-----Original Message-----
From: ATL - Active Template Library [mailto:ATL@DISCUSS.MICROSOFT.COM]On
Behalf Of George Ter-Saakov
Sent: Friday, March 31, 2000 10:40 AM
To: ATL@DISCUSS.MICROSOFT.COM
Subject: Re: OT: What is wrong here (C++ question ).


Same error message.
I can get rid of this message by writing
LPCTSTR *ptr = const_cast<LPCTSTR*>(&bstrEvent);

I was trying to understand why I should use it.
George.

-----Original Message-----
From: Naz Quadri [mailto:naz_q@HOTMAIL.COM]
Sent: Friday, March 31, 2000 10:42 AM
To: ATL@DISCUSS.MICROSOFT.COM
Subject: Re: OT: What is wrong here (C++ question ).


Try to cast it as so  LPCTSTR *ptr = (LPCTSTR)&bstrEvent;

Naz
>From: George Ter-Saakov <gt-saakov@CARDONE.COM>
>Reply-To: ATL - Active Template Library <ATL@DISCUSS.MICROSOFT.COM>
>To: ATL@DISCUSS.MICROSOFT.COM
>Subject: OT: What is wrong here (C++ question ).
>Date: Fri, 31 Mar 2000 10:19:00 -0500
>
>Hi.
>
>I can not figured out what is wrong in this code.
>HRESULT LogEvent(BSTR bstrEvent)
>{
>         LPCTSTR *ptr = &bstrEvent;    //------ERR
>  ...
>}
>
>Compiler gives me an error
>error C2440: 'initializing' : cannot convert from 'unsigned short ** ' to
>'const unsigned short ** '
>
>I thought that it easy to convert from non const to const.
>
>
>George.
>
>----------------------------------------------------------------
>Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
>contains important info including how to unsubscribe.  Save time, search
>the archives at http://discuss.microsoft.com/archives/index.html

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
 $)Cthe archives at http://discuss.microsoft.com/archives/index.html

----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic