Click here to Skip to main content
15,902,938 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Determine executing OS, not application architecture Pin
Sir Dot Net22-Dec-09 10:48
Sir Dot Net22-Dec-09 10:48 
AnswerRe: Determine executing OS, not application architecture Pin
Luc Pattyn22-Dec-09 8:55
sitebuilderLuc Pattyn22-Dec-09 8:55 
GeneralRe: Determine executing OS, not application architecture Pin
Tony Teveris22-Dec-09 9:20
Tony Teveris22-Dec-09 9:20 
QuestionDate formatting issue Pin
Jack Vanderhorst22-Dec-09 8:03
Jack Vanderhorst22-Dec-09 8:03 
AnswerRe: Date formatting issue [modified] Pin
Luc Pattyn22-Dec-09 8:13
sitebuilderLuc Pattyn22-Dec-09 8:13 
GeneralRe: Date formatting issue Pin
Jack Vanderhorst22-Dec-09 9:09
Jack Vanderhorst22-Dec-09 9:09 
GeneralRe: Date formatting issue Pin
Luc Pattyn22-Dec-09 9:18
sitebuilderLuc Pattyn22-Dec-09 9:18 
QuestionAppDomains and native window message handlers Pin
rogerkhoueiry22-Dec-09 4:02
rogerkhoueiry22-Dec-09 4:02 
I have a problem which is also related to AppDomain's and Windows messages.

A web page to be hosted in Internet Explorer that would contain a .Net WinForms UserControl derived control - HelloWorldCtl. This control is inside a C# written assembly - HelloWorldControl.dll. The control uses code from another assembly that is written in C++/CLR - HelloWorldLibCPP.dll.

HelloWorldCtl loads HelloWorldLibCPP.dll and calls code that would create a Win32 native window and places that window in HelloWorldCtl's area.

Navigate to the web page, HelloWorldCtl loads, I can see it as well as the native window in the center of HelloWorldCtl's area.

Both the C# control and the native window have some message handlers and the messages are all working fine and reaching both the C# control's window and the native window; mouse clicks, re-paints and so on... However, some of the message handlers of the native window need to call methods on the C# control which is the parent of the native window. This is done using an interface that the C# control implements and which the native window holds a reference to by storing it in a GCHandle (from System::Runtime::InteropServices.) I used the gcroot<> template for the GCHandle.

The failure is happening at this point when code in the native window is trying to use the GCHandle to call any method on the C# control. (The c++ code is compiled as managed code with /clr.)

The exception that is thrown is :

"Cannot pass a GCHandle across AppDomains"

I put some debugging code to display the Id and FriendName of the CurrentDomain in both the C# and the native window and I found out that these AppDomains are not the same.

During the creation of the native window, the CurrentDomain is the same as that of the C# control, but when the native window receives messages and those messages are handled, the CurrentDomain is different from the C# control's.

Can this situation be changed? Is it possible to have both the native window messages hanlder run in the same AppDomain as that of the C# control?

Any other suggestions perhaps?

Thanks,
Roger
QuestionTAG control [modified] Pin
ghbloos20-Dec-09 23:09
ghbloos20-Dec-09 23:09 
AnswerRe: TAG control Pin
hattonjohn17-Feb-10 12:01
hattonjohn17-Feb-10 12:01 
GeneralRe: TAG control Pin
ghbloos21-Feb-10 22:11
ghbloos21-Feb-10 22:11 
Questionin javascript, how to get a struct return by C# Pin
coderormnger20-Dec-09 18:58
coderormnger20-Dec-09 18:58 
AnswerRe: in javascript, how to get a struct return by C# Pin
coderormnger23-Dec-09 19:50
coderormnger23-Dec-09 19:50 
QuestionShallow and deep copies Pin
Jeroen De Dauw20-Dec-09 6:28
Jeroen De Dauw20-Dec-09 6:28 
AnswerRe: Shallow and deep copies Pin
Luc Pattyn20-Dec-09 6:53
sitebuilderLuc Pattyn20-Dec-09 6:53 
GeneralRe: Shallow and deep copies Pin
Jeroen De Dauw20-Dec-09 6:59
Jeroen De Dauw20-Dec-09 6:59 
QuestionVB.Net - The dependency service does not exist or has been marked for deletion. (Exception from HRESULT: 0x80070433) Pin
Tony Teveris19-Dec-09 9:03
Tony Teveris19-Dec-09 9:03 
QuestionMemory Mapped File Pin
Wannes Geysen18-Dec-09 1:10
Wannes Geysen18-Dec-09 1:10 
AnswerRe: Memory Mapped File Pin
Dave Kreskowiak18-Dec-09 7:51
mveDave Kreskowiak18-Dec-09 7:51 
QuestionHow to Find the documentation oF MSPastry Library under MSDN ? Pin
ksaw12318-Dec-09 0:36
ksaw12318-Dec-09 0:36 
AnswerCPIGNORE: Duplicate post Pin
Dave Kreskowiak18-Dec-09 7:41
mveDave Kreskowiak18-Dec-09 7:41 
QuestionHow can I deploy an application using VISIFIRE Pin
cutudi16-Dec-09 4:13
cutudi16-Dec-09 4:13 
AnswerDuplicate post. Pin
Pete O'Hanlon16-Dec-09 4:55
mvePete O'Hanlon16-Dec-09 4:55 
AnswerRe: How can I deploy an application using VISIFIRE Pin
Dave Kreskowiak16-Dec-09 5:28
mveDave Kreskowiak16-Dec-09 5:28 
AnswerRe: How can I deploy an application using VISIFIRE Pin
The Man from U.N.C.L.E.22-Dec-09 7:16
The Man from U.N.C.L.E.22-Dec-09 7:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.