Click here to Skip to main content
15,913,130 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Connect SQL database in MFC application with ADO connection Pin
Hamid_RT23-Oct-07 2:22
Hamid_RT23-Oct-07 2:22 
QuestionConvert to double value Pin
ashishbhatt22-Oct-07 19:54
ashishbhatt22-Oct-07 19:54 
QuestionRe: Convert to double value [modified] Pin
Nishad S22-Oct-07 20:10
Nishad S22-Oct-07 20:10 
AnswerRe: Convert to double value Pin
ashishbhatt22-Oct-07 20:37
ashishbhatt22-Oct-07 20:37 
GeneralRe: Convert to double value Pin
Anand Todkar22-Oct-07 20:57
Anand Todkar22-Oct-07 20:57 
GeneralRe: Convert to double value Pin
ashishbhatt22-Oct-07 21:16
ashishbhatt22-Oct-07 21:16 
GeneralRe: Convert to double value Pin
Anand Todkar22-Oct-07 21:28
Anand Todkar22-Oct-07 21:28 
GeneralRe: Convert to double value Pin
Cedric Moonen22-Oct-07 21:02
Cedric Moonen22-Oct-07 21:02 
WTF | :WTF: Woww what are you trying to do ??


ashishbhatt wrote:
str = (unsigned char *)malloc(sizeof(unsigned char *));


This is plain wrong: you will allocate a memory of 4 bytes because unsigned char* is a pointer and a pointer is 4 bytes long. Is that what you want to do ? That's quite a strange way to work...


ashishbhatt wrote:
str = (unsigned char *)&x;


Here you will assign a new address to your str pointer, meaning that you will loose ownership of the previsously allocated memory (now it is 4 bytes of memory that are in memory and you can't access it anymore because you lost its address).


ashishbhatt wrote:
st.Format(CString("%.2X "), *(str++));


Why do you construct a CString inside the Format function ? Confused | :confused:
And what are you trying to do ??

So, I think your code is just plain wrong. Can you explain what you are trying to do exactly, maybe we'll be albe to help.

On a side note, you have to know that the bytes are stored in memory in an inverted way (on windows platforms).


Cédric Moonen
Software developer

Charting control [v1.2]

QuestionRe: Convert to double value Pin
Nishad S22-Oct-07 21:02
Nishad S22-Oct-07 21:02 
AnswerRe: Convert to double value Pin
codeII22-Oct-07 21:25
codeII22-Oct-07 21:25 
AnswerRe: Convert to double value Pin
chandu00423-Oct-07 0:17
chandu00423-Oct-07 0:17 
QuestionMaking a particular item of listview bold Pin
jyothi lakshmi22-Oct-07 19:46
jyothi lakshmi22-Oct-07 19:46 
AnswerRe: Making a particular item of listview bold Pin
Nishad S22-Oct-07 20:07
Nishad S22-Oct-07 20:07 
AnswerRe: Making a particular item of listview bold Pin
Naveen22-Oct-07 20:08
Naveen22-Oct-07 20:08 
AnswerRe: Making a particular item of listview bold Pin
Hamid_RT22-Oct-07 20:40
Hamid_RT22-Oct-07 20:40 
QuestionAm I in a UI thread? Pin
Peter Weyzen22-Oct-07 19:32
Peter Weyzen22-Oct-07 19:32 
AnswerRe: Am I in a UI thread? Pin
Naveen22-Oct-07 19:35
Naveen22-Oct-07 19:35 
GeneralRe: Am I in a UI thread? Pin
James R. Twine23-Oct-07 1:51
James R. Twine23-Oct-07 1:51 
GeneralRe: Am I in a UI thread? Pin
Naveen23-Oct-07 3:00
Naveen23-Oct-07 3:00 
QuestionRe: Am I in a UI thread? Pin
David Crow23-Oct-07 3:45
David Crow23-Oct-07 3:45 
AnswerRe: Am I in a UI thread? Pin
Naveen23-Oct-07 5:22
Naveen23-Oct-07 5:22 
GeneralRe: Am I in a UI thread? Pin
David Crow23-Oct-07 5:27
David Crow23-Oct-07 5:27 
GeneralRe: Am I in a UI thread? Pin
Naveen23-Oct-07 14:12
Naveen23-Oct-07 14:12 
GeneralRe: Am I in a UI thread? Pin
Peter Weyzen23-Oct-07 11:41
Peter Weyzen23-Oct-07 11:41 
AnswerRe: Am I in a UI thread? Pin
ThatsAlok23-Oct-07 0:19
ThatsAlok23-Oct-07 0:19 

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.