473,399 Members | 4,254 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,399 software developers and data experts.

What is a GCHandle? (Need simple explanation ;o)

I'm trying to get a page up using some sample code that interfaces with a
3rd party application using .net.

The sample code the company provides, when I run it, produces this error:

================================================== ================
An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll
Additional information: Cannot pass a GCHandle across app domains.
================================================== ================

I've never had an error like this. Instead of appearing on the web page,
this causes vs.net to pop-up and shows the error in a modal box within
vs.net

The specific error doesn't show up on google, but what I can piece together
is that the GCHandle is a memory stack? Where would one begin to figure out
what is causing this? Is this something I could have done, or would this be
an issue inherit within the 3rd party DLLs? I'm also not clear what an 'app
domain' is...is that a 'chunk' of reserved memory?

-Darrel
Nov 18 '05 #1
4 2641
Is the third party application an executable or a COM dll. From your error
it seems that it is an executable. Also how are you trying to access it?
"darrel" <no*****@hotmail.com> wrote in message
news:u0**************@tk2msftngp13.phx.gbl...
I'm trying to get a page up using some sample code that interfaces with a
3rd party application using .net.

The sample code the company provides, when I run it, produces this error:

================================================== ================
An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll
Additional information: Cannot pass a GCHandle across app domains.
================================================== ================

I've never had an error like this. Instead of appearing on the web page,
this causes vs.net to pop-up and shows the error in a modal box within
vs.net

The specific error doesn't show up on google, but what I can piece
together
is that the GCHandle is a memory stack? Where would one begin to figure
out
what is causing this? Is this something I could have done, or would this
be
an issue inherit within the 3rd party DLLs? I'm also not clear what an
'app
domain' is...is that a 'chunk' of reserved memory?

-Darrel

Nov 18 '05 #2
Seems that your 3rd party component is written in C++.NET, other .NET
language need not take care of GCHandle stuffs ourselves.

More information can be found on here:
http://msdn.microsoft.com/visualc/de.../movNETWFX.asp

I suggest you to inform your 3rd party component's author about this and see
if they'll provide instructions on how to fix this.

"darrel" <no*****@hotmail.com> ¦b¶l¥ó
news:u0**************@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
I'm trying to get a page up using some sample code that interfaces with a
3rd party application using .net.

The sample code the company provides, when I run it, produces this error:

================================================== ================
An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll
Additional information: Cannot pass a GCHandle across app domains.
================================================== ================

I've never had an error like this. Instead of appearing on the web page,
this causes vs.net to pop-up and shows the error in a modal box within
vs.net

The specific error doesn't show up on google, but what I can piece together is that the GCHandle is a memory stack? Where would one begin to figure out what is causing this? Is this something I could have done, or would this be an issue inherit within the 3rd party DLLs? I'm also not clear what an 'app domain' is...is that a 'chunk' of reserved memory?

-Darrel

Nov 18 '05 #3
> Is the third party application an executable or a COM dll. From your error
it seems that it is an executable. Also how are you trying to access it?


It's DTSearch, and I'm a bit frustrated.

They claimed it was .net, but I'm finding it is only 'sort of' .net

At this point, they have a dll wrapper that then supposedly works with the
object.

To access it, I add a reference in my project to the API wrapper, and then
on my system, I need to add a reference to the actual application dll.

So, that, with a lack of documentation, and a lack of expert .net skills is
causing me some frustration. ;o)

-Darrel
Nov 18 '05 #4
> Seems that your 3rd party component is written in C++.NET, other .NET
language need not take care of GCHandle stuffs ourselves.
Ah. I'm using VB.net, so maybe that's an issue.
I suggest you to inform your 3rd party component's author about this and see if they'll provide instructions on how to fix this.


Will do. With crossed fingers. ;o)

-Darrel
Nov 18 '05 #5

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

Similar topics

28
by: David MacQuigg | last post by:
I'm concerned that with all the focus on obj$func binding, &closures, and other not-so-pretty details of Prothon, that we are missing what is really good - the simplification of classes. There are...
14
by: bo | last post by:
And why and where one should use one vs. the other? Verbally, it seems like semantics to me--but obviously there is some actual difference that makes references different and or preferable over...
0
by: Motoxcat | last post by:
Greetings I am writing some MC++ code to interoperate between a legacy C-languiage dll and C#. I need to specify a callback function to the managed portion for the dll to provide more detailed...
2
by: steve | last post by:
Hi all, I want to understand more about how the pinvoke pinning process works. I'm writing some code that calls DeviceIoControl. DeviceIoControl provides a generic interface to device drivers....
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Languageâ€, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
1
by: =?Utf-8?B?SkE=?= | last post by:
I use a method for threading that instantiates an object that is a wrapper to a DLL (written in C). The wrapper class is passed a byte array, and then does GCHandle handle =...
7
by: DaTurk | last post by:
Hi, I'm coding up an application that has a native c++ layer, asynchronously calling callback in a CLI layer. We originally did this with static inline methods in the CLI layer, but this...
9
by: =?Utf-8?B?RWR3YXJkUw==?= | last post by:
I would greatly appreciate some help on passing managed object into unmanaged code. I need to pass a reference (address of) of a managed class into unmanaged code (written by a thrid party). The...
1
by: vikjohn | last post by:
I have a new perl script sent to me which is a revision of the one I am currently running. The permissions are the same on each, the paths are correct but I am getting the infamous : The specified...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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,...
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.