|
Hi Derek,
If you can wait a few days for this, I'm writing an article on how to solve this problem, that is how to enable default state for an owner-draw button.
I wrote 1/2 article, so please be patient.
Paolo.
|
|
|
|
|
So far I've implemented it as a separate function call in the class, which provides access to a boolean data member.
I'll be interested to read your article.
|
|
|
|
|
I need to convert a double to a string, because i want to use setwindowtext, but i don't know we could use ecvt(), or fcvt(). How do they work?
thanks.
gerald
|
|
|
|
|
There's plenty of examples on the web & msdn.
int sign=0, decimal=0;
double dval=9999.9999;
char* str;
str = _ecvt(dval, 10, &sign, &decimal);
Easy way.
char buf[21]={0x00};
double dValue = 9.9;
sprintf(buf,"%.2f",dValue);
Only thing to watch is the precision with formatting strings.
Gerry.
|
|
|
|
|
I have created a Dialog box app. All my processing is in ***dlg.cpp.
The app runs fine except for ... The window does not refresh. I have to move the
mouse over the app to refresh the window.
I have tried ShowWindow(SW_SHOW) and UpdateData(FALSE) to no avail.
Please Help.
Thanx
Leezo
|
|
|
|
|
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
|
|
|
|