|
Hi
i have the following bit of code which i use to pull
the 'date_in' field from my database, using ado
variant v_Time_Issued
vTime_Issued = cpSet->GetCollect(L"date_in");
date_in has the value 2003-04-22 10:19:18.000
i need to be able to format the vTime_Issued so that im just left with the
time
so all i want from date_in is 10:19
any ideas ?????
Si
|
|
|
|
|
You can create a COleDateTime with the vTime_Issued and then you can use the member function GetDay() and GetHour() to extract the required info.
Bye
|
|
|
|
|
You can create a COleDateTime with the vTime_Issued and then you can use the member function GetMinute() and GetHour() to extract the required info.
Bye
|
|
|
|
|
Use COleDateTime in your app or modify the SQL getting the date_in from the database to only show the time.
Jason Henderson My articles
"The best argument against democracy is a five-minute conversation with the average voter." - Winston Churchill
|
|
|
|
|
If you are using MFC, read on.
COleDateTime datetime;<br />
datetime.ParseDateTime("2003-04-22 10:19:18.000");<br />
TRACE("%s\n", datetime.Format("%H:%M"));
|
|
|
|
|
I’ll like to do, in Microsoft Visual C++, a user interface for W2000 OS with meters, button, indicators etc. self-made, same LabView interface.
Where I can find free tutorials, sample or book on this argument?
Thank you, Andrea.
acaselli@rolandeur.com
|
|
|
|
|
You want to make a UI for Windows 2000? I'm not sure I understand what you want.
|
|
|
|
|
I need to write a programm to visualize, for example, a fan that rotate with the indication of rpm (revolutions per minute), an analogic tachometer with the
needle, or a thermometer whit the column of mercury and a seven segment display. I know the article "Analog Meter Class" by Mark C. Malburg, but I'll like study in depth the argument.
Thank you, Andrea.
|
|
|
|
|
Hi, everyone!
When reading the following codes and after referencing the help of
TIME_ZONE_INFORMATION and GetTimeZoneInformation in MSDN. I
find I can hardly understand the meaning of the two data
structures. What puzzled me most is what means "DaylightDate" and
"StandardDate". So I want to know whether there are some tutorials
about this topic which is easy to understand?
Codes:
--------
TIME_ZONE_INFORMATION tzi;
int nTZBias;
if (GetTimeZoneInformation(&tzi) == TIME_ZONE_ID_DAYLIGHT)
{
nTZBias = tzi.Bias + tzi.DaylightBias;
}
else
{
nTZBias = tzi.Bias;
}
--------
Thanks in advance,
George
|
|
|
|
|
In some countries, one hour is added or removed depending on the current season. For example, in France, we have GMT+1 in summer and GMT+2 in winter. This is supposed to spare some energy to fit work hours with daylight, but it is very controversal.
So the Standard Date is the date when the time is actually set to your local time (which depends on your location on the planet). The Daylightdate is the date when the time is actually increased with an offset (usually 60 minutes) which can be negative.
On these two dates, Windows automatically updates the system time using whether the standard bias or the daylightbias. It also prompts the user on startup to let him know about it.
If you're not concerned about changing hours according to seasons, simply do not use the daylightdate.
Another word about the strings : these are simple info strings, nothing is really done with tehm, so you can put in them everything you want.
Hope this helps.
~RaGE();
|
|
|
|
|
Rage wrote:
. For example, in France, we have GMT+1 in summer and GMT+2 in winter.
Isn't it the other way 'round?
GMT+1 in Winter and GMT+2 in Summer?
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I wrote it the other way round, then corrected it. Honestly, I think you're right. Anyway, I guess even if I had written it right, someone would have wondered if it were not the contrary
~RaGE();
|
|
|
|
|
Hi, Rage buddy!
I have another question, I have referenced that
function "GetTimeZoneInformation" return value can
be TIME_ZONE_ID_UNKNOWN, TIME_ZONE_ID_STANDARD and
TIME_ZONE_ID_DAYLIGHT. I want to know why sometimes
it is TIME_ZONE_ID_DAYLIGHT and why sometimes it is
TIME_ZONE_ID_STANDARD? By what the return value is
determined?
Can you show me an example?
Thanks in advance,
George
|
|
|
|
|
George2 wrote:
By what the return value is
determined?
MSDN
Return Values
If the function succeeds, the return value is one of the following values:
Value Meaning
TIME_ZONE_ID_UNKNOWN The system cannot determine the current time zone. This error is also returned if you call the SetTimeZoneInformation function and supply the bias values but no transition dates.
Windows NT: This value is returned if daylight savings time is not used in the current time zone, because there are no transition dates.
TIME_ZONE_ID_STANDARD The system is operating in the range covered by the StandardDate member of the TIME_ZONE_INFORMATION structure.
Windows 95: This value is returned if daylight savings time is not used in the current time zone, because there are no transition dates.
TIME_ZONE_ID_DAYLIGHT The system is operating in the range covered by the DaylightDate member of the TIME_ZONE_INFORMATION structure.
If the function fails, the return value is TIME_ZONE_ID_INVALID. To get extended error information, call GetLastError.
So, the return value tells you if the system time is currently the standard one or the daylight one. If your system date is between SYSTEMTIME DayLightDay and SYSTEMTIME StandardDate, it will return you TIME_ZONE_ID_DAYLIGHT. If your system date is between SYSTEMTIME StandardDate and SYSTEMTIME DayLightDay it will return you TIME_ZONE_ID_STANDARD. (Maybe that's the other way round, but I think you have got the idea, now). The SYSTEMTIME I'm talking about are the one retrieved with GetTimeZoneInformation()
~RaGE();
|
|
|
|
|
Thanks, Rage buddy!
George
|
|
|
|
|
Thanks, Rage buddy!
George
|
|
|
|
|
Hey Lads,
Just trying touse IsPwrHibernateAllowed() . The files all compile fine but gives me LNK2019 error when it tries to link. The function is in the header file Powrprof.h and this works fine in VS 6 [Well it did for me before. Don't have VS 6 installed on this machine]
Any ideas??
I'm using VS.NET 2003
error
error LNK2019: unresolved external symbol "unsigned char __stdcall IsPwrHibernateAllowed(void)" (?IsPwrHibernateAllowed@@YGEXZ) referenced in function "private: void __thiscall CShutdownManagerDlg::CheckStates(void)" (?CheckStates@CShutdownManagerDlg@@AAEXXZ)
Regards,
Brian Dela
|
|
|
|
|
Try linking to Powrprof.lib.
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Thanks for the advice Dominik. I had already tried that but it doesn't make a difference.
Regards,
Brian Dela
|
|
|
|
|
Hi,
Does anybody know why 'SetLayeredWindowAttributes' doesnt work on a docking bar? How can i use transparency on it?
Could anyone help me on this matter - I would be eternally grateful.
Thanks for your time.
Richard
PS. Example source code or just a nudge in the right direction would be great!;)
|
|
|
|
|
Transparency only works with top-level windows.
Joel Lucsy
|
|
|
|
|
Cheers. I thought so.
Just needed to make sure.
Thanks for your time!
Rich
|
|
|
|
|
Hiya I need to be able to put an icon on the client area(white area) of my single document app, and then be able to click that icon to call my dialog.
I have tried first of all putting the icon on the client area but am having no luck. How do I get a pointer to the client area so I might be able to use SetIcon to put it on.
I am really stuck on this.
Does anyone have any way of doing this??
Thanks,
grahamoj.
|
|
|
|
|
You could the view of your app to do so.
* Draw your icon in the method CMyView::OnDraw (you can use an attribute image list to do so: load the icon in the image list at the creation, and use the method CImageList::Draw)
* Catch the message WM_LBUTTONDOWN in your view, and in the method CMyView::ONLButtonDown check if the mouse input was on your icon. If yes, launch your dialog box.
HTH,
K.
On the keyboard of life, always keep one finger on the escape key - Paul Watson
|
|
|
|
|
Thanks, I did ask the same question yesterday but tried to explain more in detail what I was trying to do. Anyway I have Created an image list and have drawn the icons onto the "client area"..
Now I am stuck on how I know if the icon has clicked.. I can add the OnLButtonDown, but how do I then check if an icon was pressed and which icon was also clicked. I will have a few icons on the client area.
Thanks for ur help.
grahamoj.
|
|
|
|