|
_strtoi64 (in the CRT)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Sorry for this long post
I want to compile this whole project (see link below)
http://www.codeproject.com/KB/cpp/loggerservice.aspx[^]
While building the loggertest_src.zip solution I get it to compile but I got three warnings.
The following is the log for the loggertest_src.zip solution
In it the log says WINVER not defined. How to define it for Windows XP, it says defaulting to VISTA, but I'm running XP. And there are three warnings.
1>------ Rebuild All started: Project: LoggerTest, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'LoggerTest', configuration 'Debug|Win32'
1>Compiling...
1>StdAfx.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>Compiling...
1>ClientPipeInstance.cpp
1>Logger.cpp
1>c:\documents and settings\manzoor\desktop\loggertest_src\usr\src\logger\common\logger.cpp(128) : warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> f:\program files\microsoft visual studio 9.0\vc\include\stdio.h(358) : see declaration of '_snprintf'
1>c:\documents and settings\manzoor\desktop\loggertest_src\usr\src\logger\common\logger.cpp(130) : warning C4996: '_vsnprintf': This function or variable may be unsafe. Consider using _vsnprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> f:\program files\microsoft visual studio 9.0\vc\include\stdio.h(358) : see declaration of '_vsnprintf'
1>LoggerTest.cpp
1>c:\documents and settings\manzoor\desktop\loggertest_src\usr\src\logger\loggertest\loggertest.cpp(54) : warning C4996: 'CWinApp::Enable3dControlsStatic': CWinApp::Enable3dControlsStatic is no longer needed. You should remove this call.
1> f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxwin.h(4821) : see declaration of 'CWinApp::Enable3dControlsStatic'
1>LoggerTestDlg.cpp
1>SecurityToken.cpp
1>Sleeper.cpp
1>Generating Code...
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>Embedding manifest...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://C:\Documents and Settings\Manzoor\Desktop\loggertest_src\usr\src\logger\LoggerTest\Debug\BuildLog.htm"
1>LoggerTest - 0 error(s), 3 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
>
Now how to compile the loggerclient_src.zip, all it contains are header files and .cpp files. Should I create a new project and import all the files and then simply build the it.
And with loggerservice_src.zip, when I opened the .dsw file (VC++ 6 Workspace) I got the offer to convert it to the current C++ project format, so I clicked Yes to All, and after that another window popped up which says "The source control provider associated with this solution could not be found. The projects will be treated as not under source control.
Do you want to permanently remove the source control bindings from the projects?"
I got the option of Yes, No, Help
When I clicked Yes, I got this log
1>------ Build started: Project: logger, Configuration: Debug Win32 ------
1>Creating Type Library...
1>Processing .\logger.idl
1>logger.idl
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.idl
1>oaidl.idl
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\objidl.idl
1>objidl.idl
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\unknwn.idl
1>unknwn.idl
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\wtypes.idl
1>wtypes.idl
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\basetsd.h
1>basetsd.h
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\guiddef.h
1>guiddef.h
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.idl
1>ocidl.idl
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oleidl.idl
1>oleidl.idl
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\servprov.idl
1>servprov.idl
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\urlmon.idl
1>urlmon.idl
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\msxml.idl
1>msxml.idl
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.acf
1>oaidl.acf
1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.acf
1>ocidl.acf
1>Compiling...
1>StdAfx.cpp
1>statreg.cpp is obsolete. Please remove it from your project.
1>atlimpl.cpp is obsolete. Please remove it from your project.
1>Compiling...
1>logger.cpp
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(90) : error C2220: warning treated as error - no 'object' file generated
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(90) : warning C4996: 'ATL::CRegKey::SetValue': CRegKey::SetValue(TCHAR *value, TCHAR *valueName) has been superseded by CRegKey::SetStringValue and CRegKey::SetMultiStringValue
1> f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5123) : see declaration of 'ATL::CRegKey::SetValue'
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(91) : warning C4996: 'ATL::CRegKey::SetValue': CRegKey::SetValue(TCHAR *value, TCHAR *valueName) has been superseded by CRegKey::SetStringValue and CRegKey::SetMultiStringValue
1> f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5123) : see declaration of 'ATL::CRegKey::SetValue'
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(252) : warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> f:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'vsprintf'
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(444) : warning C4996: 'ATL::CRegKey::QueryValue': CRegKey::QueryValue(TCHAR *value, TCHAR *valueName) has been superseded by CRegKey::QueryStringValue and CRegKey::QueryMultiStringValue
1> f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5135) : see declaration of 'ATL::CRegKey::QueryValue'
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(518) : warning C4996: '_tcstok': This function or variable may be unsafe. Consider using _tcstok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> f:\program files\microsoft visual studio 9.0\vc\include\tchar.h(1550) : see declaration of '_tcstok'
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(519) : warning C4996: '_tcstok': This function or variable may be unsafe. Consider using _tcstok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> f:\program files\microsoft visual studio 9.0\vc\include\tchar.h(1550) : see declaration of '_tcstok'
1>LogInstance.cpp
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\loginstance.cpp(174) : error C2220: warning treated as error - no 'object' file generated
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\loginstance.cpp(174) : warning C4996: '_splitpath': This function or variable may be unsafe. Consider using _splitpath_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> f:\program files\microsoft visual studio 9.0\vc\include\stdlib.h(786) : see declaration of '_splitpath'
1>LogMap.cpp
1>PipeData.cpp
1>SecurityToken.cpp
1>ServerPipeInstance.cpp
1>Sleeper.cpp
1>Generating Code...
1>Build log was saved at "file://C:\Documents and Settings\Manzoor\Desktop\loggerservice_src\usr\src\logger\Debug\BuildLog.htm"
1>logger - 2 error(s), 7 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Now when I clicked No, I got this log
1>------ Build started: Project: logger, Configuration: Debug Win32 ------
1>Compiling...
1>StdAfx.cpp
1>statreg.cpp is obsolete. Please remove it from your project.
1>atlimpl.cpp is obsolete. Please remove it from your project.
1>Compiling...
1>logger.cpp
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(90) : error C2220: warning treated as error - no 'object' file generated
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(90) : warning C4996: 'ATL::CRegKey::SetValue': CRegKey::SetValue(TCHAR *value, TCHAR *valueName) has been superseded by CRegKey::SetStringValue and CRegKey::SetMultiStringValue
1> f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5123) : see declaration of 'ATL::CRegKey::SetValue'
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(91) : warning C4996: 'ATL::CRegKey::SetValue': CRegKey::SetValue(TCHAR *value, TCHAR *valueName) has been superseded by CRegKey::SetStringValue and CRegKey::SetMultiStringValue
1> f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5123) : see declaration of 'ATL::CRegKey::SetValue'
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(252) : warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> f:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'vsprintf'
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(444) : warning C4996: 'ATL::CRegKey::QueryValue': CRegKey::QueryValue(TCHAR *value, TCHAR *valueName) has been superseded by CRegKey::QueryStringValue and CRegKey::QueryMultiStringValue
1> f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5135) : see declaration of 'ATL::CRegKey::QueryValue'
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(518) : warning C4996: '_tcstok': This function or variable may be unsafe. Consider using _tcstok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> f:\program files\microsoft visual studio 9.0\vc\include\tchar.h(1550) : see declaration of '_tcstok'
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(519) : warning C4996: '_tcstok': This function or variable may be unsafe. Consider using _tcstok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> f:\program files\microsoft visual studio 9.0\vc\include\tchar.h(1550) : see declaration of '_tcstok'
1>LogInstance.cpp
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\loginstance.cpp(174) : error C2220: warning treated as error - no 'object' file generated
1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\loginstance.cpp(174) : warning C4996: '_splitpath': This function or variable may be unsafe. Consider using _splitpath_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> f:\program files\microsoft visual studio 9.0\vc\include\stdlib.h(786) : see declaration of '_splitpath'
1>Generating Code...
1>Skipping... (no relevant changes detected)
1>LogMap.cpp
1>PipeData.cpp
1>SecurityToken.cpp
1>ServerPipeInstance.cpp
1>Sleeper.cpp
1>Build log was saved at "file://c:\Documents and Settings\Manzoor\Desktop\loggerservice_src\usr\src\logger\Debug\BuildLog.htm"
1>logger - 2 error(s), 7 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Would anyone tell me a way to compile this whole project?
modified on Friday, July 25, 2008 1:42 PM
|
|
|
|
|
Well, your message is not very well formated: it's impossible to read everything. Don't use the CODE block for messages so large.
In fact, what happens is that there are some warnings due to the new version of the IDE (some functions were deprecated) but the guy from were you downloaded the code specified that all the warnings should be treated as errors. You can simply remove that option by going into the project settings: C/C++ -> General -> Treat Warnings As Errors and specify No.
This should fix the problem. Alternatively, it would be nice to fix the warnings too by looking at the text of the warning and try to understand it. For some of them, it's really not that difficult (when it reads "Consider using _snprintf_s instead", I think it is quite understandable).
|
|
|
|
|
I'm not that good. All I want is this whole project compiled
Would compiling with Visual Studio 6 solve the problem, or I would still need to do some editing in VC 6 ?
|
|
|
|
|
Did you read the first part of my message where I explain how to fix the problem ?
manzoor10 wrote: Would compiling with Visual Studio 6 solve the problem, or I would still need to do some editing in VC 6 ?
I the code was developed with VC6, then there should not be any problem compiling it. But as I already said that you just have to disable the 'Treat Warning As Error' option (read my post once again, I explain where you have to go to disable that option).
EDIT: to open the project properties, click on 'Project' in the menu then '... Properties' (with the dots being your project name). This is for VC2005, I don't know which IDE you are using, but it should be quite similar.
|
|
|
|
|
I did as you said and build the loggertest_src.zip with no errors and warnings but how to build the others loggerclient_src and loggerservice_src
|
|
|
|
|
Well, you also deactivate the 'Treat Warnings As Errors' the same way you did for the first project...
|
|
|
|
|
Yup did it all, but the loggerclient is still remaining ? How to do that ? the source and header files in loggerclient are also in loggertest, and I have compiled loggertest successfully, so is there still need to compile the loggerclient, if so how to do it?
|
|
|
|
|
I have general question the various WM_CTLCOLOR mess e.g .STATIC, EDIT etc when you are processing controls for Child controls on a modeless dialog box
Can you do the same processing that you can on a WM_PAINT for a Parent window
for instance setting a font via SelectObject in this case I am thinking of WM_CTLCOLORSTATIC
Just trying to get an overall picture
|
|
|
|
|
I'm not sure it will work there. The docs only mention changing colors.
You can set the font for a control with WM_SETFONT. Even if it works in
a WM_CTLCOLORSTATIC handler, there's no need to do it there.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Call WM_SETFONT when you initialise your dialog (in WM_INITDIALOG); the control will remember it. Delete your HFONT only after the dialog goes away; the control holds a reference to it.
|
|
|
|
|
What then would be the difference between the 5 I think its WM_CTLCOLOREDIT ... STATIC
and the WM_CTLCOLOR (HI_WORD)(Lparam) CTLCOLOR_STATIC, EDIT, BTN
Do they all do/expect the same processing
|
|
|
|
|
The functionality is the same, but WM_CTLCOLOR is a leftover from 16-bit
Windows.
And it looks like there's 6 of them
WM_CTLCOLOR Message[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hello,
i have a main dialog and i need to put a tab control on this,
every tab has own dialog on it, but to avoid to make a too wide main dialog i like to use tab control with more then one row of tabs, like property pages!
But don't now how to start, can someone give me some suggestions how to begin with this problem?
And if is possible with function to disable some tabs(make it Grey)!
TAB TAB TAB // first row
TAB TAB TAB // next row
I have now a simple CTabCtrl, but this can only show one row of tabs,
and without possibility to disable some tabs!
Thanks for any help
termal
|
|
|
|
|
Hi termal,
maybe you could find a multiline tab control here[^].
Best regards,
Mihai Moga
|
|
|
|
|
If I have a timer that is set at an interval of like 1/4 sec to perform actions in FunctionPoll() and if I am inside a function, ImportantCalculations(), what happens to the operations inside ImportantCalculations() when FunctionPoll() encounters a timer?
Do the operations inside ImportantCalculations() finish and then the timer jumps in with FunctionPoll()?
The application I have is built under VS2005 using MFC.
Thanks.
|
|
|
|
|
In a simple single-threaded scenario the answer is basically yes. MFC Timers are as far as I know still exposed via Windows messages. If your timer callback function overruns all that will mean is there will already be another WM_TIMER message waiting on the message queue to get processed wheenever you get to it. The next timer callback will in effect run late and the next and the next. Once you get into a multi threaded situation where timers can effectively interrupt worker threads or start new ones then things very quickly get a lot more complicated.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
i want to get the following detatils for a file
Name
Root
BlockSize
FileSystemSize
AvailableSpace
ReadOnly
EncryptionMethod
CompressionMethod
CaseSensitive
CasePreserved
CodeSet
MaxFileNameLength
ClusterSize
FileSystemType
PersistenceType
OtherPersistenceType
NumberOfFiles
IsFixedSize
ResizeIncrement
is any API is there to get these informations
vineesh
|
|
|
|
|
you can use
GetFileInformationByHandle
typedef struct _BY_HANDLE_FILE_INFORMATION
{
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD dwVolumeSerialNumber;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
DWORD nNumberOfLinks;
DWORD nFileIndexHigh;
DWORD nFileIndexLow;
}
BY_HANDLE_FILE_INFORMATION,
*PBY_HANDLE_FILE_INFORMATION;
modified on Friday, July 25, 2008 7:50 AM
|
|
|
|
|
Hello dudes,
I am writing an application which places itself to systray when minmized.
When user right clicks to icon, I pop-up a menu and my problem starts here.
I want to close pop up window when it loses focus, I also wanna catch events from menu.
This is how I open menu:
POINT xy;
GetCursorPos(&xy);
HMENU menu = LoadMenu(this->appInstance, MAKEINTRESOURCE(350));
BOOL b = TrackPopupMenuEx(GetSubMenu(menu, 0),
TPM_RIGHTALIGN|TPM_BOTTOMALIGN|TPM_LEFTBUTTON|TPM_RETURNCMD,
xy.x, xy.y, this->getHWND(), NULL);
So how I am supposed to MAP events from menu, i am using MFC?
Thank you all...
|
|
|
|
|
for the first problem: just call setforegroundwindow() before trackpopupmenu().
secondly if u r usig mfc, u can have message map entry for every command and if not then u trap the command in the wndproc().
enjoy
Pras
|
|
|
|
|
Ok I know that but cannot find how to do it?
I create my menu from a resource with id 350.
And here is my message map:
BEGIN_MESSAGE_MAP(CMyWnd, CDialog)
ON_WM_CLOSE()
ON_WM_SIZE()
ON_WM_TIMER()
ON_BN_CLICKED(152, ...)
ON_BN_CLICKED(156, ...)
ON_BN_CLICKED(171, ...)
ON_BN_CLICKED(172, ...)
ON_BN_CLICKED(173, ...)
ON_BN_CLICKED(174, ...)
ON_BN_CLICKED(175, ...)
ON_BN_CLICKED(176, ...)
ON_BN_CLICKED(177, ...)
ON_MESSAGE(WM_USER_SHELLICON, ...)
END_MESSAGE_MAP()
Thanks....
|
|
|
|
|
dehseth wrote: What should I write here to get menu messages?
Typically ON_COMMAND and ON_UPDATE_COMMAND_UI are used for menus.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yeah I have read a lil bit but I couldnt make it work...
I have tried a map
ON_MESSAGE(WM_COMMAND, Menu_Message)
also
ON_MESSAGE(WM_MENUCOMMAND, Menu_Message)
but still didnt worked!
This is my function which I hope to handle messages:
LRESULT CMemorizerWnd::Menu_Message(WPARAM wp, LPARAM lp)
well in debug mode it never enters to my function.
So I am still looking for a solution for this...
|
|
|
|
|