|
Did you install Platform SDK? of course for DWORD_PTR you can use of a hotfix before includes on your project.
typedef unsigned long DWORD_PTR;
|
|
|
|
|
Thanks for ur reply,
How will i know platform sdk installed?
Where can i get platform SDK for VS.Net 2003 if its not there?
should i include the typedef in stdafx.h??
|
|
|
|
|
thanks to all
problem was solved. it was referring to previous version vc++6.0 include directory atl
|
|
|
|
|
|
Hi all,
I've create a database locally on my machine and create a database. Then make some tables on that database as well. Use SQL Sever 2005, Express Edition on WinXP Professional with SP2.
Now I want to connect that database to my MFC application using ADO. Can you guys explain how it can be done.
Thanks
I appreciate your help all the time...
Eranga
|
|
|
|
|
If you see Database section on the codeproject you can find your answer.;)
|
|
|
|
|
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>
|
|
|
|