visual-c++

Does using __declspec(novtable) on abstract base classes affect RTTI in any way?

て烟熏妆下的殇ゞ 提交于 2020-01-22 17:45:29
问题 Or, are there any other known negative affects of employing __declspec(novtable)? I can't seem to find references to any issues. 回答1: MSCV uses one vptr per object and one vtbl per class to implement OO mechanism such as RTTI and virtual functions. So RTTI and virtual functions will work fine if and only if the vptr has been set correctly. struct __declspec(novtable) B { virtual void f() = 0; }; struct D1 : B { D1() { } // after the construction of D1, vptr will be set to vtbl of D1. }; D1 d1

visual studio 2008 error C2371: 'int8_t' : redefinition; different basic types (http_parser.h)

久未见 提交于 2020-01-22 16:28:12
问题 i try to compile simple c/c++ app that is using http_parser from node.js i also using libuv , and basically trying to compile this example in windows. using visual studio 2008 but i getting this compilation error : >d:\dev\cpp\servers\libuv\libuv_http_server\http_parser.h(35) : error C2371: 'int8_t' : redefinition; different basic types 1> d:\dev\cpp\servers\libuv\libuv-master\libuv-master\include\uv-private\stdint-msvc2008.h(82) : see declaration of 'int8_t' the code in the http_parser.h

visual studio 2008 error C2371: 'int8_t' : redefinition; different basic types (http_parser.h)

孤人 提交于 2020-01-22 16:25:27
问题 i try to compile simple c/c++ app that is using http_parser from node.js i also using libuv , and basically trying to compile this example in windows. using visual studio 2008 but i getting this compilation error : >d:\dev\cpp\servers\libuv\libuv_http_server\http_parser.h(35) : error C2371: 'int8_t' : redefinition; different basic types 1> d:\dev\cpp\servers\libuv\libuv-master\libuv-master\include\uv-private\stdint-msvc2008.h(82) : see declaration of 'int8_t' the code in the http_parser.h

64-bit windows VMware detection

我是研究僧i 提交于 2020-01-22 09:50:47
问题 I am trying to develop an application which detects if program is running inside a virtual machine. For 32-bit Windows, there are already methods explained in the following link: http://www.codeproject.com/Articles/9823/Detect-if-your-program-is-running-inside-a-Virtual I am trying to adapt the code regarding Virtual PC and VMware detection in an 64-bit Windows operating system. For VMware, the code can detect successfully in an Windows XP 64-bit OS. But the program crashes when I run it in a

WTL multithreading, multiple interfaces & libraries

本小妞迷上赌 提交于 2020-01-22 02:44:09
问题 I have a Main Thread that displays an interface, within another thread created from the main thread before the Main interface is shown, I create tow other windows sequentially: I create the first window: CWarningDlg warnDlg; warnDlg.Create(NULL); warnDlg.ShowWindow(SW_SHOW); warnDlg.BringWindowToTop(); CMessageLoop _Loop ; if(_MyAppModule.AddMessageLoop(&_Loop)) { nRet = _Loop.Run(); _MyAppModule.RemoveMessageLoop(); } warnDlg.DestroyWindow(); if (nRet == SOME_VALUE) { doSomethingElse(); } Do

after writing the code to add a toolbar to a dialog-based mfc the dialog doesn't run

让人想犯罪 __ 提交于 2020-01-22 02:36:09
问题 here's the code that I have used to create a toolbar on my dialog and I am in the early stages of the tutorial just added these codes to my program: InitialJobProject2Dlg.h CToolBar m_FirstToolBar; InitialJobProject2.cpp BOOL CInitialJobProject2Dlg::OnInitDialog() { CDialogEx::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu =

Pausing in OpenGL successively

流过昼夜 提交于 2020-01-21 23:29:29
问题 void keyPress(unsigned char key,int x,int y){ int i; switch(key){ case 'f': i = 3; while(i--){ x_pos += 3; sleep(100); glutPostRedisplay(); } } } Above is the code snippet written in C++ using GLUT library in Windows 7. This function takes a character key and mouse co-ordinates x,y and performs translation along x-direction in 3 successive steps on pressing f character. Between each step the program should sleep for 100 ms. We want to move a robot, and pause successively when he moves forward

How to make a modeless dialog always on top within the app

微笑、不失礼 提交于 2020-01-21 20:21:52
问题 I have a modeless popup dialog in my app. I want to make it topmost only within the app it belongs to, not always topmost on the desktop. I have tried to set the first parameter to wndTopMost, but this way the dialog will remain on top on the desktop, which is very bad user experience. I have also tried wndNoTopMost with SWP_NOZORDER parameter, but this only put the dialog in front when its displayed. If I move another dialog/window to the dialog location, the dialog will be buried under the

Which DLL has PathCchAppend?

白昼怎懂夜的黑 提交于 2020-01-21 19:41:31
问题 I'm trying to conditionally use ( if available) the function PathCchAppend. I have got the function signature from header pathcch.h . However, when I try to get the address of function from SHLWAPI.DLL , it fails: auto pca = GetProcAddress(GetModuleHandle(L"shlwapi.dll"), "PathCchAppend"); Using Depends, I saw that this function does not exist in this DLL (I'm on Windows 10). There doesn't exist any pathcch.dll and hence cannot load it either. In which DLL this function is placed? EDIT:

How to get list of selected files when using GetOpenFileName() with multiselect flag?

♀尐吖头ヾ 提交于 2020-01-21 10:21:05
问题 I have tried googling, but people seem to have the same problem: we can't get a list of the selected files. This is a simple piece of working code that is similar to what I use: OPENFILENAME ofn = { sizeof ofn }; wchar_t file[1024]; file[0] = '\0'; ofn.lpstrFile = file; ofn.nMaxFile = 1024; ofn.Flags = OFN_ALLOWMULTISELECT | OFN_EXPLORER; GetOpenFileName(&ofn); How do I actually get the filenames I selected? Currently I can only get it to work without OFN_ALLOWMULTISELECT flag, so it returns