|
Because CArchive knows how to stream to/from a CString , you can just use the >> and << operators.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thank you Ravi.
I thought this was how CArchive would work at first too but I had problems and I now think my code was wrong elsewhere because now I fixed other problems as well and I tried what you suggested again and it works OK now.
I also had tried the WriteString() and ReadString() functions but I had problems with them also.
|
|
|
|
|
Glad you're up and running! Check out this[^] article if you'd like to know more about serialization.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I am looking for a tool to aid our development and QA team find memory leaks. Right now we use Perfmon to monitor Private Bytes of application but we are ready to invest in a more advanced tool. Can anyone suggest some tools for me to research?
Environment is VC6 on W2k and higher. Applications range from services to GUI apps. We use STL, MFC and other 3rd Party libraries.
Thanks!
|
|
|
|
|
Commerical?
Check this out: Compuware Boundschecker
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
to find memory leaks is the easiest possible thing.
just create own new/delete, malloc/free, ... functions and add an item to a list when something is allocated and delete the item when there is a free call. so when the app will be closed, you can dump all the remaining items(leaks).
Don't try it, just do it!
|
|
|
|
|
http://support.microsoft.com/?kbid=128731
I need to save registry key into file. How do i do that.
|
|
|
|
|
Anonymous wrote:
I need to save registry key into file. How do i do that.
Exactly how the article prescribes. Have you tried it?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi,
I need help again
I have one dialog which I will call InvoiceDlg. On this dialog I have some controls. Lets say I have a static control called IDC_INVOICENUMBER. I have a button, IDC_TENDER, and when this button is pressed it will open another dlg called TenderDlg. I want to be able to get the data from InvoiceDlg into TenderDlg. I've tried alot of things such as:
void CInvoice::OnTender() <br />
{<br />
<br />
CString invoicenumber;<br />
GetDlgItemText(IDC_INVOICENUMBER,invoicenumber);<br />
CTender dlg;<br />
dlg.DoModal();<br />
dlg.m_invoiceme.SetWindowText(invoicenumber);<br />
}
and;
void CInvoice::OnTender() <br />
{<br />
CString invoicenumber;<br />
GetDlgItemText(IDC_INVOICENO,invoicenumber);<br />
CTender dlg;<br />
<br />
dlg.DoModal();<br />
dlg.SetDlgItemText(IDC_INVOICE, _T(invoicenumber));<br />
<br />
<br />
}
Both these compile with no dramas, however when I try them in the app; they dont do anything, its like they aren't even passing on the data through CTender dlg;
Can someone please help me?! Im tired, I want to goto bed
lol
Thanks
Ashman
|
|
|
|
|
Ashman wrote:
dlg.DoModal();
dlg.SetDlgItemText(IDC_INVOICE, _T(invoicenumber));
The call to dlg.DoModal will show the dialog and therefore any further code in your function won't be executed until the dialog is closed.
You'll need to pass the CString into your class before DoModal and then inside the WM_INITDIALOG handler, set the window text of the control.
e.g
<br />
void CInvoice::OnTender() <br />
{<br />
CString invoicenumber;<br />
GetDlgItemText(IDC_INVOICENO,invoicenumber);<br />
CTender dlg;<br />
<br />
dlg.m_strInvoiceNo = invoiceNumber;<br />
<br />
dlg.DoModal();<br />
<br />
<br />
}<br />
<br />
BOOL CTender::OnInitDialog()<br />
{<br />
CDialog::OnInitDialog();<br />
<br />
m_invoiceme.SetWindowText(m_strInvoiceNo);<br />
<br />
}<br />
<br />
<br />
<br />
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
Hello everybody !!
i am newbie for mfc programming can any body of u explain me how to Create multiple view (i mean different type of view such as listview , scroll view for a single document )
thanks in advance..
|
|
|
|
|
|
Hi,
I´m having problems by getting the current selected (current deleted) Item in Outlook.
For example:
When I am deleting an Contact in Outlook my programm catch this event and should get the current selected item but instead
of giving me the index 6 (for exampl.) it gives me the index 5 because outlook sets the selection to highest index shortly after someone is deleting ...
Whats wrong ?
I need badly help, cause I´m working in time-critical project ...
Thanks a lot, JohnX
|
|
|
|
|
The Problem is, that I am building a dynamicly EventHandler who gives me the events from user defined Folders.
(for example a Subfolder under Contacts)
As long as I only programm Events to the TopLevelFolder - everything works;
but when I programm Events to an user defiend folder the GetSelection() returns not what I really have selected.
Can someone help me ?
|
|
|
|
|
I am trying for a long time and seeing the documentation of how can I put a scroll bar in a window create by the MCIWndCreate function that actually can scroll the video inside, can some one help me ?
|
|
|
|
|
|
|
U can check this link.
http://www.codersource.net/winsock_tutorial_server_event_model.html
May find this useful.
Thanks
|
|
|
|
|
Sorry,it must have a point that the codes must be written in SDK not in MFC in the side of Server!
Thanks very much to those poeple who replied my subject!
|
|
|
|
|
Im new to MFC so bear with me.
Im trying to reposition a CEdit Box in a Dialog application.
Im confused now as to whether this is possible or not.
The application, has a list box and when an option is selected
parameters appear / get shuffled around.
I though SetWindowPos would do it as CEdit is a CWnd derived class,
but Im assume I should be looking at the CDialog Client area
and how to move other CWnd derived controls, but nothing like this
exists I think.
Little help.
regards
Karl
|
|
|
|
|
You would be best taking the currect position of the edit box into a rect and then using MoveWindow
CRect rect;
GetDlgItem(IDC_EDIT1)->GetWindowRect(&rect);
ScreenToClient(&rect);
GetDlgItem(IDC_EDIT1)->MoveWindow(rect.left + 10, rect.top, rect.Width(), rect.Height(), TRUE);
|
|
|
|
|
Does any one of u know where i can
find a good threading tutorial in mfc.
both beginner and advanced level.
specially about user-interface thread
|
|
|
|
|
Just look at the AfxBeginThread function, it says a lot about the threads
|
|
|
|
|
|
Try this and this.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|