473,657 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Argumen tException' 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 2656
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*****@hotmai l.com> wrote in message
news:u0******** ******@tk2msftn gp13.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.Argumen tException' 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*****@hotmai l.com> ¦b¶l¥ó
news:u0******** ******@tk2msftn gp13.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.Argumen tException' 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
3287
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 a number of aspects to this simplification, but for me the unification of methods and functions is the biggest benefit. All methods look like functions (which students already understand). Prototypes (classes) look like modules. This will...
14
2531
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 pointers in some cases... TIA
0
1255
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 error reporting. The dll is an embedded database. Since this is error information that may occur at any time, the managed callback needs to be pined for a prolonged period of time. Are there any guidelines on how long a GCHandle or delegate can be...
2
7900
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. Its signature is deliberately open-ended so that it can be highly generic. Refer SDK for more. I want to access the drive geommetry of an SD-Card via
669
25859
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 paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
1
4613
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 = GCHandle.Alloc(buffer, GCHandleType.Pinned); IntPtr ptr = (IntPtr)(handle.AddrOfPinnedObject().ToInt32() + buffer.Length-1); It passes ptr to the DLL function FunctionX().
7
6433
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 solution only works with singleton objects. So I have to explore other solutions. So beside pinning pointers, I've been looking at GCHandle. I was
9
3547
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 3rd party unmanaged DLL will pass this reference into standard Win32 unmanaged static callback function in my code. Inside this unmanaged callback function I need to cast this unmnaged pointer that I have received from 3rd party back into the...
1
2928
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 CGI application misbehaved by not returning a complete set of HTTP headers. The scripts are very long but here are the opening statements: The One that works .... #!C:\Perl\bin\perl.exe # openresolver.cgi # # OpenResolver - a CGI script for...
0
8842
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
8740
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
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
7352
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...
0
5642
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
4173
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...
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
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.