|
Sorry for the newbie question, but lets say i have a text file, and in a certain location in the text file, there is a string of characters I would like to modify.. lets say its HIGHSPEED.. if I want to replace HIGHSPEED with DIALUP, without having excess whitespaces, how would I accomplish that? I want to remove the extra spaces that would be at the end if I were to seek the offset, and replace the word with my secondary word.
Thanks in advance.
btw. I can do this in MFC or C style. MFC prefered (bleh)
|
|
|
|
|
Is the file very large? If not, you could load it into memory, perform string replace and write back.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Even if it's so large, you can use String tech with FileMapping
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
How do you grow or shrink memory mapped file?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
replace HIGHSPEED with DIALUP
You must handle that.
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
I am trying to load a particular field of all records in a table into a listbox. when i run the exe, I am getting a messagebox with the error:
too few paramaters expected one.
what does this type of error mean??
|
|
|
|
|
it should be just:
m_MyListBox.AddString(myRecord.m_strField1); you should post code if you want help with an error.. so we can see where the error is being caused.
-dz
|
|
|
|
|
When I run it, I get the messagebox error and when the dialog appears, I donot have the fileds loaded?
I have the code where I have tried to load the field..
void CMgen1View::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_mgen1Set;
CRecordView::OnInitialUpdate();
LoadListbox(); //CALLING HERE
}
void CMgen1View::LoadListbox()
{
CMgen1Doc* pDoc = GetDocument();
CListBox* pLB = (CListBox*) GetDlgItem(IDC_LIST1);
CSectionSet sect(&pDoc->m_database);
sect.Open();
while(!sect.IsEOF()) {
pLB->AddString(sect.m_CourseID);
sect.MoveNext();
}
}
|
|
|
|
|
The database query you're executing has probably a misspelled column name. Check the SQL text.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
too few paramaters expected one.
I'm sure that your SQL command is incorrect;P
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
I want a user to definitely input a value into a certain editbox. If GetWindowText is "" I SetFocus back to it. But this doesnt prevent them from still ignoring it and pressing another button "Done" that proceeds with the rest of the code Needless to say the code crashes if you dont have an input in the editbox. Short of checking to see if the editbox is filled (and setting focus back to it if not)in the BN_CLICKED event of the "Done" button is there a way of forcing the user to make an entry in the editbox?
Thanks,
ns
|
|
|
|
|
disable everything else until the edit control is filled ?
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
Thats a great solution! Thnaks,
ns
|
|
|
|
|
I really should post my GUI helper class that makes it trivial to do this. Meanwhile, if you want to be really cool do the following:- In the resource editor, set the OK button's "disabled" property.
- Write a handler for the edit control's
EN_CHANGE notification.
- In the handler, get the edit control's text and enable the OK button only when the text is non-empty. Be sure to
TrimRight() and TrimLeft() the text after you get it. /ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Okay. I'l give that a shot as well. I did a less sophisticated version without the EN_CHANGE, but thats a cool idea like you said.
|
|
|
|
|
I'm emailing you a "preview" version of the GUI helper stuff I as talking about. Stay tuned...
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
The compiler doesnt like for a CButton m_Dismiss:
m_Dismiss.Enable(FALSE);
I cant find anything resembling this. I want to prevent them from clicking on the button, and I guess you cant disable a button. So I'm going to have to pop up a messagebox if they press the button and the editbox is empty, and set focus back to it. Am I being klugey here? Can you disable a button?
Thanks,
ns
|
|
|
|
|
ns wrote:
going to have to pop up a messagebox if they press the button and the editbox is empty, and set focus back to it. Am I being klugey here? Can you disable a button?
Sure.. Use m_Dismiss.EnableWindow(FALSE);
--------------------------------------------------
|
|
|
|
|
Check on Button Click and then prompt the user with an irritating Message asking that the data be entered. After the message box ok button is clicked, set focus to the control. If you us the disable button approach you are not informing the user that the one edit control must be populated. You will be amazed at the number of users who will just sit and stare at the screen wondering what to do if the button is disabled.
|
|
|
|
|
Hi I wrote(/writing) an app for my old highschool and need to know how to update the changes made in the database.
Let me explain, say I added some tables/relations to mydatabase.mbd, how do I let Visual C++ know?
|
|
|
|
|
If your program is affected by that changes, you must recode it
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
What if it is an upgrade?
New features added but everthing that was there before stayed.
Like I added some new tables/attributes.
|
|
|
|
|
I deleted the clw file and rebuilt the project but now I dont have a clw file at all, and theres no clas view information. Its not a read-only folder. Please help! I am so dependent on this pane for navigation...
Thanks,
ns
|
|
|
|
|
bring up the class wizard (ctrl-w). it will ask if you want it to rebuild your .clw file. say yes.
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
I did as you said. A clw file got built. I reloaded the project. It still doesnt want to load any class info!! Inciedntally this is the project that was crashing intermittently while exiting with the right cross system menu (dont know why yet - waiting for an answer to my thread on how to debug an empty WM_SYSCOMMAND handler!!). MAybe theres a connection?
Anyways the classes stubbornly wont load in the Class View pane....
|
|
|
|