visual-c++

How to properly loop through / get text / select SysTreeView32 window item

孤人 提交于 2020-01-16 00:35:54
问题 I've spent a couple of hours pouring through Microsoft's Dev Center; however, I can't seem to figure out how to do the following two things: Cycle through and view the names of each program under the 'Expert Advisors' section of the 'Navigator' sub window (for example 'MACD Sample' in screenshot below) select and double click the program (e.g. 'MACD Sample'). Winspector(Left) | Application(Right) My main problem seems to be that I don't know how to properly use HTREEITEM to access the

Can type_info pointers be used to distingush types in C++?

好久不见. 提交于 2020-01-15 23:13:24
问题 I have a set of polymorphic C++ classes and they are all instantiated by the same module (Windows DLL). Now having two pointers to such classes and having called typeid : SomeCommonBase* first = ...; //valid pointer SomeCommonBase* second = ...; //valid pointer const type_info& firstInfo = typeid( first ); const type_info& secondInfo = typeid( second ); can I compare retrieved type_info addresses if( &firstInfo == &secondInfo ) { //objects are of the same class } else { //objects are of

Std::bind on a vector of std::functions compiles in VC10, but not VC11. What did I do wrong?

走远了吗. 提交于 2020-01-15 15:33:14
问题 When moving from VC10 to VC11, the following code fails to compile. #include <algorithm> #include <functional> #include <vector> using namespace std; using namespace std::placeholders; typedef std::function<void(int)> CB; int main() { vector<CB> m_CBs; int m_LongPressGesture; for_each(m_CBs.begin(), m_CBs.end(), bind(&CB::operator(), _1, m_LongPressGesture)); return 0; } The error output is illegal indirection. Here's the complete output. 1>------ Build started: Project: CompileError,

Warnings in boost::priority_queue

丶灬走出姿态 提交于 2020-01-15 12:23:29
问题 When I try to build "priority_queue_example.cpp" it get these warnings(and so errors) pointing to "priority_queue_example.h" on the line where my priority_queue is declared. The warnings are, 1> priority_queue_example.cpp 1>c:\Projects\lib\boost\boost\heap\detail\stable_heap.hpp(102): error C2220: warning treated as error - no 'object' file generated 1>c:\Projects\lib\boost\boost\heap\detail\stable_heap.hpp(102): warning C4100: 'rhs' : unreferenced formal parameter 1> c:\Projects\lib\boost

How to statically link to MSVCP120.dll in VS2013

时光怂恿深爱的人放手 提交于 2020-01-15 12:15:31
问题 When I launch .exe it gives error MSVCP120.dll is missing. How do I add statically link to project. Is it in Linker? Do I need to give path to MSVCP120.dll? 回答1: In general, you should not use static CRT linking as it creates a number of potential problems, security risks, and servicing concerns. You can require the VC++ REDIST package to be run (which requires admin rights) to install the 'system' version, you can use the VC++ MSM modules with your own MSI installer, or you can just use side

cannot open file 'SDL2.lib'

限于喜欢 提交于 2020-01-15 09:58:06
问题 I am trying to open sdl2 in my project on Visual C++ 2012 but i keep getting this error: error LNK1104: cannot open file 'SDL2.lib' I added the additional libraries and include folder but no luck.. I added the link to the libraries through the linker but i get the same error.. what should i do? 回答1: I'm referencing VS 2010, but I've read before that some people have had errors when using the VC++ Directories in their project properties as opposed to the Linker->General->Additional Library

cursive character segmentation in OCR

一世执手 提交于 2020-01-15 09:31:26
问题 I have done a OCR application for handwritten normal characters .For the segmentation of characters I have used histogram profile method . That successfully works for normal English characters. I have used horizontal projection for line segmentation and vertical projection for character segmentation. To segment lines of cursive hand written article I can use horizontal projection as previous. But I can't use same methodology for cursive English character segmentation since they are merged

List<T> Find method in C++/CLI

百般思念 提交于 2020-01-15 08:44:07
问题 Why it doesn't work in C++/CLI ? _list->Remove(_list->Find(x => x.Inode == 2)); I received an error error C2065: 'x' : undeclared identifier 回答1: @Hans Passant's comment is the answer, so I'm just pasting it here: C++/CLI doesn't support lambda expressions. The language was frozen in 2005, no new bells and whistles were added to it since then. You'll need to use a delegate explicitly. C++11 got lambdas but they are not compatible with C++/CLI. – Hans Passant 回答2: As Hans Passant commented, C+

order of events when a window starts in Visual C++ MFC

大兔子大兔子 提交于 2020-01-15 08:01:49
问题 suppose that I have a class derived from CWnd that have the event handler functions OnPaint , OnCreate and OnSize . As you know all of them are occured when the window starts but I want to see what is the order between them. when I set a breakpoint in one of them, after ending the function, the control is not passed to another and goes to one of the MFC's built-in .cpp files for example wincore.cpp ? How can I understand the order? any links or teach me a way to prevent the control from going

Connect Pantheios logging in a DLL to the main application's logging

六眼飞鱼酱① 提交于 2020-01-15 07:30:38
问题 Here's the situation: I'm working on a MFC application and want to integrate some logging capabilities into it. I did some research and settled on Pantheios since it seems to be regarded as the best logging API out there. I had no problems getting simple logging up and running - I even threw in some callback stuff to change the formatting of the output. My application will be making use of several DLLs. These are DLLs that I am actively developing and would like to integrate logging into them