|
hi,
this is what we do.. as
m_List.InsertColumn( // Ask Mfc to create/insert a column
0, // This is the rank/order of this
// particular item
"Name", // The caption we want for this header
LVCFMT_LEFT, // The relative position we want the
// items under this header to have
100); // The width we want for the items under
// this header
m_List.InsertColumn(1, "Profession", LVCFMT_CENTER, 80);
m_List.InsertColumn(2, "Fav. Sport", LVCFMT_LEFT, 100);
m_List.InsertColumn(3, "Hobby", LVCFMT_LEFT, 80);
and to add items..
provide some items to display under the headers:
int nItem; // This integer will be used to identify the
// header item we are dealing with.
// Give a name/caption to an item to display under the first header
nItem = m_List.InsertItem(0, "Sandra");
// Create a caption for the corresponding headers.
m_List.SetItemText(nItem, 1, "Singer");
m_List.SetItemText(nItem, 2, "HandBall");
m_List.SetItemText(nItem, 3, "Beach");
i hope so you get..why you were getting an error..
cheers
Himanshu
|
|
|
|
|
Thank you, Himanshu. I got it now.
This list control is more complext to use than those combo box and edit control.
|
|
|
|
|
Yes first you have to insert columns, then you can insert rows as items. Finally you can set each columns values for that new item : InsertColumn, InsertItem, SetItem for each column...
Hope it helps,
JM
Earth > Europe > France > Lyon
|
|
|
|
|
Hi
I'm having problems with splitter windows and transferring data between the panes. I have split my window in 3, one a CEditView, and the other two are CViews. Now I want to transfer the text I type from the CEditView to the CView, but I'm stuck with this! What should I do???
Regards
Jef
|
|
|
|
|
|
I don't know if i messed up with the code but no UpdateAllViews doesn't seem to work.. I'm even unable to get the document from my custom CView classes, though i included the *doc.h!!!.. .. I'm thinking about something as i'm writing: does i need a document for each view i create??? It can't be, right??
Jef
|
|
|
|
|
Use the CDocument as a bridge between all views (provide it with some members for this kind of info) and use UpdateAllViews .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hi all,
i have to develop a remote shell like Windows Explorer
but it should have HTML interface..
please help me..
|
|
|
|
|
Please ask a more detailed question and we will help you.
|
|
|
|
|
actually the problem is i don't know how
call shell funtions such changing directory..
creating files .etc..
|
|
|
|
|
|
I have just completed 145 Gnu makefiles that allow anyone
with the free MinGW tool set to compile and execute all of
the example programs which Charles Petzold describes in his
"Programming Windows Fifth Edition" book, which is the
standard reference book on Microsoft's WIN32 API.
I freely distribute these 145 makefiles in a .ZIP file,
along with an installation program that will copy them into
Petzold's directory structure, from my web page at:
http://www.computersciencelab.com/Petzold.htm
Only 5 of the 145 programs require user intervention to
compile with the Gnu compiler, which is not bad for porting
that many programs to a new compiler, especially given
Microsoft's lax adherence to standards.
You are free to use these makefiles with whatever version
of the MinGW tools you prefer, but I created them for use
with the MinGW based C++ integrated development environment
that is part of my computer programming curriculum.
Petzold's book is expensive enough, so it's great that these
makefiles and the MinGW tools mean that you don't need to send
another $100 Microsoft's way to purchase their Visual C/C++
compiler.
John Kopplin
|
|
|
|
|
Excellent forum to place this advertisement. 90% of us do not like to work with VC++ (Not) .
|
|
|
|
|
Well actually, Visual C++ is my primary development tool,
and that is why I am familiar with this web site and use
it as a resource.
But even those who have no interest in the Gnu compiler
may still be interested in my list of errata for the
Petzold book, which more than doubles the size of the
errata list that Petzold shows on his web site.
John Kopplin
|
|
|
|
|
It has nothing to do with that, he's simply offering people an option. Some people can't afford VC, so what he has done is given them the abbility to compile the samples without having to own a copy...
cheers,
-B
|
|
|
|
|
I would like to enumerate the netbios names of a machine.
nbtstat -A IPAddress command can do this very easily. It displays all the netbios names.
I searched msdn and codeproject but I could not find an example.
How can I do this ? Is there an api or do I need to craft a UDP packet by myself and send to port 137 of the target machine ?
Thanks
Orcun Colak
|
|
|
|
|
Hello All,
I have a requirement to read Foxpro dbf files without using ODBC or any other sane methodology, I remember a long time ago I did this in C using a structure but It's so long ago I've forgotten. What I've tried so far is creating a class ( you might gather my C & C++ has gathered dust ) as below but it is not satisfactory ( fields overflowing etc... ). The sample table I've been using has three fields, clm_ref c(10), name c(50) and salary n(15,2),where c(2) is a character field of 2 chars and n(15,2) is a numeric field of 12 digits with precision of 2, here's what I've got so far.
Class Record
{
char filler[1]; */ required for deleted field */
char clm_ref[10];
char name[50];
char salary[15];
void RecordGetData(ifstream &);
};
Record::RecordGetData(ifstream f_in)
{
f_in.read((char*) this,sizeof(*this));
}
int main()
{
Record Claims;
ifstream ifile;
ifile.open("mydata.dbf");
DBF_HEAD dbf_head;
ifile.read((char*) &dbf_head,sizeof(DBF_HEAD)); */ Header info */
ifile.seekg(dbf_head.data_offset,ios::beg); */ seek to data offset*/
Claims.RecordGetData(ifile);
cout << "Claim ref " << Claims.clm_ref << endl;
}
While Claims.clm_ref contains the clm_ref data it also contains part of the name, I'm lost any ideas much appreciated
regards
Pete Kane
Pete Kane
|
|
|
|
|
CodeBase [^] acceptable?
"Well I'm just a hard working corporate slave, my mind should hate what my body does crave.
Well I'm just a humble corporate slave, driving myself into a corporate grave"
Corporate Slave, SNOG
|
|
|
|
|
Try googling for xbase. IIRC it can handle FoxPro files also.
|
|
|
|
|
okay thanks chaps, but I really would like to code this myself have you any idea as to why my approach doesn't work ?
cheers
Pete Kane
|
|
|
|
|
pk_fox wrote:
but I really would like to code this myself
OK, you want to do it as an excercise. I got the impression you were looking for a solution to a problem.
I still think you should have a look at the xbase code since 1) IIRC it can handle FoxPro files and 2) since the source is available, and much documentation about these dBase derived formats is also included, you can from there figure it out yourself.
|
|
|
|
|
Hi,
I'm doing an application that first checks the OS installed in the machine where it is run. If the OS is Windows 2000, the porgram does a number of checks with iphlpapi, which do not work in Windows 9x. If the Os is Win9x, it displays some information.
The application has the following structure:
if (OS is Win2K)
{
... checks with iphlpapi
}
else
{
... displays some information
}
Now, the application fails in Win9x, and I don't understand why. The functions in the first part of the if are not executed, so why does it give an error?
The curious thing is that if do this:
if (OS is Win2K)
{
/*
... checks with iphlpapi
*/
}
else
{
... displays some information
}
(I comment all the first part of the if)
It DOES work in win9x, perfectly. So the part that is giving me an error is the part that si not even executed in Win9x. I don't get it!
Any ideas about this?
Thanks a lot.
F
|
|
|
|
|
Ouch.
Without much info, there is probably something in the commented out section that has a side effect, even though it never is executed. The side effect might be something like loading another DLL, and that somehow causes a problem with the Win9x processing.
Have you tried switching things around so that you test for OS is NOT Win2000, rather than OS IS Win2000? This doesn't cancel a side effect of loading a DLL, but it may indicate something else.
Just a few guesses, as you haven't given much to go on.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Not only you don't have to call the W2k-only functions, also you cannot link them: When the program uses some Win32 function, it is linking against a so called import .lib, which loads the corresponging DLL and arranges everything so that when the time comes to call the function, everything works. The problem with a W2k-only function is that the import library will try to load it even if the program never calls it!
You have two options:- Do the loading yourself, as in this example with
TryEnterCriticalSection :
BOOL (WINAPI * pTryEnterCriticalSection)(LPCRITICAL_SECTION lpCriticalSection);
HMODULE hKernel32;
void LoadW2kFunctions()
{
hKernel32=LoadLibrary("KERNEL32");
(FARPROC&)pTryEnterCriticalSection=GetProcAddress(hKernel32,"TryEnterCriticalSection");
}
...
if(OS is W2k){
LoadW2kFunctions
}
...
if(OS is W2k){
pTryEnterCriticalSection(...);
}
else{
...
} This is hard work, you'll probably find some problems along the way. - In VC++ 7.0, there's an option called delayed loading which loads DLLs the first time thery're used. If you have this compiler, this is surely the fastest way to get your problem solved.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín, aprecio tu respuesta. Estoy trabajando con VC++ 6, pero creo que puedo conseguir instalar la versión 7.
Te mantendré informado de mis progresos en este respecto.
Thanks a lot.
n
|
|
|
|
|