Articles of visual studio 2010

#include <thread>,错误无法打开源文件“thread”

我期待着在Windows上实现multithreading的C + +,我发现链接http://www.cplusplus.com/reference/thread/thread/作为线程的解释,在给出的例子中,他们提到了从线程头命名,其实我正在编写代码在Microsoft Visual Studio 2010中,它说错误无法打开源文件“线程”,请帮助我,这是否可以帮助,或请build议我任何其他网站的帮助,其实我是初学者先进的C ++,在此先感谢。

在networking驱动器上安装目录时,Windows Installer无法访问networking位置

我有一个C ++ Windows应用程序内置Visual Studio 2010与安装项目创build一个.msi安装正常,当用户有一个本地My Documents文件夹,但失败时,他们的My Documents文件夹位于networking驱动器上。 安装程序在本地安装时,会在其“ My Documents文件夹中创build“ Project和“ Data My Documents夹,但是当我尝试使用networking位置中的“ My Documents安装到系统时,.msi将失败, cannot access network location错误消息。 查看安装程序日志文件,看起来是在安装程序创build描述Project和Data目录的属性时发生失败,而不是在尝试创build和填充这些目录时发生。 有没有人有一个想法,我可以避免,解决方法,或从这个错误恢复? 现在,安装只是失败,并在networking上使用“我的文档”进行系统回滚。 谢谢。 来自MSI日志: "The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog, Error 1606. […]

_WIN32_WINNT定义在标头中更改,这是否会导致二进制不兼容?

在VS2010中,我正在更新应用程序到新版本的第三方库,要求_WIN32_WINNT至less为0x501,但提供二进制共享库的另一个第三方共享库将其定义为包含在应用程序。 如果这被修改,是否会有二进制不兼容或者这是一个微不足道的变化? 我必须从库中请求新的二进制文件,它定义为0x500? 我不知道如何判断这是否需要新的分档 – 我想如果任何类/结构体的大小或命名发生了变化,或者任何方法/function签名发生变化,那么就需要新的编译。

你如何编译Windows的静态Taglib库?

我不想编译dynamic库,所以这个问题是没有用的。 我下载了taglib并使用下面的代码进行编译: cmake -DENABLE_STATIC=ON -DENABLE_STATIC_RUNTIME=ON -DWITH_MP4=ON -G "Visual Studio 10" 这将生成Visual Studio解决scheme,我可以编译taglib / Release中生成tag.lib的“tag”项目。 当我尝试在testing应用程序中使用库时,问题就来了 – 没有什么,只是一个简单的testing: #include "stdafx.h" #include "fileref.h" int _tmain(int argc, _TCHAR* argv[]) { TagLib::FileRef d(""); return 0; } 我得到以下链接器错误: Error 1 error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall TagLib::FileRef::~FileRef(void)" (__imp_??1FileRef@TagLib@@UAE@XZ) C:\…\taglib_test\taglib_test\taglib_test.obj taglib_test Error 2 error LNK2001: unresolved external symbol […]

Visual Studio 2010运行时检查失败#3

看起来,微软在VS2010中又一次陷入了瘫痪。 这是我的代码 #include "string.h" typedef struct s_test { unsigned char a[20]; } t_test, *p_test; void initialize(t_test t) { memset(ta, 0, 20); } void main() { t_test t; initialize(t); } 并抛出 Run-Time Check Failure #3 – The variable 't' is being used without being initialized. 那么…因为在其他情况下,运行时检查程序确实有帮助,所以我不太可能在解决scheme中closures它。 但是我该怎么办呢? 你可能会build议改变parameter passing给指针的方式。 然而,对于一致的编码风格,这将是一个不愉快的经历。 现在,我觉得这个BRILLIANT的东西原始的MS,MS

C语言错误C2059和C2061

