|
, code ?
|
|
|
|
|
mk79 wrote: C where in the function parameter does not contain any device context
And how do you get your Device Context for drawing?
(i.e. post code please...)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Can you show snippet code
|
|
|
|
|
Hi
How can we find out the difference between dates.Is there any method to find that .please kindely help me.
#sanroop#
|
|
|
|
|
Have you tried using class COleDateTime ,COleDateTimeSpan ?
|
|
|
|
|
Iam very thankful for your raply.I saw all methods in COleDateTime,COleDateTimeSpan here my problem is to find the difference between current date and any otherdate what ever i give.
#sanroop#
|
|
|
|
|
|
Sanroop wrote: ...my problem is to find the difference between current date and any otherdate what ever i give.
Which is what COleDateTimeSpan does, assuming you are using MFC. Otherwise, check out difftime() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
What format are your dates in?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
For converting to FILETIME you may use:
1) LocalFileTimeToFileTime()
2) "Converting a time_t Value to a File Time" article in MSDN
3) DosDateTimeToFileTime()
The FILETIME structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
This time format is the most sensitive I ever met in Windows.
You may just construct an INT64 numbers and subtract them.
Every 10000 units == 1 millisecond (1/1000 second)
So I second contains 1000*10000 units.
Good Luck!
|
|
|
|
|
Hi,
I have a project to do which consists on implementing a solution to make firewalls more dynamic.
The code which I should write it must be integrated in XP firewall, free BSD,... .
How can I find an API compatible with different OS and which can manage firewall rules.
Thanks.
|
|
|
|
|
Search for UPnP. It has limited use in opening and closing ports and manipulating port
forwarding on UPnP-enabled devices.
If firewalls were programmable they'd be kinda useless
|
|
|
|
|
|
From what i've understood, the mainframe title is stored in the string table. How can i change it at runtime?
Here's what i want to do:
Let's say the application title is MyApp. For some reasons it becomes MyApp USERID. Doing this for the main window is easy with setwindowtext, but when i open a document it switches back to MyApp and the title switches from "MyApp USERID" to "My App - Document1"
How do i change it so that it doesn't change back?
|
|
|
|
|
eusto wrote: the mainframe title is stored in the string table.
CDocument::SetTitle . Read the docs too.
|
|
|
|
|
I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much
|
|
|
|
|
eusto wrote: I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much
That's how it's to be done in DV architecture.
If you want to force a different behavior override UpdateFrameTitleForDocument which again is not a virtual function.
You would like to look up FWS_ADDTOTITLE and FWS_PREFIXTITLE .
|
|
|
|
|
Nibu babu thomas wrote: If you want to force a different behavior override UpdateFrameTitleForDocument which again is not a virtual function.
If its not virtual, how different behaviour can be forced ?
|
|
|
|
|
eusto wrote: I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much
One line of code is too much. How so?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
AfxGetMainWnd()->SetWindowText("My Title");
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Override CFrameWnd::OnUpdateFrameTitle() . The application framework calls this method whenever it needs to update the frame's caption. On-demand updating is preferred to setting a modified title. (Why? Because it reduces the chance of programmer error and centralizes the title logic to a single location.)
/ravi
|
|
|
|
|
Hi all
I have loaded (a copy just in case) of my project from VS2003 at VS 2005, it was converted fine with just a few errors that I fixed but I still have this one that I dont understand. I´m not an expert, I´ve few months programming MFC self learning and still a lot to learn.
The error Line :
static CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData);
The compiler error:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Can I continue with my MFC project at VS2005 with no problems at all?
Why I cant see my dialogs, main form , etc.. just the code?
Where are they!!?
thx in advance.
Jdg
---------------------------------------------
"Don't panic!. All will become clear in time"
WYS Is Not always WYG
|
|
|
|
|
jarleydg wrote: The error Line :
static CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData);
The compiler error:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Modify this declaration to,
static int CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData);
jarleydg wrote: Why I cant see my dialogs, main form , etc.. just the code?
Where are they!!?
They are in resource explorer. Aren't they ?
|
|
|
|
|
Done thanks.
ups... sorry resource explorer! was hidden.. stupid me. =/
Well the previous part compiled ok, but I´m using too this code from MSDN by Paul DiLascia where he encapsulated SHBrowseForFolder in a class FolderDlg... http://msdn.microsoft.com/msdnmag/issues/05/06/CAtWork/default.aspx
At VS2003 it was working ok... but now I´m having this fatal error...
So my project still can´t compile
please any help apretiated .
thanks in advance.
FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT<char,class strtraitmfc_dll<char,class="" atl::chtraitscrt<char=""> > > __cdecl _DbgName(long)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z)
FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT<char,class strtraitmfc_dll<char,class="" atl::chtraitscrt<char=""> > > __cdecl _DbgName(struct _GUID const &)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@ABU_GUID@@@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z)
FolderDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall CInterfaceNames::CInterfaceNames(struct DBGINTERFACENAME *,unsigned int)" (??0CInterfaceNames@@QAE@PAUDBGINTERFACENAME@@I@Z) referenced in function "void __cdecl `dynamic initializer for '_initMyDBI''(void)" (??__E_initMyDBI@@YAXXZ)
.\Debug/adquisition.exe : fatal error LNK1120: 3 unresolved externals
---------------------------------------------
"Don't panic!. All will become clear in time"
WYS Is Not always WYG
|
|
|
|
|
jarleydg wrote: FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(long)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z)
FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(struct _GUID const &)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@ABU_GUID@@@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z)
Probably you are using _DbgName , but linker is not getting its definition. In release build its definition is suppressed.
jarleydg wrote: FolderDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall CInterfaceNames::CInterfaceNames(struct DBGINTERFACENAME *,unsigned int)" (??0CInterfaceNames@@QAE@PAUDBGINTERFACENAME@@I@Z) referenced in function "void __cdecl `dynamic initializer for '_initMyDBI''(void)" (??__E_initMyDBI@@YAXXZ)
.\Debug/adquisition.exe : fatal error LNK1120: 3 unresolved externals
Same case is with class CInterfaceNames . Its for debug configuration only. In release confiruation, its defn's are suppressed, hence error.
|
|
|
|