|
The problem is that the list control selects the very first item as well as the item you have selected. It does not do this in debug!, only Release version. Both versions are the same; only you select to compile "release" from the "debug" previous version. The code is the same.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Hi,
without seeing all relevant code, chances are slim anyone can help you. However, here are two hints
that may or may not apply.
1.
Larry Mills Sr wrote: The code is the same.
Even when the source file remains unchanged, its semantics may change, e.g. the meaning
of debug(), trace(), assert() may change, or some of your code may depend on a #defined symbol
(such as _DEBUG or so) resulting in some side-effect no longer being present, as in (I admit
it is an extreme example): assert(x=1);
in debug, this would set x to 1 and check for non-zero,
in release, this would do nothing at all, i.e. leave x unchanged.
Obviously what was meant is assert(x==1); which does not change a thing, whether debug or release.
2.
Several controls fire their "SelectionChanged" event more than once, e.g. when clicking an item,
they first report the loss of the old selection, then the new selection. This behavior often gets
overlooked.
|
|
|
|
|
Thanks, I think I fixed it though. On that particular List Control I forgot to set "Single Selection" to TRUE. But really I don't think it was supposed to do the other anyway. Anyway, it hasn't done the double selection in Release since I set it to single selection.
Thanks for your response.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Is using CreateFileMapping/MapViewOfFile functions means sharing "Memory" or "File" on the disk?
I compiled that code for both
-INVALID_HANDLE_VALUE, // use paging file (that is on the disk)
and
-"C:\\a.txt" //physical file too.
All of them works. And second process can show "Message from first process".
The second process calls:
1-) OpenFileMapping to get handle
2-) MapViewOfFile.
What is happening here?
Does
second process get handle to physical "file" which is on the disk and get "Message from first process" string which is written by first process to file.
or
Second process get handle to first process' physical "memory" and get string from its address space?
Are they communicating with writing/reading same file(pagefile or another file) on the disk or same memory?
Msdn Documentation which is about procedure for sharing data with CreateFileMapping/MapViewOfFile/OpenFileMapping is confused me.
Thanks.
|
|
|
|
|
The FileMapping stuff, when used by two processes on the same machine, is really sharing memory;
it optionally uses a file as a backup or for persistency if you indicated that is what you want.
I have used it once, for high-performance interprocess communication and it worked very well,
much faster than straightforward file sharing would.
|
|
|
|
|
Hi
CreateFileMapping/MapViewOfFile is usually used in IPC(inter process communication)
When you modify any particaluar file and want to be notified of the same in another application which do not drectly access the file , this is the mechmanism you would use.
The second process would get the handle to first process physical memeory that is the reason you need to use critical section.
Here there is only one copy of the file and when there is some change in the data then you could SENDMESSAGE WM_COPYDATA which also be received in the other application and thus there will be notifiaction of the data sent.
I hope it answers your question.
|
|
|
|
|
Hi,
I'm using VC++ 6.0 and new to MFC.
How do I draw on to desktop instead of drawing into the application's window?
How do I set the DC to desktop window's dc.
Thanks in advance.
Regards,
sanju.
|
|
|
|
|
HDC hdc = ::GetDC(NULL);
CDC dc = CDC::FromHandle(hdc);
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
(1.)
In TreeCtrl if i check the checkbox of parent node than its childs are automatically selected.
Can ,This is possible in opposite condition,means if i select the check box of all childs than the check box of its parent is automatically selected.
(2.)
In Tree ctrl i want if the check box of parent is not checked,so the childs of this parent are not expand.
Please tell me with example.
Thanks in advance.
I m awaiting for your valuable suggestion.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
the check box is user defined?
|
|
|
|
|
It is a one property of TreeCtrl.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
in tab control i have three tabs
i want to create dialog on tab click
and want to enddialog which is already created
how can i check which dialog was created which shoud end now
|
|
|
|
|
there will be the main dialog which will accommodate these tabs. create dialogs, being the parent as tab control will create the dialog as a part of these tabs, For ex:
step1:-
dlgTab1= new CDialogTab1;
dlgTab1->Create(CDialogTab1::IDD, &tabCtrl);
tabCtrl.AddTab(dlgTab1, "TAB1");
step2:-
//Maintain dialog pointers as the member
//Add a Set function to set the current dialog pointer for the respective tab
CWnd* m_pWndCurrentConfigOpenDialog;
SetCurrentDialog(CWnd *pWnd){};{pWndCurrentConfigOpenDialog = this}
Step:-3
then Get the pointerwhich will return you the dialog pointer based on the tab selected.
End the current dialog and create a new one follwoed by step1 and step2 again.
NOTE:This is jus an algo to meet the answer of your question.
Regards,
KDevloper
|
|
|
|
|
How do I set an Environment variable under XP (and Vista) which will apply system wide.
I tried to add it as a set... way in autoexec.bat, does not seem to work!
Regards,
Bram van Kampen
|
|
|
|
|
Hi Bram,
A good point to start looking for a solution to your problem would be Jonathan [Darka]'s SetEnv[^] application.
Best regards,
Mihai Moga
|
|
|
|
|
Through the control panel.
Programmatically, SetEnvironmentVariable() for the current process, or
for the system (from the docs):
"Calling SetEnvironmentVariable has no effect on the system
environment variables. The user can add or modify system environment
variables using the Control Panel. To programmatically add or
modify system environment variables, add them to the
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment
registry key, then broadcast a WM_SETTINGCHANGE message with lParam set to the
string "Environment". This allows applications, such as the shell, to pick
up your updates."
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
Hmmm. The yes or no is in the key! What I'm realy looking for is to enter somehow One string (under vista) into the system via a user session which will be visible to all users. Somewhat naive, I thought for one moment that the Old Fasioned Environment might have been a way in. Evidently it is not.
Thanks, for showing me the wrong path anyways.
Regards
Bram van Kampen
|
|
|
|
|
There are some concepts in Excel: workbooks, workbook, worksheets, worksheet.
Can ADO deal with them?
system
modified on Friday, July 25, 2008 10:30 PM
|
|
|
|
|
|
hi
please ,can you show me an alternative for StrToInt64Ex()
StrToInt64Ex() works fine for me but it requires IE 6.0
i need an alternative to it which has no additional dependencies
simply i want to convert :
a hex value in any kind of string form "0x090f8g87" to long or similar 243354354
thank you
|
|
|
|
|
reteset wrote: i need an alternative to it which has no additional dependencies
Can you use the CRT?
If so, see
String to Numeric Value Functions[^]
Although, the CRT is more of a dependency than calling the shell API StrToInt64Ex()
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
_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 ?
|
|
|
|
|