Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to draw line by dragging mouse inside rectangle in dialog based application in vc++,mfc Pin
prerananit6-Oct-09 22:31
prerananit6-Oct-09 22:31 
QuestionRe: how to draw line by dragging mouse inside rectangle in dialog based application in vc++,mfc Pin
CPallini6-Oct-09 22:47
mveCPallini6-Oct-09 22:47 
AnswerRe: how to draw line by dragging mouse inside rectangle in dialog based application in vc++,mfc Pin
wangningyu6-Oct-09 22:52
wangningyu6-Oct-09 22:52 
GeneralRe: how to draw line by dragging mouse inside rectangle in dialog based application in vc++,mfc Pin
CPallini6-Oct-09 22:58
mveCPallini6-Oct-09 22:58 
QuestionHow to load the Url Image ? Pin
wangningyu6-Oct-09 22:24
wangningyu6-Oct-09 22:24 
AnswerRe: How to load the Url Image ? Pin
Iain Clarke, Warrior Programmer6-Oct-09 22:57
Iain Clarke, Warrior Programmer6-Oct-09 22:57 
Questionconvert const wchar* to const byte* Pin
Rakesh56-Oct-09 22:02
Rakesh56-Oct-09 22:02 
AnswerRe: convert const wchar* to const byte* Pin
Cedric Moonen6-Oct-09 22:18
Cedric Moonen6-Oct-09 22:18 
AnswerRe: convert const wchar* to const byte* Pin
CPallini6-Oct-09 22:45
mveCPallini6-Oct-09 22:45 
GeneralRe: convert const wchar* to const byte* Pin
Rakesh56-Oct-09 23:07
Rakesh56-Oct-09 23:07 
GeneralRe: convert const wchar* to const byte* Pin
Rajesh R Subramanian6-Oct-09 23:26
professionalRajesh R Subramanian6-Oct-09 23:26 
GeneralRe: convert const wchar* to const byte* Pin
CPallini6-Oct-09 23:43
mveCPallini6-Oct-09 23:43 
GeneralRe: convert const wchar* to const byte* Pin
Rajesh R Subramanian6-Oct-09 23:49
professionalRajesh R Subramanian6-Oct-09 23:49 
AnswerRe: convert const wchar* to const byte* Pin
Rajesh R Subramanian6-Oct-09 23:21
professionalRajesh R Subramanian6-Oct-09 23:21 
GeneralRe: convert const wchar* to const byte* Pin
Rakesh56-Oct-09 23:39
Rakesh56-Oct-09 23:39 
QuestionRe: convert const wchar* to const byte* Pin
Rajesh R Subramanian6-Oct-09 23:43
professionalRajesh R Subramanian6-Oct-09 23:43 
AnswerRe: convert const wchar* to const byte* Pin
Rakesh57-Oct-09 0:00
Rakesh57-Oct-09 0:00 
GeneralRe: convert const wchar* to const byte* Pin
CPallini7-Oct-09 0:28
mveCPallini7-Oct-09 0:28 
GeneralRe: convert const wchar* to const byte* Pin
Rakesh57-Oct-09 2:08
Rakesh57-Oct-09 2:08 
GeneralRe: convert const wchar* to const byte* Pin
CPallini7-Oct-09 2:16
mveCPallini7-Oct-09 2:16 
GeneralRe: convert const wchar* to const byte* Pin
Rajesh R Subramanian7-Oct-09 0:29
professionalRajesh R Subramanian7-Oct-09 0:29 
A BYTE is an 8 bit data type. A WCHAR is a 16 bit data type.

Now, you can cast a BYTE pointer to a WCHAR pointer or vice versa. However, since these data types are of different sizes, and if you cast an array of BYTES to an array of WCHARs, the conversion will succeed, but the resultant buffer will be unusable (the code "won't work"). In other words, you only casted the pointer.

You can call a horse a dog, but however, it won't bark. OK, I know. That's not a good example, but you get the drift. Smile | :)

Rakesh5 wrote:
my seniors have used a functions in which they have typecast like wat i have mentioned in the first message..they are sending type-cast parameter as an arugment to other functions..but it is not casting properly....its taking the first character alone..


I have a feeling that your seniors are not the brightest sparks for you to learn from. Or ask them to give you an explanation of what they're trying to achieve and ask them how such a "conversion" could make sense.


It is a crappy thing, but it's life -^ Carlo Pallini

AnswerRe: convert const wchar* to const byte* Pin
KarstenK7-Oct-09 1:24
mveKarstenK7-Oct-09 1:24 
AnswerRe: convert const wchar* to const byte* Pin
David Crow7-Oct-09 3:17
David Crow7-Oct-09 3:17 
GeneralRe: convert const wchar* to const byte* Pin
Rajesh R Subramanian7-Oct-09 3:23
professionalRajesh R Subramanian7-Oct-09 3:23 
GeneralRe: convert const wchar* to const byte* Pin
David Crow7-Oct-09 3:26
David Crow7-Oct-09 3:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.