Wrox Programmer Forums
|
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
 
Old June 14th, 2005, 04:35 AM
Authorized User
 
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

 
Old June 14th, 2005, 11:28 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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
 
Old June 15th, 2005, 02:39 AM
Authorized User
 
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks but cud you pls give me an example for that in C#.

regards,
muskaan.

 
Old June 15th, 2005, 04:47 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Right click on your C# project, click "Add Reference...", click the COM tab, then find your COM dll name.

-Peter
 
Old June 16th, 2005, 01:57 AM
Authorized User
 
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks but can you pls give me an example for that.

regards,
muskaan.

 
Old June 16th, 2005, 02:35 AM
Registered User
 
Join Date: Jun 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old June 16th, 2005, 05:15 AM
Authorized User
 
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks aaryasheel.
i'll try to do it.

Regards,
Muskaan.






Similar Threads
Thread Thread Starter Forum Replies Last Post
call dll in VS2005 khanhnguyen99 Pro Visual Basic 2005 1 May 29th, 2006 05:06 AM
call functions of dll Digon Classic ASP Basics 1 December 13th, 2005 06:12 AM
How to call a COM DLL from VC++, subhash_w Visual C++ 0 July 15th, 2005 11:33 PM
How to call a COM dll from C/C++... subhash_w BOOK: Professional C++ 1 July 15th, 2005 11:27 AM
How to call a COM DLL from C/C++ subhash_w C++ Programming 0 July 15th, 2005 05:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.