473,405 Members | 2,210 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,405 software developers and data experts.

problem to cast object im getting from diffrent appdomain

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
CCar type<< that inherits MarshalByRef )

the appdomain1 dont know the type of this object he just created , and keep
the instance in >>Object type<<.

appdomain1 sending back >>object type<< to appdomain2. (now, as i know,
because its between appdomains , a proxy is send)

now here is the PROBLEM:

appdomain2 , get the object of >>Object Type<< ,
and want to cast it to the real object type that is >> CCar Type <<.

when appdomain 2 try to cast the >>Object Type<< to >>CCar Type << , an
exception is throw of :

A first chance exception of type 'System.InvalidCastException'
occurred in MyAssembly.dll
Additional information: Specified cast is not valid.
now here is the code sample in appdomain 2:

------------------------------
dim obj as object
dim myCar as CCar

obj = m_someObjectInAppdomain1.CreateThisClass ( "CCar")

myCar = CType(obj , CCar) // throw 'System.InvalidCastException'

------------------------------

can someone explain what im missing here ?
and how can i cast an object i recive from other appdomain ?

hope this clear.if not ,pls ask and explain any details.
im try to solve this problem for 2 day.

bye.
Jul 21 '05 #1
0 1374

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

Similar topics

0
by: Daylor | last post by:
i checked again, and found my sample dont describe my real problem. the real problem is : how to create in a server and of object of type that server dont know, send it to the client. (till here...
5
by: Lucas | last post by:
Well, here's the situation.. It's pretty simple; just that I can't get it to work. I have 2 Executables.. The first one is called CSharp.exe which is a simple WinForm App. I have a single...
0
by: CowPad | last post by:
Hello All, I have a problem with serializing structs so I made a small application here to demonstrate. Hopefully someone can explain this strange problem. I have a Windows (Forms)...
1
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...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
4
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...
0
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...
39
by: Martin Jørgensen | last post by:
Hi, I'm relatively new with C-programming and even though I've read about pointers and arrays many times, it's a topic that is a little confusing to me - at least at this moment: ---- 1)...
1
by: ScriptProblem | last post by:
Hi Guys, I have a security concern with Mozilla and Netscape browsers(In IE it gives secuirity pop window) in Remote server(Client's server).When I am trying to call an Asp.NET web service from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...

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.