|
How about:
SYSTEMTIME st;
GetSystemTime(&st);
COleDateTime utc(st);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Excellent, thank you very much!
|
|
|
|
|
Hello everyone!
I have a project based on Property Wizard Component which have four propertypages .
Now i am trying to make them displayed as maximum/minimum size when they come out to the user.
At first i tried to use SendMessage(WM_SYSCOMMAND,SC_MAXIMUM,NULL) in the initdialog() of my proppage,but it seems there is no respone to the message .
and i found that it appears no response although i have tick on the maximize/minimize box in the styles of the dialog property.
i don't know what to do now .I wonder if there is anyone can help me
ThanX in advance!!!!!!!!!!!!!
|
|
|
|
|
By design, the initial size of the sheet is governed by the size of the largest page.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello sir,
thanx for your reply!
Do you mean that we can not resize or maximize/minimize our properpage in our Wizard ? i do not think so, there are quite a lot of articles just in codeproject teach us how to resize them,so i think we can maximize them,but i don not know how toooooooo
|
|
|
|
|
Now i see how to solve that ,just use SendMessage(WM_SYSCOMMAND,SC_MAXIMIZE,NULL) in the initdialog() of CPropertySheet.
ThanX Again,sir!!!!!!!!!!
|
|
|
|
|
steven_wong wrote:
Do you mean that we can not resize or maximize/minimize our properpage in our Wizard ? i do not think so
Per MSDN:
PropertySheet automatically sets the size and initial position of a property sheet. The position is based on the position of the owner window, and the size is based on the largest page specified in the array of pages when the property sheet was created.
steven_wong wrote:
there are quite a lot of articles just in codeproject teach us how to resize them...but i don not know how toooooooo
So why not just consult those articles to find out how?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello guys!
Anybody here knows the maximum allowable length of the Standard C++ string class?
Thanks!
|
|
|
|
|
As much as memory allows!
I Dream of Absolute Zero
|
|
|
|
|
don't really know, but maybe having a look at the indexes type will let you gess the max of items allowed...
physically, you will certainly be limited before you reach the logical limit of the string...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Have a look at basic_string::max_size() . I think that STL does not have a maximum length requirement, thus the reason why max_size() is a function and not a normal data member or a constant.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Thank you for your help.
Do you guys know where to get a detailed documentation on basic_string's max_size() function?
MSDN library does not elaborate on this... it only include a sample function.
I really need to support my solution.
Thanks a million!
|
|
|
|
|
Hello,
I am trying to use the windows serial port driver using VC++(MFC). I need to work with 76800 baud. But the function "SetCommState" is returning error "Parameter incorrect" when i fill DCB struct with 76800 baud.
Can any one please help in this regard.
I have downloaded serial classes from net, but My requirement is not working.
Thanks in advance
sivack
|
|
|
|
|
Could some kind soul please PLEASE tell me how to go about subclassing the CCheckListBox control within an OCX. I can see how to create a WinApp Dialog with a CCheckListBox etc, but for the life of me I cannot work out how to create an OCX based on the CCheckListBox and would apreciate any advise available.
|
|
|
|
|
When I compile a project which has a particular header file (marked in bold) included, I get the following error:
Compiling...
NEVEMRepositorySetupHelper.cpp
NEVEMSystemUtilities.cpp
e:\vem\product ev\version4.05\vc\src\vem\nevservicecontrolmanager\cnevservicesmanager.h(32) : error C2143: syntax error : missing ',' before '&'
e:\vem\product ev\version4.05\vc\src\vem\nevservicecontrolmanager\cnevservicesmanager.h(32) : error C2059: syntax error : '&'
Error executing cl.exe.
NEVEMRepositorySetupHelperD.lib - 2 error(s), 0 warning(s)
However, this particular header file is the part of another project and that one complies perfectly. What is going wrong?
Regards
Jos
|
|
|
|
|
Post the line(s) that's been flagged (line 32 in the header).
I Dream of Absolute Zero
|
|
|
|
|
This is the line.
HRESULT LogNTEvent(const LONG lSeverity, const CString & sAppName, const CString & sVersion, const CString & sFile, const LONG lLine, const LONG lErrorCode, const CString & sMsg1, const LONG lPassingCode, const CString & sMsg2);
the implementation for it is given below:
HRESULT LogNTEvent(const LONG lSeverity, const CString &sAppName, const CString &sVersion, const CString &sFile, const LONG lLine, const LONG lErrorCode, const CString &sMsg1, const LONG lPassingCode, const CString &sMsg2)
{
HRESULT hResult = S_OK;
IEVEventLog* pIEventLog = NULL;
long lMySeverity = 1;
if ( 0 <= lSeverity && 4 >= lSeverity )
lMySeverity = lSeverity;
// Write to debug trace log
CString sTraceMsg0;
sTraceMsg0.Format( L"Filename %s: Line=%x, ErrorCode=%x, Message=%s, Method=%s, Passing=%d\n", sFile, lLine, lErrorCode, sMsg1, sMsg2 ,lPassingCode );
TRACE( sTraceMsg0 );
hResult = CoCreateInstance( __uuidof( EVEventLog ), NULL, CLSCTX_ALL, __uuidof( IEVEventLog ), (void**)&pIEventLog );
if ( FAILED( hResult ) )
return ((DWORD)0xC000110DL);
BSTR bsAppName = SysAllocString( L"Vigilance" );
BSTR bsFileName = sFile.AllocSysString();
BSTR bsFuncName = sMsg1.AllocSysString();
BSTR bsMethod = sMsg2.AllocSysString();
hResult = pIEventLog->LogEvent( bsAppName, ((WORD)0x0000000AL), lErrorCode, bsFileName, bsFuncName, lLine, bsMethod, lPassingCode, NULL, NULL);
pIEventLog->Release();
SysFreeString( bsAppName );
SysFreeString( bsFileName );
SysFreeString( bsFuncName );
SysFreeString( bsMethod );
if ( FAILED( hResult ) )
return ((DWORD)0xC000110DL);
return S_OK;
}
|
|
|
|
|
By chance is it complaining about the CString reference.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
me think you might be missing a , or something similar on line 32 or somewhere above that line; or in a another header file that was included just before that one.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
This is what is there in the header file
#ifndef _CNEVSERVICESMANAGER_H_
#define _CNEVSERVICESMANAGER_H_
// included header files
#include <atlbase.h>
#include <lm.h>
#include "../NEVEMXMLParsingUtilities/NEVEMResponseMessageParser.h"
#include "../NEVEMXMLParsingUtilities/CNEVEMSystemServiceStructure.h"
#include "../NEVEMXMLParsingUtilities/CNEVEMSystemServicesStructure.h"
#include "../NEVEMCommon/NEVEMCommon.h"
#include "NEVCOMUtils.h"
const int VIGILANCE_SERVICES = 0;
const int SYSTEM_SERVICES = 1;
const int GLOBAL_SERVICES = 2;
const int ORACLE_SERVICES = 3;
HRESULT LogNTEvent(const LONG lSeverity, const CString & sAppName, const CString & sVersion, const CString & sFile, const LONG lLine, const LONG lErrorCode, const CString & sMsg1, const LONG lPassingCode, const CString & sMsg2);
class CNEVServicesManager {
public:
CNEVServicesManager();
~CNEVServicesManager();
HRESULT CNEVServicesManagerInit(wstring & szVEMXMLResponseMessage);
// Service Controls
HRESULT stopService (const wstring & szServiceName, wstring & szVEMXMLResponseMessage);
HRESULT startService (const wstring & szServiceName, wstring & szVEMXMLResponseMessage);
HRESULT pauseService (const wstring & szServiceName, wstring & szVEMXMLResponseMessage);
HRESULT restartService(const wstring & szServiceName, wstring & szVEMXMLResponseMessage);
HRESULT getallServices(wstring & szVigilanceRelatedServicesXMLStructure, wstring & szVEMXMLResponseMessage);
HRESULT setServiceStartupInfo(const wstring & szSystemServiceXMLStructure, wstring & szVEMXMLResponseMessage);
HRESULT getServiceStartupInfo(const wstring & szServiceName,
wstring & szServiceDescription,
DWORD & dwServiceType,
DWORD & dwStartType,
bool & bInteractWithDesktop,
wstring & szStartupAccount, vector<vemresponsemessage>& vecResponseMessages);
HRESULT getServiceCurrentState(const wstring & szServiceName, DWORD & dwCurrentState, wstring & szVEMXMLResponseMessage);
private:
SC_HANDLE hSCManager;
SC_HANDLE hService;
map<wstring, int=""> mapVigilanceRelatedServicesNames;
// functions
HRESULT fillCNEVServiceInfoStruct(CNEVServiceInfoStruct& oCNEVServiceInfoStruct,
LPENUM_SERVICE_STATUS lpServices, vector<vemresponsemessage>& vecResponseMessages);
HRESULT getDependentServices (const wstring & szServiceName,
vector<wstring> & szDependentServices, vector<vemresponsemessage>& vecResponseMessages);
HRESULT getErrorMessage(const DWORD & dwErrCode, wstring & szErrorMessage);
wstring getServiceDisplayName(const wstring & szServiceName);
};
#endif
|
|
|
|
|
I have a dialog with a white background. When I create buttons on that dialog, themed buttons are drawn with a thin grey border. I tried correcting the problem by responding to WM_CTLCOLORBTN , but it didn't help. In fact, I never received a WM_CTLCOLORBTN message.
Any solutions to this problem is welcome.
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|
When dealing with most things custom drawn (custom drawn controls) I have found that XP Themes often fight me all of the way. I would suggest disabling themes for that application (maybe SetThemeAppProperties ?).
Modifying the painting of most button controls often requires that it be done as an ownerdrawn button, returning brush information from WM_CTLCOLORBTN is often not enough. You might have to resort to getting the theme information and using GetThemeColor(...) to paint them ownerdraw style.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I'm not drawing the button myself. It's a simple BS_PUSHBUTTON. It's just that the dialog has a white background. If you look closely on a button using the standard xp theme, you'll see that it is not rectangular - it's got rounded corners. It's this border between the buttons rectangle and it's "image" that turns grey, as if it's assuming it's on a grey dialog.
Very frustrating.
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|
Is this an owner-drawn button? 'Cause the only to change the appearance of a button control is to do you own drawing. Also the docs say that this message (WM_CTLCOLORBTN), only gets handled by an owner-drawn button.
I Dream of Absolute Zero
|
|
|
|
|
It's an ordinary button (not owner drawn), put on a dialog with a white background. No ownerdraw magic here.
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|