如何“添加参考”在VC.NET中? [英] How to "Add Reference" in VC.NET?

查看:68
本文介绍了如何“添加参考”在VC.NET中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




如何在VC ++ .NET中添加引用?

在VB.NET和VC#.NET中, 项目中有一个选项。菜单名为添加

参考。这将为当前项目添加.NET DLL引用。在

之后我添加了一个引用,我可以开始在DLL中使用类如下:


[VB]

进口< TheNamespace>


Dim someobj As New< ClassName>


[VC#]

使用< ; TheNamespace>


< ClassName> obj = new< ClassName>


请注意,这个命名空间只能在添加

参考后导入或使用。


如何在VC ++ .NET中进行类似的操作?我想使用一个不能在表单上删除
的DLL。它只能通过代码使用。


请帮助。


-

Sam

解决方案

您可以在解决方案资源管理器参考地图中添加引用,然后使用命名空间<>来添加


名称空间>


要实例化对象,请使用< ClassName> * obj = new< ClassName> ;.


" msnews.microsoft。 COM" <一个****** @ gnostice.com>在消息中写道

新闻:OJ ************** @ TK2MSFTNGP12.phx.gbl ...


如何在VC ++ .NET中添加引用?

在VB.NET和VC#.NET中,Project中有一个选项。菜单名为添加
参考。这将为当前项目添加.NET DLL引用。
添加引用后,我可以按如下方式开始使用DLL中的类:

[VB]
Imports< TheNamespace>

Dim someobj As New< ClassName>

[VC#]
使用< TheNamespace>

< ClassName> obj = new< ClassName>

请注意,只有在
添加引用后才能导入或使用此命名空间。

我如何类似于在VC ++ .NET中运行?我想使用一个不能在表单上删除的DLL。它只能通过代码使用。

请帮助。

-
Sam



>您在解决方案资源管理器引用映射中添加引用,然后使用命名空间< TheNamespace>


用于实例化对象使用< ClassName> * obj = new< ClassName>。


或者你可以使用以下指令:

#using< filename.dll>


问候,Robert

" msnews.microsoft.com" <一个****** @ gnostice.com>在消息中写道
新闻:OJ ************** @ TK2MSFTNGP12.phx.gbl ...


如何在VC ++ .NET中添加引用?

在VB.NET和VC#.NET中,Project中有一个选项。菜单名为添加
参考。这将为当前项目添加.NET DLL引用。


之后我添加了一个引用,我可以开始在DLL中使用类,如下所示:

[VB]
Imports< TheNamespace>

Dim someobj As New< ClassName>

[VC#]
使用< TheNamespace>

< ClassName> obj = new< ClassName>

请注意,这个命名空间只能在


添加

参考后导入或使用。 />
如何在VC ++ .NET中进行类似的操作?我想使用DLL
,它不能在表单上删除。它只能通过代码使用。

请帮助。

-
Sam







感谢Michiel和Robert。我会试试这两个。


-

Sam。


SunFire < SF **** @ interia.pl>在消息中写道

新闻:## ************** @ TK2MSFTNGP09.phx.gbl ...

您在解决方案资源管理器引用映射中添加引用,然后使用命名空间< TheNamespace>
put


>
要实例化对象,请使用< ClassName> * obj = new< ClassName>。



或者您可以使用以下说明:
#using< filename.dll>

问候,罗伯特

" msnews.microsoft.com" <一个****** @ gnostice.com>在消息中写道
新闻:OJ ************** @ TK2MSFTNGP12.phx.gbl ...


如何在VC ++ .NET中添加引用?

在VB.NET和VC#.NET中,Project中有一个选项。菜单名为添加
参考。这将为当前项目添加.NET DLL引用。


之后我添加了一个引用,我可以开始在DLL中使用类,如下所示:

[VB]
Imports< TheNamespace>

Dim someobj As New< ClassName>

[VC#]
使用< TheNamespace>

< ClassName> obj = new< ClassName>

请注意,这个命名空间只能在


添加

参考后导入或使用。 />
如何在VC ++ .NET中进行类似的操作?我想使用不能在表单上删除的DLL


。它只能通过代码使用。

请帮助。

-
Sam






Hi,

How do I add a reference in VC++.NET?

In VB.NET and VC#.NET, there''s an option in "Project" menu called "Add
Reference". This will add a .NET DLL reference to the current project. After
I add a reference, I can start using the class in the DLL as follows:

[VB]
Imports <TheNamespace>

Dim someobj As New <ClassName>

[VC#]
using <TheNamespace>

<ClassName> obj = new <ClassName>

Please note that this a namespace can be imported or used only after adding
the reference.

How do I similar kind of operation in VC++.NET? I want to use a DLL which
cannot be dropped on the form. It can only be used through code.

Please Help.

--
Sam

解决方案

You add the reference in the solution explorer References map and then put

using namespace <TheNamespace>

To instantiate an object use <ClassName>* obj = new <ClassName>.

"msnews.microsoft.com" <an******@gnostice.com> wrote in message
news:OJ**************@TK2MSFTNGP12.phx.gbl...

Hi,

How do I add a reference in VC++.NET?

In VB.NET and VC#.NET, there''s an option in "Project" menu called "Add
Reference". This will add a .NET DLL reference to the current project. After I add a reference, I can start using the class in the DLL as follows:

[VB]
Imports <TheNamespace>

Dim someobj As New <ClassName>

[VC#]
using <TheNamespace>

<ClassName> obj = new <ClassName>

Please note that this a namespace can be imported or used only after adding the reference.

How do I similar kind of operation in VC++.NET? I want to use a DLL which
cannot be dropped on the form. It can only be used through code.

Please Help.

--
Sam



> You add the reference in the solution explorer References map and then put


using namespace <TheNamespace>

To instantiate an object use <ClassName>* obj = new <ClassName>.

or you can use following instruction:
#using <filename.dll>

Regards, Robert
"msnews.microsoft.com" <an******@gnostice.com> wrote in message
news:OJ**************@TK2MSFTNGP12.phx.gbl...

Hi,

How do I add a reference in VC++.NET?

In VB.NET and VC#.NET, there''s an option in "Project" menu called "Add
Reference". This will add a .NET DLL reference to the current project.


After

I add a reference, I can start using the class in the DLL as follows:

[VB]
Imports <TheNamespace>

Dim someobj As New <ClassName>

[VC#]
using <TheNamespace>

<ClassName> obj = new <ClassName>

Please note that this a namespace can be imported or used only after


adding

the reference.

How do I similar kind of operation in VC++.NET? I want to use a DLL which cannot be dropped on the form. It can only be used through code.

Please Help.

--
Sam




Hi,

Thanks to both Michiel and Robert. I''ll try both.

--
Sam.

"SunFire" <sf****@interia.pl> wrote in message
news:##**************@TK2MSFTNGP09.phx.gbl...

You add the reference in the solution explorer References map and then put


using namespace <TheNamespace>

To instantiate an object use <ClassName>* obj = new <ClassName>.



or you can use following instruction:
#using <filename.dll>

Regards, Robert

"msnews.microsoft.com" <an******@gnostice.com> wrote in message
news:OJ**************@TK2MSFTNGP12.phx.gbl...

Hi,

How do I add a reference in VC++.NET?

In VB.NET and VC#.NET, there''s an option in "Project" menu called "Add
Reference". This will add a .NET DLL reference to the current project.


After

I add a reference, I can start using the class in the DLL as follows:

[VB]
Imports <TheNamespace>

Dim someobj As New <ClassName>

[VC#]
using <TheNamespace>

<ClassName> obj = new <ClassName>

Please note that this a namespace can be imported or used only after


adding

the reference.

How do I similar kind of operation in VC++.NET? I want to use a DLL


which cannot be dropped on the form. It can only be used through code.

Please Help.

--
Sam






这篇关于如何“添加参考”在VC.NET中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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