标签: visual-c++

SetSecurityInfo:未声明的标识符

我试图在对象上设置安全权限.这是代码:

    PROCESS_INFORMATION pi = {0};
    STARTUPINFO si = {0};
    si.cb = sizeof(STARTUPINFO);

    CreateProcess("C:\\AP\\DataBase\\dbntsrv.exe", NULL, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, "C:\\ADP\\SQLBase", &si, &pi);      


    result = SetSecurityInfo(pi.hProcess, SE_WINDOW_OBJECT, PROCESS_TERMINATE, NULL, NULL, NULL, NULL);
Run Code Online (Sandbox Code Playgroud)

但它给了我编译时错误'SetSecurityInfo' : undeclared identifier..和'SE_WINDOW_OBJECT' : undeclared identifier..任何想法为什么会发生这种情况?谢谢

c++ winapi mfc visual-c++

0
推荐指数
1
解决办法
1589
查看次数

gcc编译错误,在Visual Studio 2008 C++中正常工作

在gcc中获取编译错误,即使它在Visual Studio C++上正常工作

#include <iostream>
using std::cout;  // tried it, didn't work
using std::cin;   // tried it, didn't work
using std::endl;  // tried it, didn't work

using namespace std;
Run Code Online (Sandbox Code Playgroud)

这是错误,我在尝试编译它时得到了.

