visual-c++

Why is the “alignment” the same on 32-bit and 64-bit systems?

不羁的心 提交于 2021-02-07 04:54:29
问题 I was wondering whether the compiler would use different padding on 32-bit and 64-bit systems, so I wrote the code below in a simple VS2019 C++ console project: struct Z { char s; __int64 i; }; int main() { std::cout << sizeof(Z) <<"\n"; } What I expected on each "Platform" setting: x86: 12 X64: 16 Actual result: x86: 16 X64: 16 Since the memory word size on x86 is 4 bytes, this means it has to store the bytes of i in two different words. So I thought the compiler would do padding this way:

Outdated UI automation tree

…衆ロ難τιáo~ 提交于 2021-02-07 02:48:32
问题 I am trying programming an automated tester application using the new native Microsoft UI Automation interface 3.0 (in VC++ 2010, Win7). The Application Under Test (AUT) is a WPF application. Almost everything works fine... I can install event handlers, navigate through the tree, search elements using various conditions and control the found elements using their patterns. But yesterday I found a behaviour that leaves me despaired: The UIA tree of my AUT simply is not updated after switching

Color Converter DSP ProcessOutput always returns MF_E_TRANSFORM_NEED_MORE_INPUT

点点圈 提交于 2021-02-06 09:27:31
问题 I need to convert video frames from RGB32 to IYUV but the Color Converter MFT refuses to process samples. For every frame I call IMFTransform::ProcessInput() and IMFTransform::ProcessOutput() but I receive MF_E_TRANSFORM_NEED_MORE_INPUT . If I try to feed MFT with another sample i get the MF_E_NOTACCEPTING error. Below I paste a code to show my problem. Hopefully you guys will be able to help. First I create Media types: //DSP input MediaType CHECK_HR(hr = MFCreateMediaType(&m_pInputMediaType

How to add Qt libraries to visual studio

只愿长相守 提交于 2021-02-05 20:37:32
问题 I have a source with VC++ 2017 I receive the error " Error C1083 Cannot open include file: 'QtCore/QMap': No such file or directory " when i try compile the project. I download Qt libraries and add to Include project but the problem exist. Which directory of Qt of i had to add to project to resolve error? this is header of my code that generate error #include <QtCore/QMap> #include <QtCore/QString> #include <QtCore/QList> 回答1: You need to update your project. Go to the project properties by

Build Succeeded, but no .lib file gets created

倾然丶 夕夏残阳落幕 提交于 2021-02-05 14:21:23
问题 I inherited a substantial amount of code, including a visual studio project that is supposed to (as best as I can tell) build a .lib file. Visual studio says "... Generating Code... Creating Library... Creating browse information file...", and at the end, it says the build succeeded. In the release/debug folder, it has a bunch of .obj files, but it doesn't have a .lib file. What could I be missing? Thanks! 回答1: Open the Project Properties (right-click the project in Solution Explorer, select

Build Succeeded, but no .lib file gets created

前提是你 提交于 2021-02-05 14:21:17
问题 I inherited a substantial amount of code, including a visual studio project that is supposed to (as best as I can tell) build a .lib file. Visual studio says "... Generating Code... Creating Library... Creating browse information file...", and at the end, it says the build succeeded. In the release/debug folder, it has a bunch of .obj files, but it doesn't have a .lib file. What could I be missing? Thanks! 回答1: Open the Project Properties (right-click the project in Solution Explorer, select

Build Succeeded, but no .lib file gets created

南笙酒味 提交于 2021-02-05 14:21:13
问题 I inherited a substantial amount of code, including a visual studio project that is supposed to (as best as I can tell) build a .lib file. Visual studio says "... Generating Code... Creating Library... Creating browse information file...", and at the end, it says the build succeeded. In the release/debug folder, it has a bunch of .obj files, but it doesn't have a .lib file. What could I be missing? Thanks! 回答1: Open the Project Properties (right-click the project in Solution Explorer, select

Build Succeeded, but no .lib file gets created

本秂侑毒 提交于 2021-02-05 14:21:05
问题 I inherited a substantial amount of code, including a visual studio project that is supposed to (as best as I can tell) build a .lib file. Visual studio says "... Generating Code... Creating Library... Creating browse information file...", and at the end, it says the build succeeded. In the release/debug folder, it has a bunch of .obj files, but it doesn't have a .lib file. What could I be missing? Thanks! 回答1: Open the Project Properties (right-click the project in Solution Explorer, select

Function return not returning a value to main

て烟熏妆下的殇ゞ 提交于 2021-02-05 11:31:28
问题 So, this is my first assignment fiddling with functions in C++ - which I thought I understood being as they're rather similar to methods with C#. But, although my main calls my function fine, and the function runs and returns to the main - It doesn't send back the variable information that it called when it returns. I'm not exactly sure what I've done wrong - it appears to be set up appropriately (IE - Like the sample code in my book for a return) Here's the main code... #include <iostream>

Function return not returning a value to main

若如初见. 提交于 2021-02-05 11:30:22
问题 So, this is my first assignment fiddling with functions in C++ - which I thought I understood being as they're rather similar to methods with C#. But, although my main calls my function fine, and the function runs and returns to the main - It doesn't send back the variable information that it called when it returns. I'm not exactly sure what I've done wrong - it appears to be set up appropriately (IE - Like the sample code in my book for a return) Here's the main code... #include <iostream>