进入课程和课程使用它的功能 [英] Accessing class & use it's functionality

查看:75
本文介绍了进入课程和课程使用它的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想访问一个类,该类与另一个项目位于不同的目录或项目中,而无需复制类文件.我不知道这是不可能的.请帮帮我.

在此先感谢您.

解决方案

您需要访问源代码或dll中的源代码的编译版本.您的代码显然无法创建它不知道的类.


我想您想在当前项目中添加一个cpp文件. 注意:此过程适用于VS2005.但我认为vs6也是如此.

1.在解决方案资源管理器中右键单击您当前的项目树项.
2.选择添加->现有项.
3.添加cpp文件和相应的.h文件.然后它们将被添加到您的项目中.和来源),并将其包含在其他包含目录"下.这将允许您使用#include <header_name.h>访问标题.


Hi all,
I want to access a class which is located in different directory or project from another project without copying the class files. I don''t know this is possible or not. Please help me.

Thanks in advance.

解决方案

You need to access the source code, or a compiled version of it in a dll. Your code plainly can''t create a class it does not know about.


I think you want to add a cpp file in your current project.If its is,
Note:This procedure is for VS2005.But i think same for vs6 also.

1. Right click on your current project tree item in solution explorer.
2. select ADD->Existing Item.
3.add cpp file and corresponding .h file.Then they will be added to your project.


In addition to what was already suggested, you can also make your own library location (with headers and source) and include it under "Additional Include Directories". This will allow you to access the headers using #include <header_name.h>.


这篇关于进入课程和课程使用它的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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