hw2_part2.cpp:(.text+0xa2): undefined reference to `std::cout'
hw2_part2.cpp:(.text+0xa7): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
hw2_part2.cpp:(.text+0xb6): undefined reference to `std::cout'
hw2_part2.cpp:(.text+0xbb): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
hw2_part2.cpp:(.text+0xca): undefined reference to `std::cout'
hw2_part2.cpp:(.text+0xcf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& …
Run Code Online (Sandbox Code Playgroud)

c++ gcc visual-c++

0
推荐指数
1
解决办法
716
查看次数

VS2010:如何看待GUI

我需要知道如何打开我正在调试的程序的形式.

我在VS2010中加载了一个现有的解决方案,我可以看到代码,但我想看到项目的GUI部分,点击按钮,看看他们带我去的代码部分,设置断点我感觉如何.

我不知道如何在VS2010中看到GUI,我在哪里可以做到这一点?

另外,哪里有一个很好的资源来学习VS2010的来龙去脉?

forms user-interface visual-studio-2010 visual-c++

0
推荐指数
1
解决办法
1万
查看次数

为什么我无法声明向量全局变量?

在我添加之前,所有内容都在编译 vector<Move> bestLine;

search.h

#ifndef SEARCH_H
#define SEARCH_H

#include <vector>
#include "types.h"
#include "position.h"
#include "move.h"
#include "moves.h"

U8 searchDepth;
U8 searchCount;
vector<Move> bestLine; // The compiler doesn't like this.

void searchPosition(Position &P, U8 depth);
void searchMove(Move &M);

#endif
Run Code Online (Sandbox Code Playgroud)

我收到的错误是:

1>d:\test\search.h(12): error C2143: syntax error : missing ';' before '<'
1>d:\test\search.h(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\test\search.cpp(30): error C2065: 'bestLine' : undeclared identifier
Run Code Online (Sandbox Code Playgroud)

似乎编译器没有识别Move,所以bestLine没有被声明.我认为这可能是一个循环依赖,并尝试声明一个不完整的类型Move,但它没有任何影响.有人可以解释我错过的东西吗?

c++ variables vector global-variables visual-c++

0
推荐指数
1
解决办法
5732
查看次数

获得相同级别的标签?

Boost引发异常.

An unhandled exception "0x000007fefd0aa88d" in the "svg.exe": Exception Microsoft C: boost :: exception_detail :: clone_impl <boost :: exception_detail :: error_info_injector <std::runtime_error>>
Run Code Online (Sandbox Code Playgroud)

用于正则表达式

opentag = [<] [s] [p] [a] [n]
closetag = [<] [/] [s] [p] [a] [n] [>]
    /opentag+"(?>(?>(?!"+opentag+"|"+closetag+").) |(?R))*"+closetag/
Run Code Online (Sandbox Code Playgroud)

如果传入的字符串(std :: string)大小超过140 kb.

我需要将标签放在同一级别.

std :: string = "<span id=1> </ span>
<span id=2> <span> </ span> </ span>
<span id=3> <span> <span> <span> </ span> </ span> </ span> </ span> "
Run Code Online (Sandbox Code Playgroud)

三弦

0) <span id=1> </ …
Run Code Online (Sandbox Code Playgroud)

c++ regex visual-c++ boost-regex

0
推荐指数
1
解决办法
77
查看次数

C++中的WinRT异步文件操作

我目前正在开发一个需要一些文本资源的城域应用程序.构建过程的一部分是将所有这些资源复制到应用程序安装目录中的文件夹中.我想做的是收集这些资源文件的列表,并相应地处理每个文件.不幸的是,我这样做的尝试并不成功.

由于我正在为WinRT构建,我无法使用非常有用的"FindFirstFile"和"FindNextFile"函数.我一直在尝试使用WinRT异步文件IO操作完成工作.

auto getResourceFolder = installedLocation->GetFolderFromPathAsync(  folderPath  );

getResourceFolder->Completed = ref new Windows::Foundation::AsyncOperationCompletedHandler< Windows::Storage::StorageFolder^ >( 
[this]( Windows::Foundation::IAsyncOperation< Windows::Storage::StorageFolder^ >^ operation ) {

    if( operation->Status == Windows::Foundation::AsyncStatus::Completed ) {

        auto resourceFolder = operation->GetResults();
        auto getResourceFiles = resourceFolder->GetFilesAsync();
        getResourceFiles->Completed = ref new Windows::Foundation::AsyncOperationCompletedHandler< IVectorView< Windows::Storage::IStorageFile^ >^ >( 
        [this]( Windows::Foundation::IAsyncOperation< IVectorView< Windows::Storage::IStorageFile^ >^ >^ operation ) {

            if( operation->Status == Windows::Foundation::AsyncStatus::Completed ) {

                auto resourceFiles = operation->GetResults();

                for( unsigned int i = 0; i < resourceFiles->Size; ++i ) {

                    // Process File
                } …
Run Code Online (Sandbox Code Playgroud)

visual-c++ microsoft-metro windows-runtime c++-cx visual-c++-2012

0
推荐指数
1
解决办法
5265
查看次数

C和C++中'char*numberlist []'的长度

尝试了解如何在C和C++中获取char*numberlist []中的项目总数,以下是代码:

const char* list_of_filename[] = {"One","Two","Three","Four","Five"};
Run Code Online (Sandbox Code Playgroud)

c visual-c++

0
推荐指数
1
解决办法
1658
查看次数

无符号长长的算术

我想将两个相乘,unsigned integers但我希望结果存在于一个unsigned long long变量中

unsigned long long M;
unsigned int X;
unsigned int Y;

X = 999999;
Y = 9990;
M = X * Y;
Run Code Online (Sandbox Code Playgroud)

M应该9989990010但由于某种原因它一直存在1400055418

我已经困扰了一个星期了,我想我已经到了想哭的地步!

c++ unsigned visual-c++ long-integer

0
推荐指数
1
解决办法
1950
查看次数

在C++中使用复制构造器进行挣扎

我正在尝试为我的结构编写一个复制构造函数,但我似乎没有做到这一点,并希望得到任何可能的帮助.我想以递归的方式做一个深层复制,但是我一直在初始化初始化列表中得到建议,这似乎也没有好转.

struct Node
{
    Node* left; // will be our previous
    Node* right;// will be our next
    Node* previous;// get a handle to the previous node
    string value;

    Node(string nval): left(NULL), right(NULL), previous(NULL), value(nval)
    {

    }

    Node(Node const& node)
     : previous(new Node(node.previous)), 
       left(new Node(node.left)), 
       right(new Node(node.right)), 
       value(node.value)
    {
    }

    Node& operator=(const Node&)
    {
       // ...
    }
};
Run Code Online (Sandbox Code Playgroud)

提前致谢.

c++ visual-c++

0
推荐指数
1
解决办法
145
查看次数

是否在CLR上运行非托管Visual C++?

如果我在不使用任何托管代码的情况下在Visual C++中编写C++代码,它仍在CLR上运行吗?如果是,我如何使用Visual C++编写本机应用程序.有什么办法吗?

.net clr visual-c++

0
推荐指数
1
解决办法
94
查看次数