|
Neither of these force a paint mesage. When you change your data, call Invalidate(false) to force a redraw without erasing the dialog first. Get rid of false to make it also erase.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
I'm using ADO to do a connection with Access database. I have a dlgbox with editbox which are linked to this app. When i do the loop:while(!pRs->EndOfFile)
{
if(m_dlglDate==rs.m_ch_RateDate)
{....}
I would like to return value in an editbox when my test "if" succeeded, so how could i do that?
thanks in advance
gerald
|
|
|
|
|
Do you mean, just pass a value into the editbox field?
if so,I just use DDX &
m_EditControl.SetWindowText("VALUE");
or
SetDlgItemText(IDC_EDIT1,"VALUE");
Gerry.
|
|
|
|
|
yes, exactly, if i could find the value in the database i want to return it in the editbox, but it could be a COleDateTime or a double, so i believe that setwindowtext return string. How could i return a double value or a COleDateTime value in editbox?
|
|
|
|
|
There are plenty of ways to convert a double to a string.
Function _ecvt for one. double to string pointer.
As for COleDateTime,
COleDateTime x(1999, 3, 19, 22, 15, 0);
CString str = x.Format(_T("%A, %B %d, %Y"));
m_EditBox.SetWindowText(str);
Hope this helps....
Gerry.
|
|
|
|
|
Hi All,
I have a query regarding MS Access Database.I am creating a Database & a table in it .I add the Records to the table.The size of teh Database mdb file is increasing as I add the record.But, when I deleted all the REcords in the table in Database, the size of the Database remained the same(as before deletion of REcords).Why is it so ?I am using ADOX to add the Records & the same to delete the Records .
How can I overcome this problem ?
Does in MS Access the size of Database decrease on deletion of Records if any ?If so how it can be done ?
YAMINI
|
|
|
|
|
What I use to do was, to repair the db.
Tools, Database Utilities, Repair
&
Then use compact. Not sure why it happens. Might have something to do with system objects in access?
Gerry.
|
|
|
|
|
Hi All,
I have a query regarding MS Access Database.I am creating a Database & a table in it .I add the Records to the table.The size of teh Database mdb file is increasing as I add the record.But, when I deleted all the REcords in the table in Database, the size of the Database remained the same(as before deletion of REcords).Why is it so ?I am using ADOX to add the Records & the same to delete the Records .
How can I overcome this problem ?
Does in MS Access the size of Database decrease on deletion of Records if any ?If so how it can be done ?
YAMINI
|
|
|
|
|
You have to compress the database. I can not remember how to do it from C++, but it's possible to do through ADO...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello,
I'm urgently looking for a nice little commandline tool (with stdoutput) to stamp the version of an executable (Major, Minor, Build).
Has anybody come across something?
Thanks,
Matthias
|
|
|
|
|
You can quickly create you own program to extract this type of information.
On nt, you have version.dll, which has windows api function GetFileVersionInfo.
Good luck.
Gerry.
|
|
|
|
|
I want to get the cchTextMax property of treeview item.
I'm using the following:
TVITEM tvitem;
tvitem.hItem = m_tree->GetSelectedItem();
tvitem.mask = TVIF_TEXT ;
m_tree->GetItem (&tvitem);
but it doesn't work
at the same time code:
TVITEM tvitem;
tvitem.hItem = m_tree->GetSelectedItem();
tvitem.mask = TVIF_IMAGE ;
m_tree->GetItem (&tvitem);
works correctly
|
|
|
|
|
You can't get just the length of the item's text. When you set TVIF_TEXT, the control expects you to pass in a buffer (along with its size, in cchTextMax). Since you don't have a buffer, the call fails.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
I want to get the cchTextMax property of treeview item.
I'm using the following:
TVITEM tvitem;
tvitem.hItem = m_tree->GetSelectedItem();
tvitem.mask = TVIF_TEXT ;
m_tree->GetItem (&tvitem);
but it doesn't work
at the same time code:
TVITEM tvitem;
tvitem.hItem = m_tree->GetSelectedItem();
tvitem.mask = TVIF_IMAGE ;
m_tree->GetItem (&tvitem);
works correctly
|
|
|
|
|
Have you tried...
CString strText = m_Tree->GetItemText(m_Tree->GetSelectedItem())
|
|
|
|
|
Hi all,
What is best algorithm for get space between two dates ?
For example space between:
01-02-97 to 05-01-98 ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
If you're using MFC, the CTime class overrides the - operator and returns a CTimeSpan class, so you can use it as follows:
CTime vtTime1, vtTime2;
CTimeSpan vtSpan;
vtTime1 = CTime::GetCurrentTime();
Sleep(20000);
vtTime2 = CTime::GetCurrentTime();
vtSpan = vtTime2 - vtTime1;
ASSERT(vtSpan.GetTotalSeconds() == 20);
If you're using OLE DATE classes, try COleDateTime and COleDateTimeSpan which do similar things.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Thanks for your reply,
But my dates is string ...
I can't use of CTimeSpan ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
You'll need to convert the strings to date first.
The best way is probably COleDateTime::ParseDateTime:
CString vstrStart("25 January 1996");
CString vstrEnd("10/01/01");
COleDateTime vtStartTime, vtEndTime;
COleDateTimeSpan vtSpan;
vtStartTime.ParseDateTime(vstrStart);
vtEndTime.ParseDateTime(vstrEnd);
vtSpan = vtEndTime - vtStartTime;
int viDaysDifferent = vtSpan.GetTotalDays();
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Thanks alooooooooooooot Mr.Derek.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Do you mean the time between the two dates?
CTime start, end;
CTimeSpan diff = end - start;
or
time_t start, end;
time_t dif = end - start;
|
|
|
|
|
Hello,
I've heard the easiest way of doing COM development with C++ is by leveraging the ATL. Can anybody recommend a good book introducing a medium skilled C++ developer to using ATL?
Any help is appreceated.
Thanks,
Matthias
|
|
|
|
|
The Beginning ATL book from Richard Grimes et al is full of detail but very dry. I found it made more sense AFTER I read 'teach yourself ATL in 21 days' ( OK, I usually run from books that have a time frame attached to the title, but this is from one of the C++ unleashed guys and very good ). Between the two I feel I have a grasp on HOW to use ATL, and I've bought ATL Internals to help learn WHY it does what it does. I came close to buying Richard Grimes 'Professional ATL' book, but online reviews caused me to buy 'Creating Lightweight ATL components' instead. When they arrive I guess I'll find out if I chose poorly, but I have no doubt ATL Internals will rock.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
Must be on the same reading list.
I have read all of these titles plus some others. While I have yet to find any one book covering the topic adequately, all of those mentioned here taken together form an excellent base of knowledge.
If I were to rank them I would get ATL in 21 days first to give a you start then move to ATL Internals and Professional ATL Programming.
|
|
|
|
|
Have you read Inside ATL from Microsoft Press?
I really like that book, and think it cover the topic adequately
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|