|
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.
|
|
|
|
|
The second parameter of the CMyView::OnLButtonDown is the point of the client area where the mouse was clicked. Knowing the initial position and size of your icon, you should be mathematically able to determine if the "mouse point" is in the icon rectangle, or not.
HTH,
K.
On the keyboard of life, always keep one finger on the escape key - Paul Watson
|
|
|
|
|
Didn't you ask this same question yesterday?
Where do you want the icon? Are you sure you're not talking about a toolbar button?
If the view is based on CFormView, you could put an "icon" control on it and load it with your .ICO file.
|
|
|
|
|
(previously posted on microsoft.public.vc.mfcole newsgroup)
I have discovered a problem when creating a COleClientItem with a document associated with one of the new multi-colored icons in Windows XP, or maybe when you insert the item into your Document.
What happen is that the icon simply isn't displayed.
I am not sure exactly what goes wrong but I have found that the MSDN sample "MFC Sample OCLIENT"
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/_sample_mfc_OCLIENT.asp) is showing the problem, so maybe someone else can explain it?
You can see a screenshot from a testrun of the OClient program (unmodified of course) on my WinXP here:
http://www.posselt.dk/OClient-error.JPG
What I have done is inserting 4 different objects using the Edit->"Insert New Object..." menu and choosing "Create from file". The .asf file is normally showing (e.g. in Explorer) an (multicolored) icon coming with Windows Media Player 9 and the .txt file the standard icon for Text-files coming with Windows XP.
I have looked every place I can think of but haven't been able to find anywhere describing this.
Can someone explain this, does someone know a work-around or can someone tell me how I can report this to Microsoft (haven't been able to find anywhere to report bugs)?
I am running Windows XP and uses Microsoft Visual C++ 6.0 with Service Pack 5.
/Peter Vestergaard
PS: Btw - the document do exist and I can open them by doubleclicking thesquares.
|
|
|
|
|
how to disable printscreen key when my program is running and enable printscreen key when my program closed?
|
|
|
|
|
Dunno if it's possible!
But you can make a hook and catch when printcreen button is pressed and then remove the content.
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
I would add my program to the clipboard notifier chain (SetClipboardViewer ) and wait until the clipboard changes (you receive a WM_DRAWCLIPBOARD ).
When the clipboard changes, check immediately if the Print Screen Key is pressed (GetAsyncKeyState ) and if it is, clear the clipboard (OpenClipboard, EmptyClipboard, CloseClipboard ).
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
1. Create a DLL that holds a System Wide Keyboard Hook.
2. Start the hook at the beggining of your program.
3. stop the hook when you want it...
NOTE 1:
you can also receive a notification from that DLL that the event has happened via a WM_XXX or whatever other method...
NOTE 2:
If you want to avoid the printscreen press only when your app has the focus you could avoid the system wide hook and hook only your app.
hope this helps.
|
|
|
|
|
I have a class with members that are pointers to the base class of derived classes... Here's a simplified example.
class CDerivedClass : public CBaseClass
{
DECLARE_SERIAL(CDerivedClass)
int something;
}
class CBaseClass : public CObject
{
DECLARE_SERIAL(CBaseClass)
...
void Serialize(CArchive &ar);
...
(data to archive)
}
class CCompoundClass : public CObject
{
DECLARE_SERIAL(CCompountClass)
...
void Serialize(CArchive &ar);
...
CBaseClass *ptrBaseClass; // points to the CDerivedClass
}
I dynamically allocate CDerivedClass, and set the CBaseClass pointer in the CCompoundClass to this object. I want to make the CCompoundClass Serializable, but don't seem to have the right recipe to pick up the derived class that ptrBaseClass points to. Any suggestions?
I read through the help documentation, but it doesn't cover this case.
|
|
|
|
|
I should have submitted this earlier... After scratching my head for a few hours, I deleted the object files (clean), rebuilt, and everything worked as expected.
|
|
|
|
|
Hi all,
I am connecting to sybase through my VC 6.0 DLL which gets called from PB
application, its is multithreaded DLL. I am using ODBC to connect sybase. I
am facing some major problems. I am connecting to (Ora, Syb, SQL) through
this sam DLL with ODBC.
The problems which i am facing is
1) Sybase not allowing to use Dynaset in recordset. if i use forwardonly it
works but not allows me to go back.
2) When this thread is ended, system gets hanged.
Although the same code is running perfectly with ORA,SQL server.
I am looking forward for some general way which will be applicable for all the databases.
Thanks
Ajaz
/***************Thread Code **************/
// check if new mails have arrived for the logged in dealer
UINT of_CheckNewMail(LPVOID lpnull)
{
CString l_SQL ;
CString msglabel ;
long ll_LastMsgCount,ll_LoopCount, ll_CurrMsg ;
l_SQL = "select mailid,ufrom,umsg,udate from kastlemail where uto =
'" + gsDealer + "' and (recieved is null or lower(recieved) <> 'y') " ;
KMailCount = new CRecordset(&gdb_Connection) ;
gdb_Connection.BeginTrans () ;
KMailCount->Open(CRecordset::dynaset, l_SQL,
CRecordset::noDirtyFieldCheck ) ;
while ( ib_StartMail == true )
{
TRY
{
KMailCount->Requery() ;
ll_CurrMsg = 0 ;
while ( !KMailCount->IsEOF())
{
ll_CurrMsg++ ;
KMailCount->MoveNext();
}
if ( (ll_CurrMsg > 0 ) && (ll_CurrMsg !=
ll_LastMsgCount) )
{
// show the popup window and let the
process stop for 3 sec
msglabel.Format ("%d%s", ll_CurrMsg, " New
Message");
popup->Show(msglabel);
while(popup->m_nAnimStatus > 0 );
ll_LastMsgCount = ll_CurrMsg ;
ll_LoopCount=0;
}
ll_LoopCount++;
if ( ll_LoopCount > 20 )
{
ll_LoopCount = 0 ;
ll_LastMsgCount = 0;
}
}
CATCH(CDBException, e)
{
::MessageBox(0, e->m_strError, "Kastle Mail Error",
MB_OK) ;
ib_StartMail = false ;
}
END_CATCH
Sleep(3000);
}
popup->Hide();
if(gdb_Connection.IsOpen())
gdb_Connection.Rollback () ;
if(KMailCount->IsOpen())
KMailCount->Close() ;
// close the cursor
::SQLFreeStmt( KMailCount->m_hstmt, SQL_CLOSE );
delete KMailCount ;
AfxEndThread(0);
delete popup;
return 0;
}
|
|
|
|
|
Hello, anyone knows hot to configure the Soap Trace Utility that comes along with the SOAP SDK 3.0.
I encounter difficulty in configuring it to trace .ASPX page.
In the help file. it stated
In the WSDL file, locate the <soap:address> element that corresponds to the service and change the location attribute for this element to port 8080. For example, if the location attribute specifies <http: myserver="" vdir="" service.wsdl=""> change this attribute to <http: myserver:8080="" vdir="" service.wsdl="">.
But, there is not WSDL file for a .ASPX file. The WSDL document is generated runtime by the .NET when passing the query string as http://localhost/test.aspx?WSDL
How to confgure it to the WSDL file? I need to trace the content of the SOAP communication between client and server.
Thank you.
|
|
|
|