 |
| ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 14th, 2005, 04:35 AM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
DLL call
Dear All,
i want to call one dll into another project of C#.Net.
can anyone tell me pls how to do that?
Thanks & Regards,
Muskaan.
|
|

June 14th, 2005, 11:28 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
If you are using VS.NET you only need to set up a reference to the COM dll in your C# project. This will generate a Runtime Callable Wrapper (RCW) around the COM dll so your .NET code can consume classes from it.
- Peter
|
|

June 15th, 2005, 02:39 AM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks but cud you pls give me an example for that in C#.
regards,
muskaan.
|
|

June 15th, 2005, 04:47 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Right click on your C# project, click "Add Reference...", click the COM tab, then find your COM dll name.
- Peter
|
|

June 16th, 2005, 01:57 AM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks but can you pls give me an example for that.
regards,
muskaan.
|
|

June 16th, 2005, 02:35 AM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi muskaanbajaj,
How are u ??
Any way u wanted a code that show how to use a dll in another c# project
ok
Step 1 :- Create a dll project and with one class
|->Step a :- vs.net 2003 ide
| new project > visula c# project > Class Library > here | give the project name as project1
|->Step b :- in the code window the Class 1 will be open write this | function
| public string SampleFunction(string strInputString)
| {
| strInputString = "Modified from dll "+ | strInputString ;
| return strInputString;
| }
|->Step c :- Compile the project and copy the dll producded from | the project (the location is <project folder>/bin/. dll) desktop (for easy searching)
Step 2 : - Create Project 2
This time create a project like windows form .
| Step a: - go to the soution explorer and left click on the | reference this will show two options add | reference and add web refernce . | Choose add reference.
| step b:- Afeter clicking the above button then a screen | comes up search for the browse button and click on | it .
| step c: now go to the location where u had saved the dll | created in step one. then click ok this will add | the dll as reference
| step d :- in using block write #using project1
| step e :- now use the class1 as if it is another class in the project
Hope this will help you out
bye
aryasheel
|
|

June 16th, 2005, 05:15 AM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks aaryasheel.
i'll try to do it.
Regards,
Muskaan.
|
|
 |