473,799 Members | 3,121 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem about AppDomain

I want to pass a WinForm control from main appDomain A to another appDomain
B.
In appDomain B, i will create some WinForm controls and add them to the
control's child controls list of main appDomain A .
But i failed, please tell me why. thanks!

code sample:

// BOView will be created in appDomain B.
// BOView receive aParCtrl from main appDomain A, then add some controls to
it.
// BOView is in assembly LoadedCmpnt.dll .
public class BOView : MarshalByRefObj ect
{
private Panel pnlCtn;

public BOView(Control aParCtrl)
{
pnlCtn = new System.Windows. Forms.Panel();

pnlCtn.Dock = System.Windows. Forms.DockStyle .Fill;
pnlCtn.Location = new System.Drawing. Point(0, 0);
pnlCtn.Name = "pnlCtn";
pnlCtn.Size = new System.Drawing. Size(292, 273);

aParCtrl.Text = aParCtrl.Text + "-- Loaded"; // ok
aParCtrl.Contro ls.Add(pnlCtn); // failed ! if remark this line,all is
right. why ?
}
}

code in main appDomain :

{
Panel pnlParent = new System.Windows. Forms.Panel();

B = AppDomain.Creat eDomain("AppDom ain B");
ObjectHandle oh = B.CreateInstanc eFrom(
"LoadedCmpnt.dl l",
"LoadedCmpnt.BO View",
false,
System.Reflecti on.BindingFlags .CreateInstance ,
null,
new object[] {pnlParent},
null, null, null );
}
Nov 16 '05 #1
0 1189

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

Similar topics

0
1414
by: Daylor | last post by:
first of all , PLEASE,say somthing..about my post. any reply will be nice to read. i have vb.app , with 2 appdomains. (now, in the next section , ill write "appdomain create" ,means a code in the appdomain is creating ) appdomain2 call appdomain 1 to create object of type "CCar" (the param is string ) the appdomain1 creating a object from assembly file. ( the object is of
3
4711
by: Mike Krueger | last post by:
Hi I'm currently working on a forms designer for a free .NET IDE (SharpDevelop -> www.icsharpcode.net/OpenSource/SD). problem: I try to put 'custom' components (user controls from the current open project) into the forms designer. The project must be compiled for making this work. Now after recompile I need to update the user control with the newly compiled version (maybe something has changed). And THAT
2
10851
by: Lauren Hines | last post by:
Hello, I have read numerous post stating that the only way to unload an assembly (DLL in my case) is to create a separate AppDomain, load the assembly, then unload it by calling AppDomain.Unload. When trying to delete the DLL file I get an exception that access is denied. When trying to copy over the DLL file, I get an exception that it is being used by another process.
0
1216
by: JonS. | last post by:
Hey All, I'm currently working on a program that dynamically loads assemblies from a directory each into their own seperate AppDomains using a somewhat logical extension of Eric Gunnerson's article found at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp05162002.asp Now the problem I'm having is that, though I've created a remote loader, when I try to load an assembly from a method in the...
1
2401
by: Raveendra M | last post by:
Hi! I am working with ASP.NET application. In my page I am creating one Application Domain and in that domain I am calling my DLL. Using the methods of the dll. And unloading the Application Domain. Till this point it is working fine. My problem is, while web page is open, than I am modifying the dll, and rebuilding. Then it is giving error: "The file 'MyClass.dll' cannot be copied to the run directory. The process cannot access the...
2
1465
by: ICE Srl | last post by:
I use this function to load some assemblies from a directory into ASP.Net application: Private Function CaricaLibShadow(ByVal Libreria As String) As Dim Backup As String Dim Assbly As Backup = AppDomain.CurrentDomain.SetupInformation.ShadowCopyDirectories
4
1268
by: Daylor | last post by:
first of all , PLEASE,say somthing..about my post. any reply will be nice to read. i have vb.app , with 2 appdomains. (now, in the next section , ill write "appdomain create" ,means a code in the appdomain is creating ) appdomain2 call appdomain 1 to create object of type "CCar" (the param is string ) the appdomain1 creating a object from assembly file. ( the object is of
5
1515
by: John | last post by:
I've started to get session loss on many of my web apps, after only a few minutes (the session lifespan is supposed to be 60 minutes). It occurs in several apps (all on same server), and started happening while I was on ..NET1.1, and continues now I've moved to 2.0 (native 2.0 assemblies compiled using VS2005, not the original VS2003 ones). My session states are very light (most stuff is held in the db). There is plenty of available ram...
1
4288
by: Bill Woodruff | last post by:
Visual Studio 2005, .NET FrameWork 2.0, C#, WinForms Application Hi, I've read the recent posts by and to 'Thunderbird' (and learned a lot, thanks, from the usual masters Skeet and Paladino, and others) which involve AppDomains in a remoting scenario, but I think the issue I am working with .... while related ... is sufficiently different to warrant a new thread. I'm also working on a plug-in architecture it's for a WinForms based
0
10470
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9067
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5583
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2935
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.