473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

using delegate between different assembly

i'd like to use delegate but it is not in same assembly.
how should i do to solve this...
source code is like below...

using B;
namespace A
{
class A
{
funcA()
{
B b = new b();
b.B();
}

funcCallB()
{
// this method will call class B
}
}
}

namesapce B
{
class B
{
funcB()
{
// i'd like to call funcCallB of call A forexample like below..
// but it's not possible...and delegate can't use because of
namespace is different
// how can i solve this problem???
A a = new A();
a. funcCallB();
}
}
}

Apr 22 '07 #1
1 2390
"somequestion" <so**********@gmail.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
// i'd like to call funcCallB of call A forexample like below..
// but it's not possible...and delegate can't use because of
namespace is different
// how can i solve this problem???
A a = new A();
a. funcCallB();
1) Make the class and function "public":
public class A...
public void funcCallB() ...

2) To access the different namespace, prefix the class name with the
adequate namespace, which in your example code hapens to have the same name
as the class although this is not recommended because it can lead to
confusion:

A.A a = new A.A();
a.funcCallB();

3) In order for this to work, you need a reference from the calling
assembly into the called assembly. This is not reflected in the source code;
you have to configure it in Visual Studio, or provide it as a -r parameter
if you are compiling from the command line.

4) Notice that none of this is related to delegates. Delegates are a
different thing.
Apr 22 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: kapilp | last post by:
hi, i have a program that used reflection to execute methods. now i want to execute the reflected method on a new thread but cant figure out how or if it can be done. take the below code, for...
1
by: Daniel | last post by:
How do I call a delegate in late bound C# dll? there some way to do this w/ a sharedinterface file? any examples? i tried this but it doesnt work: (oType.GetMethod("IOCTLJOB").Invoke(pObj, new...
4
by: KC Eric | last post by:
Hi all, I have a dll file, it has a class, say: class Temp, this class has a function which has a delegate as a parameter, say: public void Test(GameOverHandler _overHandler)
3
by: Oscar Thornell | last post by:
Hi, I am thinking about doing all my logging asynchronously using a delegate. The main resaon for this would be performance and responsiveness of the application (an ASP.NET app). //Exampel...
4
by: Max | last post by:
Hi, I would like to have a button and a combo box with options to select various versions of Microsoft Outlook: 2002, 2003. The user selects the email client and clicks the button. The only...
6
by: Simon Verona | last post by:
I would normally use code such as : Dim Customer as new Customer Dim t as new threading.thread(AddressOf Customer.DisplayCustomer) Customer.CustomerId=MyCustomerId t.start Which would create...
7
by: Andreas Reiff | last post by:
Hey! I have a managed c++ app (actually, the app is mixed managed/unmanaged, but this happens in the managed part) that dynamically generates some program in c# (with CSharpCodeProvider). The...
14
by: Mohamed Mansour | last post by:
Hey there, this will be somewhat a long post, but any response is appreciated! I have done many PInvoke in the past from C++ to C#, but I did PInvoke within C# not C++/CLI. Can someone explain...
5
by: raylopez99 | last post by:
I have a form, Form6, that has a bunch of buttons overlaid on it. I want to be able to click on any arbitrary area of the form, and if that area of the form is overlaid by a button, I want to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.