473,480 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Meaning of __gc in function prototypes?

I made a wrapper in C++.NET for a dll I wrote in normal C++.

Among it's functions this wrapper contains an Init() function which has the
following prototype:

[DllImport("my.dll", CharSet = Ansi, CallingConvention = Cdecl, EntryPoint =
"#10")]
static MY_STATUS CPPInit(MY_HANDLE __gc *pHandle);

The datatype MY_HANDLE is just a typedef'd "void *". Without the __gc
keyword the code refuses to compile. I just don't understand what purpose it
serves in this case.
In short the pHandle is an "out" variable that is set inside the dll and the
function returns a status code.
The class which has the variable as member is also a __gc class.
In the end I have my own code to free this handle again so actually there is
no need for any garbage-collection references.

So why does the compiler behave like it does?

-- John
Nov 17 '05 #1
0 763

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

Similar topics

1
1467
by: TGF | last post by:
Hello, I am calling a Filestream::Read() (i.e. fs->Read(arg1, arg2, arg3)). The problem is I have a pointer to an unsigned char block of memory and would like to fill it with the call to 'Read'....
2
2545
by: microsoft | last post by:
Hi All, I am fairly new to Managed C++ extensions. I started trying to implement a interface defined in a C# project, in C++. The problem was with passing value arrays from c# to c++. I found...
7
2353
by: junky_fellow | last post by:
Can a function have two different prototypes ? If not , then how can main() have two different prototypes ? int main(void) and int main argc(int argc, char *argv) I mean to say, if I declare...
73
3367
by: Steph Barklay | last post by:
Hi, I'm currently taking a data structures course in C, and my teacher said that function prototypes are not allowed in any of our code. He also said that no professional programmers use function...
2
2281
by: parag_paul | last post by:
I was looking into the following page http://gcc.gnu.org/onlinedocs/gcc/Long-Long.html Here there is a term open-coded , why to ? And I saw the following definition for long long 5.8...
20
1966
by: somenath | last post by:
Hi All, I have one question regarding the code. #include<stdio.h> char *f1(void); char *f1(void) { char *abc ="Hello";
29
8048
by: Ravishankar S | last post by:
Dear C Experts, While prepating a content for a C course,I made section on function prototypes. Could you kindly provide me your comments on its correctness. Thank you ! Q12: What is the...
4
1893
by: StdNewer | last post by:
#ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif void func OF( args );
31
2404
by: Tommy | last post by:
struct stat *stats IF_LINT (= 0); I don't know why "IF_LINT (= 0)" is needed ? Source is df.c of df program on Linux coreutils-5.2.1\coreutils-5.2.1\src Thanks!
0
7037
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
7034
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,...
1
6732
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
6886
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
5324
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,...
1
4768
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...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.