|
Did you ever get this working? I'm trying to do the exact same thing...
Mike Ellertson
|
|
|
|
|
What I posted is working code. You'll have to be more specific.
|
|
|
|
|
Ok, here's more specifics. I'm trying to get my list control to sort on a column heading click. You code just handles the click message. Do you know what additional code I'd have to add to get the list view to sort by the column heading that was clicked on?
Mike Ellertson
|
|
|
|
|
You'll need a handler for the LVN_COLUMNCLICK notification. In the handler, the column clicked is obtained like:
void OnColumnclick(NMHDR* pNMHDR, LRESULT * )
{
CWaitCursor cursorWait;
NM_LISTVIEW *pNMListView = (NM_LISTVIEW *) pNMHDR;
if (m_list.GetItemCount() > 0)
{
m_nSortColumn = pNMListView->iSubItem;
m_list.SortItems(CompareFunc, ...);
}
}
|
|
|
|
|
Hi All,
I need to integrate MapPoint software into my MFC database application. Basically what i want to acheive is to
get the data from the database and display it in the map. Application has to invoke the map and draw the route on it.
Any ideas will be appreciated.
Thanks,
|
|
|
|
|
What is the value of lSize?
|
|
|
|
|
Its correct.Equal to file size.
Mazy
No sig. available now.
|
|
|
|
|
I tried your code and lSize and i have the same value.
|
|
|
|
|
Yes,Same here.
Mazy
No sig. available now.
|
|
|
|
|
Ok, so what's the problem? You instructed it to read lSize bytes and it read i bytes, both of which were the same.
|
|
|
|
|
Thw point is that svRead does not contain all datas.
Mazy
No sig. available now.
|
|
|
|
|
Mazdak wrote:
it only read 3 or 4 first character
How do you verify this? Does a byte with value of zero at the fourth or fifth position confuse your viewer?
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Yes,I guess this is the problem.
Mazy
No sig. available now.
|
|
|
|
|
Don't use fopen() or the other C runtime file functions from <stdio.h> for reading binary data. They're only designed for use with text files.
Under Windows, use CreateFile() to open a file and ReadFile() to read data from it. You can also use the _open() function and _read() to read from the file, which may be more portable (the POSIX binary functions are named open() and read()).
--
Mike Dimmick
|
|
|
|
|
Mike Dimmick wrote:
Don't use fopen() or the other C runtime file functions from <stdio.h> for reading binary data. They're only designed for use with text files.
Where did you get this from? fopen(), fread(), fwrite(), and fclose() operate on both text files and binary files. They always have.
|
|
|
|
|
DavidCrow wrote:
fopen(), fread(), fwrite(), and fclose() operate on both text files and binary files. They always have.
Don't you have to add a flag or something in order to read binary data?
Perhaps not with the fXXX() family... I don't have MSDN near my hands so I can't check if it is so.
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Rickard Andersson18 wrote:
Don't you have to add a flag or something in order to read binary data?
fopen(szpath,"rb");
b means binary.
Anyway,I find out that was problem with debugger.It contains correct value but debugger can't show it.
Mazy
No sig. available now.
|
|
|
|
|
Mazdak wrote:
It contains correct value but debugger can't show it
Have you tried using any of the m-type symbols in the watch window?
I use these two quite often:
m
ma
I've never used these:
mb
mw
md
mq
mu
|
|
|
|
|
Rickard Andersson18 wrote:
I don't have MSDN near my hands so I can't check if it is so.
If you have access to CodeProject, you have access to MSDN[^]
|
|
|
|
|
DavidCrow wrote:
If you have access to CodeProject, you have access to MSDN
True, but I don't waste any time and money of big loadings at MSDN online with my damn modem!
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Why you don't use the Win32 API functions CreateFile , ReadFile , ... ?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
I use this coed to read files:
FILE *file = fopen(szpath,"rb");
if(file!=NULL)
{
char *svRead;
fseek (file , 0 , SEEK_END);
long lSize = ftell (file);
rewind (file);
svRead = (char*) malloc (lSize);
int i = fread(svRead,sizeof(char),lSize,file);
}
But it works only for TEXT files ad when I read jpg files with it ,it only read 3 or 4 first character.
Mazy
No sig. available now.
|
|
|
|
|
Hi
I use CRecordset to access to MSAccess Database
When I want to access database With ODBC & without CDatabase it work well.
But I want To use db without using ODBC & directly, I used CDatabase To do it but Recordset will readonly
CDatabase Database;
Database.OpenEx("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=DB\\TT.mdb",0);
CMyRecordset rs(&Database);
please Help me
Iman
|
|
|
|
|
searching for a good report-printing c++ library
|
|
|
|
|
How to change the color of a scroll bar's appearance?
Please help me!
stanley
|
|
|
|