如何在我的c ++ / cli项目上启用智能感知? [英] How can I enable the intellisense on my c++/cli project?

查看:288
本文介绍了如何在我的c ++ / cli项目上启用智能感知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用visual studio 2008和我有一个本地c + +项目加载托管的c ++ dll,但在最后一个,intellisense不再工作只为托管代码。

I am using visual studio 2008 and I have a native c++ project that loads a managed c++ dll, but on the last one, the intellisense doesn't work anymore only for the managed code.

这个项目(dll)有一个混合代码(native和managed),如果我在一个干净的行上只写::,intellisense给我的方法继承自基类,不是托管代码,例如

This project (dll) has a mixed code (native and managed) and if I write only "::" on a clean line, the intellisense gives me the methods inherits from the base class, like regular, not for the managed code, for example

array <String^>^ ContactListToChat; 

我需要帮助,否则我必须失明。

I need help, otherwise I´ll have to fly blind.

推荐答案

取自一个介绍智慧历史的msdn博客: http://blogs.msdn.com/b/vcblog/archive/2008/02/29/intellisense-part-2 -the-future.aspx

Taken from an msdn blog explaining the history of intellisense: http://blogs.msdn.com/b/vcblog/archive/2008/02/29/intellisense-part-2-the-future.aspx


我们已经从快速,不太精确到有时快速,大多准确在Visual Studio 2008 ...我们大多准确,除了我们只捕获一个头文件的解析,即使它可以根据包含它的.cpp(即不同的#defines,编译选项等)进行不同的解析。

We have moved from fast and not very accurate to sometimes fast and mostly accurate in Visual Studio 2008... We are mostly accurate except that we only capture one parse of a header file even though it could be parsed differently depending on the .cpp that includes it (i.e. different #defines, compile options, etc).

这是他解释为什么有时intellisense工作辉煌,为什么其他时候它是完全盲目的。

This is his explanation as to why sometimes intellisense works brilliantly and why other times it is completely blind.

您应该看看问题中提出的一些建议:如何获得智能感知在Visual Studio 2008中可靠工作

You should look at some of the suggestions posed in the question: How to get intellisense to reliably work in Visual Studio 2008

听起来最有可能帮助的是Jogn Richardson的回应。

The one that sounds the most likely to help is Jogn Richardson's response.


1)头文件路径未正确设置。当您发现intellisense不工作的类型,使用IDE单击通过每个头文件,找到一个包含类型。 (右键单击#include并选择打开文档...)。如果这在你到达声明类型的文件之前失败,这是你的问题。确保头文件搜索路径设置正确。

1) Header file paths are not set-up correctly. When you find a type where intellisense is not working, use the IDE to click through each header file to find the one containing the type. (Right click on #include and select Open Document...). If this fails before you get to the file which declares the type then this is your problem. Make sure header file search paths are set-up correctly.

2)智能感知数据库已损坏。这发生在所有的时间。您需要关闭解决方案,删除.ncb文件,然后重新打开解决方案。我发布了我使用的宏,在这里回答另一个问题。

2) The intellisense database is corrupt. This happens ALL The time. You need to close the solution, delete the .ncb file, and then reopen the solution. I posted the macro I use for this in answer to another question here.

这篇关于如何在我的c ++ / cli项目上启用智能感知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