|
Hi
My environment is as follows:
Windows NT 4.0 Service Pack 5. Application built using VC++ 6.0.
Timezone - Pacific Time . Location - California USA
My application maintains a collection class of objects - and each object has a CTime member (among other members) . A Timer in my application performs certain operations on each object of this collection class - based on the CTime member and its relation to the current system time. The CTime member is populated based on a 6 byte unsigned char array received from a third part application (using a predefined external Interface) - and its value is always in GMT.
Problem Definition:
At 2 AM on the first Sunday of April (when DST takes effect) - my application receives "020000" from the external interface. But while encapsulating this into a CTime object - the value gets changed effectively to 1AM on the same day. This causes downstream problems on the Timer processing.
I need to maintain the CTime member exactly as I get from the third patry app.
Note: The "Automatically adjust clock for daylight savings time" checkbox is selected (and needs to be so).
I did try passing 0 as the DST parameter in the CTime constructor - but still see that time gets set back by an hour. Not sure if there are any pre-requisites for this to work - such as setting of TZ environment variable (which is not on my machine) etc.
The way the encapsulation to CTime is done is as follows:
- Set individual parameters of the unsigned char array to a SYSTEMTIME Structure - and passing the latter to a CTime Constructor.
This problem exists - as U can imagine - only if the unsigned char array carries values between 2 AM and 3 AM.
Any help will be greatly appreciated.
Thanx
JD
|
|
|
|
|
I'm having some wierd problems with c code compiled in the VS 7.0 studio.
the code is fairly simple:
create some arrays.
use sscanf to get data out of a buffer.
...
The problem
if i use printf, or sscanf (again) or even loop through one of the arrays, all data is corrupted.
Can anyone explain this?
by the way I'm switching to gcc today!
|
|
|
|
|
Most likely the problem lies in your code, not the compiler. If you could post some of the offending code, some readers here might provide more help.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi there,
I need to get the user name (and if possible the type (like normal user, guest or administrator)), in a program. This is used for sending messages to a central message box on a server, everybody should be able to read only his messages. This will be checked by verifying the name of the intended receiver and the user name.
Will your help also work under winXP?
|
|
|
|
|
Can't you use GetUserName()?
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
VC++ 6 with AppWizard DocView disabled, how does one open/activate a view based on CFormView as the result of some user action? The view will display/accept data to be used with an ADO data source.
I can add the form/view to the project source, but can not open the view at the appropriate time.
Thanks,
Vince
|
|
|
|
|
I have a SDI MFC application using CFormView dialogs. The stupid frame is always the same size when I open the application. What's the best way for me to make the application maximize on the screen? When I've tried to ShowWindow( SW_MAXIMIZE ); it seems to just ignore it. Thanks a bunch!
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
So do you have a call to ShowWindow(SW_MAXIMIZE) in your app's InitInstance() method?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Ok, I can maximize the window doing this in the InitInstance() method, but this poses another problem. In my view's OnInitialUpdate() function I position some windows in my dialog (texts, buttons, etc). I use the size of the window to center these, but when I maximize the window, the windows aren't centered correctly, is there another way to maximize the frame, before I have to initialize my views, so that their client coordinates match up with what I'm actually going to use? Should I be arranging their positions in a different function instead?
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
|
Hi all,
I have searched several places including message boards and Google, without any result! Have I missed something or am I the first to ask regarding this:
How can I create, or get an already available, invert pen? Which when used for drawing (ex. lines) it inverts all pixel colors it comes in “touch” with. I am not looking for the DrawFocusRect function, but a pen or function that draws an invert line.
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
Once you get a pointer or handle to a device context, call SetROP2 and pass in R2_NOT as the drawmode.
|
|
|
|
|
Thanks!
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
Could someone please let me know how I can get my CDHTMLDialog to scroll. I have tried "scroll = yes" in the Body tag of the html and setting the scrollbars in the dialog editor itself but niether seems to work. I have another app that scrolls just fine but his one will not cooperate. Any ideas. This must be a common newbie question
IDE: Visual Studio 2002
Lang: C++.
Project: MFC Dialog Based
TIA.
Matt (Padawan Learner)
|
|
|
|
|
What the heck is this and why did it fix my problem?
BOOL CAutoDlg::OnInitDialog()
{
SetHostFlags(DOCHOSTUIFLAG_NO3DBORDER);//enables scrolling???
CDHtmlDialog::OnInitDialog();
....
}
Matt (Padawan Learner)
|
|
|
|
|
CDHtmlDialog::OnInitDialog() calls
SetHostFlags(DOCHOSTUIFLAG_NO3DBORDER | DOCHOSTUIFLAG_SCROLL_NO).
Your call clears DOCHOSTUIFLAG_SCROLL_NO flag and enables scroll bars.
|
|
|
|
|
Thanks!
Matt (Padawan Learner)
|
|
|
|
|
please tell me how could i write a setup file for my project in visual c++ easily?
|
|
|
|
|
Hi Blake Coverett
thanks for your reply .
My english writing is very bad sorry.
i want unplug a mouse from computer and turn on it , then after loading the windowsxp , plug in the PS/2 mouse and open it's port and read its data bits .
please more help me .
I guess that RegisterRawInputDevices can help me , but I can't findout it . If possible for you help me more.
|
|
|
|
|
Hi Blake Coverett
thanks for your reply .
My english writing is very bad sorry.
i want unplug a mouse from computer and turn on it , then after loading the windowsxp , plug in the PS/2 mouse and open it's port and read its data bits .
please more help me .
I guess that RegisterRawInputDevices can help me , but I can't findout it . If possible for you help me more.
|
|
|
|
|
Ok help me out here now ;>
First of all this is only a thought i had and if you think it's totaly stupid, please do say so if you wish :P
Ok, here is the deal.. Im planing on making a type of resource manager, all "resources" should inherit by a class "Resource" that also takes an templated argument for a type...
template <class Type>
class Resource
{
private:
Type *m_Res;
public:
Resource();
virtual ~Resource();
virtual Type * GetResource() { };
virtual operator=(const Type &t) { };
}; // Etc etc
And thus enabling the user to still overload everything given by the base class if it's need for it, so for a texture for instance.
class Texture : Resource<IDirect3DTexture9>
{
public:
int Width;
int Height;
// Etc...
private:
bool Load(string);
// and all the stuff connected to it.
};
and a material
class Material : Resource<D3DMATERIAL9>
{
private:
// lots of strange stuff
public:
// same here
};
So far, i like the model and how i can use it for most stuff that i could call a resource... but here comes the problem, as its templated i cant use the class "Resource" as a "base" class for casting, so in the resource manager i cant just make a std::list<Resource> l; and then push back whatever that comes from resource.
ex:
class ResourceManager
{
private:
std::list<Resource *> m_ResList;
public:
bool Add(Resource *res) {
m_ResList.push_back(res);
}
};
If anyone even takes time to read this post i am soooo wanting ideas about this. Anyone want to help making it maybe better? .. A better way to make it? .. want me to throw it out the window . .whatever as long as you understand what i want to make you are welcome to reply
(Tired and dont even know how all that came out, if to many dont understand it just ignore it later ... I hope someone does tho
|
|
|
|
|
Could anybody explain me, any example very welcome:
I create modeless dialog, as follows:
in myTabControl.cpp // The source code for this class I downloaded from code guru page
void CMyTabControl::Init()
{<br />
m_tabCurrent=0;<br />
m_tabPages[0]->Create(IDD_DLG_TAB1, this);<br />
m_tabPages[1]->Create(IDD_DLG_TAB2, this);<br />
<br />
m_tabPages[0]->ShowWindow(SW_SHOW);<br />
m_tabPages[1]->ShowWindow(SW_HIDE);<br />
SetRectangle();<br />
}
I call Init() function in:
In Stp2View.cpp
void CStp2View::OnInitialUpdate()
{<br />
CFormView::OnInitialUpdate();<br />
GetParentFrame()->RecalcLayout();<br />
ResizeParentToFit();<br />
<br />
m_tab.InsertItem(0, _T("Table1"));
m_tab.InsertItem(1, _T("Table2"));<br />
<br />
m_tab.Init();<br />
}
My question is:
how can I update data in IDD_DLG_TAB1 Form, for example
in Stp2View.cpp
void CStp2View::OnMoveToNextRecord()<br />
{<br />
.....<br />
CString str = "test update data";<br />
UpdateData(TRUE);
ASSERT(::IsWindow(m_hWnd));
....<br />
((CDlgTab1*)tab.m_tabPages[0])->UpdateData(FALSE)
}
Thanks a lot ...
|
|
|
|
|
I found that i need to override PreTranslateMessage to trap events .
if(pMsg->message==WM_KEYUP ){
CString text;
text.Format("Key params %d ",pMsg->wParam);
AfxMessageBox(text);
return true;
}
I need to trap a sequence of ALT-CTRL-E ? How can I do this ?
|
|
|
|
|
If you're looking for all 3 keys to held down at the same time, just look for one of them (like "E") with PreTranslateMessage, then check keystate of others with GetAsyncKeyState. VK_CONTROL is virtkey for Ctrl, and VK_MENU is virtkey for Alt.
|
|
|
|
|
I just starting developing WMI programs on C++ but i have a problem: i can't connect to WMI namespace on remote machine... i want to make programm that will ask user account to connect WMI. I need some working example on C++... Can some one help me, please?
|
|
|
|