可能重复: 当语法正确时,为什么VS2010会出现语法错误? 我正在尝试使用Visual Studio 2010开发一种使用C语言的Windows 32服务。 我创build了一个新项目,并插入了.c文件: main.c中 service.c misc.c 我也有两个头文件: myerrors.h my.h 这是我的代码(请注意,这只是一个草稿)。 main.c: #include <Windows.h> #include <stdlib.h> #include <stdio.h> #include "stdafx.h" #include "my.h" #include "myerrors.h" static int parse_args(int ac, char **av) { int i = 0; while (++i < ac) if (strcmp(av[i], "-i") && !InstallMyService()) return false; else if (strcmp(av[i], "-d") && !UninstallMyService()) […]

总是保存特定的文件types在Windows中的一个位置?

我试图做以下我不确定是否有可能使用VB.NET。 我想为所有文件types指定默认保存点,例如: 在我的程序中,为图片selectpath“C:\ Users \ Markus \ Pictures”,每次从网站上下载图片文件,或者在保存文件对话框打开的时候使用Skype或其他程序(外部的一个不通过我的程序或连接到vb.net只是Windows默认的一个),那么它会显示“C:\用户\马库斯\图片”总是.jpg .giftypes的文件等… 非常感谢。

FindFirstFile问题无法获得任何示例工作。

我一直有FindFirstFile和FindNextFile的问题我需要让他们列出所有的DLL到一个数组,但我不能让它列出任何文件。 我曾尝试使用和编辑来自MSDN的示例代码,但它不工作或者他们将错误types的variables传递给一个函数。 我现在的代码是低于对不起,如果这是一个烂摊子,但我想尽一切办法。 我也使用argv[1]因为我相信这给出了我所需要的.exe的目录,因为那些dll将被存储。 为什么我尝试的所有例子都不起作用,为什么我不能修改它们来工作,我完全困惑。 WIN32_FIND_DATA FindFileData; HANDLE hFind = INVALID_HANDLE_VALUE; string directorySearch = "E:\\My Documents\\Visual Studio 2010\\Projects\\SEP-Asignment-One\\Debug\\*"; // Find the first file in the directory. hFind = FindFirstFile(LPCWSTR("E:\\My Documents\\Visual Studio 2010\\Projects\\SEP-Asignment-One\\Debug\\*"), &FindFileData); if (hFind == INVALID_HANDLE_VALUE) { printf ("Invalid file handle. Error is %u.\n", GetLastError()); } else { printf ("First file name is %s.\n", […]

wglCreateContext抛出INVALID_OPERATIONexception

假设我有从codeguru这里下载的COpenGLControl类,假设在创buildOpenGL窗口时运行的第一个事件处理程序是OnCreate ,我试图赶上这个类的错误。 以下是用于在对话框的.h和.cpp文件中创build窗口的代码: MyOpenGLTestDlg.h COpenGLControl m_oglWindow; MyOpenGLTestDlg.cpp CRect rect; // Get size and position of the picture control GetDlgItem(ID_OPENGL)->GetWindowRect(rect); // Convert screen coordinates to client coordinates ScreenToClient(rect); 直到知道我认为函数OnCreate已被调用。 其实我觉得COpenGLControl m_oglWindow;的代码行是COpenGLControl m_oglWindow; 导致这个函数被调用! 但是我不确定,如果你指导我对此有所了解,那么将不胜感激。 无论如何,我还没有对class级做很多改变: OpenGLControl.h #pragma once #include "afxwin.h" #include "WinBase.h" #include <gl/gl.h> #include <gl/glu.h> class COpenGLControl : public CWnd { public: /******************/ /* Public […]

Windbg将指针视为有符号整数

struct Node { struct NodeY NY; int data; }; 当我这样做,对于一个实例指针“N”的结构 2: kd> ?poi(poi(N)) Evaluate expression: -70368698399456 = ffffc000`02ba8520 基本上我想用这样的东西 bp igdkmd64!KmRender+0x199 ".if (@@(N) > 0x1){}.else {gc}" 所以,绝大多数情况是这样,但是由于windbg将它视为有符号整数,所以上面的条件断点始终是false,因为@@(N)总是被计算为负数。 如何获得2个内存地址的数量比较?