|
Yep, right now I'm on it. But lots confusing with some of there explanation. Really mess with to find the difference between ADO, DAO, OLEDB etc.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Its better before start see some articles about them then start to write code if you search on the internet you can find a lot articles about them.
ODBC[^].
ADO[^]
OLEDB[^]
|
|
|
|
|
Thanks for all the links.
I appreciate your help all the time...
Eranga
|
|
|
|
|
|
Hi all,
i have a problem in the value which stored in memory location.i want to convert it into the double value.
Suppose, i have the value
int k = 2;
when I write it on the memory location like, it is like ..
40 00 00 00 00 00 00 00
But when i retrieve it from memory location then it gives me reverse like...
00 00 00 00 00 00 00 40
So, I want to convert it in to Double value.
Little much Strange question, but I am facing this problem.
Plz reply me, if u got solution .
thanks in advance.
Ashish Bhatt
|
|
|
|
|
How did you make sure that it is changed? How did you read this "40 00 00 00 00 00 00 00" and "00 00 00 00 00 00 00 40"?
- NS -
|
|
|
|
|
I have used this code to check the value stored on memory and so I found the output like as explained.
<br />
double x = 2;<br />
unsigned char *str;<br />
str = (unsigned char *)malloc(sizeof(unsigned char *));<br />
str = (unsigned char *)&x;<br />
<br />
CString st, str1;<br />
str1 = "";<br />
for(int i = 0; i < 8; i++)<br />
{<br />
st.Format(CString("%.2X "), *(str++));<br />
str1.Append(st);<br />
}<br />
AfxMessageBox(str1);<br />
<br />
here the output like as below....
00 00 00 00 00 00 00 40 in messagebox.
Ashish Bhatt
|
|
|
|
|
ashishbhatt wrote: 00 00 00 00 00 00 00 40 in messagebox.
The output is correct, what u have to do is to read it in reverse order. I think this is the solution
Thanks,
Anand.
|
|
|
|
|
ya thats right
but i want the reverse process.
I have that reverse data('40 00 00 00 00 00 00 00') now i want its double value('2') of this data without storing it into memory
Any idea?
Thanks in advance
Ashish Bhatt
|
|
|
|
|
ashishbhatt wrote: I have that reverse data('40 00 00 00 00 00 00 00') now i want its double value('2') of this data without storing it into memory
For this to happen, you need to convert the data from memory to equivalent binary and then to convert that binary to decimal.
I find this as a solution.
Thanks,
Anand.
|
|
|
|
|
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 ?
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).
|
|
|
|
|
I checked the code (had to do some corrections). And found that it displays same as that we can see in the Memory window at the time of debug. But you are expecting something different? Can you explain?
- NS -
|
|
|
|
|
You cannot change these types in memory, because int and double have different sizes in memory.
Else you could have changed your type in memory like this:
int nTst = 2;
double dTmp = (double) nTst;
double* pTst = (double*)&nTst;
*pTst = dTmp;
Is this what you meant?
|
|
|
|
|
hai ashish,
can you explain exactly what you want, as Cedric Moonen said, may be we will be able to help.
|
|
|
|
|
I want to make a particular item in listview bold after it is inserted, based on specific condition.
Below is the code that i am trying. But its not working. Can someone suggest me a way to do it
HFONT hDlgFont = (HFONT)SendMessage(get_Dialog(), WM_GETFONT, 0, 0L);
if (NULL != hDlgFont)
{
LOGFONT lFont;
if (GetObject(hDlgFont, sizeof(LOGFONT), (LPSTR)&lFont))
{
lFont.lfWeight = FW_BOLD;
hBoldFont = CreateFontIndirect(&lFont);
}
}
HWND hList;
LVITEM item;
ListView_InsertItem(hList, &item);
if (<condition>)
SendMessage(GetDlgItem(hList,item.iItem), WM_SETFONT, (WPARAM)hBoldFont, 0L);
|
|
|
|
|
You have to use CustomDraw
- NS -
|
|
|
|
|
You cannot change a perticular item of list control bold. If you want to do so, you have customdraw the list control. check this[^] for details of using the customdraw
|
|
|
|
|
|
For the sake of debug -- is there a way to determine that this thread is a UI thread (one based on CWinThread)?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
|
IsGUIThread(...) is not an MFC function, and is only available on WinXP (and above).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James R. Twine wrote: IsGUIThread(...) is not an MFC function
Cant he use this API in an MFC application?
|
|
|
|
|
What is a "GUI thread?"
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think a thread that has some user interface with the user is called GUI thread. I mean a thread that has a window or message loop some thing like that... What do you think?
|
|
|
|
|
Naveen.R wrote: What do you think?
I was just asking for clarification. I've always referred to a "GUI thread" as one with a message loop, whereas a "worker thread" as one without a message loop. In reality, the latter can also interact with UI components but not trivially.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|