|
I want to save the entry details on the hard disk
after entering it
then when I open the programe again I want the details to be entered to the list again
I APPROCIATE ANY HELP
#include
#include <list.h>typedef CList<phonebookentry *,="" phonebookentry="" *="">
PhoneBook;
struct PhoneBookEntry
{
CString Name,phone;
};
//***********************main************
switch (nChoice)
{
case 1: // add entry
PhoneBookEntry *pEntry;
pEntry = InputEntry();
g_PhoneBook.AddTail(pEntry);
break;
case 2: //list entries
pos = g_PhoneBook.GetHeadPosition();
while (pos)
{
PhoneBookEntry* pEntry = g_PhoneBook.GetNext(pos);
PrintEntry(pEntry);
}
}
//***********************************
PhoneBookEntry* InputEntry() //func. to enter details
{
PhoneBookEntry* pEntry = new PhoneBookEntry;
cout << "Enter new entry details:" << endl;
cout << " Name: ";
char cName[100];
gets(cName);
cout << " Phone: ";
char cOfPhone[100];
gets(cOfPhone);
pEntry->Name = cName;
pEntry->Phone = cOfPhone;
return pEntry;
}
//**********************************************
|
|
|
|
|
I am using the function inside a custom modal dialog. The arguments I pass are :the dialog’s window handle and the pointer to the object of a class in which I have implemented the IsecurityInformation interface with 2 additional functions of mine.
The application runs fine but crashes sometimes. The crash can be reproduced even when I just move the permission dialog. I think there is some problem in the implementation of the interface. I have tried with passing NULL as first argument but it crashes everytime.
The crash occurs in the Defwindowproc function
Sudhir Mangla
http://Programmerworld.net
(Free books , articles , Source Code and Programming Tools and Utilities)
|
|
|
|
|
I'm using windbg to debug an instance of iexplore.exe. In my test case, iexplore.exe loads a file a.htm (hello world).
Basically I want to step into the iexplore dissassembly the moment it loads a.htm into memory ..i.e before a.htm gets rendered... How do I do it? Help needed please.
|
|
|
|
|
|
Hi,
I hav got an MDI application and a modal child dialog. Now i call this dialog using DoModal(). when i toggle 'CAPS Lock' key ,the ID_INDICATOR_CAPS in Mdi's Statusbar is not updated .
Can any one help me ...?
Thanks,
Abin
|
|
|
|
|
Hi,
When u use domodal to display ur dialog, the focus will be only on the dialog and not on the parent window. Unless u close the dialog, the parent window cannot process any message. Try to use modeless dialog if u want ur parent window to process messages even when the dialog is displayed. Refer MSDN for more details.
Adios,
Ju
|
|
|
|
|
Can anyone suggest a way of detecting whether a CD or DVD is present in a drive without trying to access that drive?
|
|
|
|
|
The only way to see if someone is home, is by knocking on the door...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Or by setting the house on fire and see if someone gets out screaming... But ok, that may not be the most elegant solution
|
|
|
|
|
Yeah, but after you see that someone is home, they'll be gone afterwards..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
The only way to see if someone is home, is by knocking on the door...
KNOCK KNOCK! Is anybody Homeeeeeee
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
fainley wrote:
Can anyone suggest a way of detecting whether a CD or DVD is present in a drive without trying to access that drive?
Nope, It not possible
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Know the weight of your PC when no CD or DVD is present...
Whenever you wish to know if there is a CD or DVD in the drive, measure the weight of the PC again, and check if the weight has increased with the weigth of a CD.
(you could place your pc on a digital scale and connect the scales to your pc and use the output of the scales to check if a CD or DVD is present programmatically )
|
|
|
|
|
What about when more and more data is cached to/from RAM? Won't that affect how much it weighs?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Yes, because the heat of the PC will build up, and this might cause counter-convection, in which case the computer case will be slightly uplifted, thus weighting less. Also, depending upon case fan placement, when they spin at higher RPM to remove the excess heat caused by the burdening of the RAM, the fans might provide a slightly uplifting effect to the computer case, thus giving false readings during the IsCDPresent() function call :->
|
|
|
|
|
hi, i am some newb in MFC programming now dealing with some problems while learning other's codes
[IMG]http://img145.echo.cx/img145/8175/cstring3uk.jpg[/IMG]
as you can see from the image, i am running debugging mode going step by step up to that yellow arrow (circled in red)
i noticed that in the "watcher" section at the bottom right it says the symbol "str" is not found
what puzzles me is that "str" has already been declared already (circled in red) and how is it possible that it cannot be found?
shouldnt it be some text? or at least empty text "" ?
i hovered my mouse over "str" and nothing came up
could it be some declarations i left out? i got no idea
please advise and enlighten me :wave:
- winxp
- VC6.0++, SP5
- MFC style
|
|
|
|
|
|
Which part of Please do NOT post programming questions or ads to this forum didn't you understand?
Before the others give you grief, go to the right forum; and delete this post unless you want to be flamed.
Cheers,
Vikram.
http://www.geocities.com/vpunathambekar
"It's like hitting water with your fist. There's all sorts of motion and noise at impact, and no impression left whatsoever shortly thereafter." — gantww.
|
|
|
|
|
It's all Nish's fault. Look at the title of his post below. It's misleading other people to think that this is a programming forum.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
Yep! a typical case of "One rule for one, another rule for another", which seems be case in the lounge. Depending on your popularity factor, posting Programming or near Programming question, a 'blind eye' will be taken.
Blogless
|
|
|
|
|
norm.net wrote:
Yep! a typical case of "One rule for one, another rule for another", which seems be case in the lounge. Depending on your popularity factor, posting Programming or near Programming question, a 'blind eye' will be taken.
I suppose it depends on your point of view. To me, Nish didn't post a programming question. He started a discussion on a programming subject. He wasn't asking for help with his programming, he was asking for a point of view on a programming concept. I don't know about you, but this is the kind of thing me and other programmers discuss over lunch or other non-working get-togethers. So I think it is a valid lounge topic.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
Though both norm.net and you have valid points, I'm more likely to side with you.
Michael P Butler wrote:
this is the kind of thing me and other programmers discuss over lunch or other non-working get-togethers.
Exactly.
Cheers,
Vikram.
http://www.geocities.com/vpunathambekar
"It's like hitting water with your fist. There's all sorts of motion and noise at impact, and no impression left whatsoever shortly thereafter." — gantww.
|
|
|
|
|
Michael P Butler wrote:
To me, Nish didn't post a programming question.
It gets to a fine line discussion/question I'm not splitting hairs, I've seen newbies and near newbies dragged backwards through the bushes for posting similar messages, yet when a popular long timer posts similar material the blind eye approach is taken. It's merely an general observation and my opinion.
Blogless
|
|
|
|
|
norm.net wrote:
It gets to a fine line discussion/question I'm not splitting hairs, I've seen newbies and near newbies dragged backwards through the bushes for posting similar messages, yet when a popular long timer posts similar material the blind eye approach is taken. It's merely an general observation and my opinion.
You have a fair point.
Newbies on any site always get a rougher time than those who are on the staff or who are well-respected members of the community. (You should look-up some of the hassle that Nish got when he first joined)
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
Michael P Butler wrote:
You should look-up some of the hassle that Nish got when he first joined
Glad someone remembers
|
|
|
|