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

How to know is param is handle to object or object

Hi,

There are few properties that don't follow the
traditional 'by handle' values.

For example:
System::Runtime::Serialization::Formatter ^f = ...;
System::Runtime::Serialization::StreamingContext ^c = ...;
f->Context = *c; (???)

Is there any way to figure if the param to the property
(or method) is 'handle' or class instance?

Does is mater if the ReturnType class is IsValueType?
Thanks.

Jan 19 '06 #1
2 1730
"Marko" <ma***@email.com> wrote
There are few properties that don't follow the
traditional 'by handle' values.
Typically, you do use handles for reference types and
do not for value types. It's not directly related to
properties.
For example:
System::Runtime::Serialization::Formatter ^f = ...;
System::Runtime::Serialization::StreamingContext ^c = ...; StreamingContext is a value type.
StreamingContext^ is a reference to the boxed version
of StreamingContext (in C# it would be object or
System.ValueType). C++/CLI provides type-safe access
to boxed value types.

You should use StreamingContext without the handle.
f->Context = *c; (???)

Is there any way to figure if the param to the property
(or method) is 'handle' or class instance?

MSDN Library uses C# terminology in the index
(structure is a value type, class is a reference type).
The about page in MSDN lists the declaration
(in C++/CLI: value class or ref class for value type or
reference type, respectively)

-hg
Jan 19 '06 #2
Holger Grund wrote:
For example:
System::Runtime::Serialization::Formatter ^f = ...;
System::Runtime::Serialization::StreamingConte xt ^c = ...;


StreamingContext is a value type.
StreamingContext^ is a reference to the boxed version
of StreamingContext (in C# it would be object or
System.ValueType). C++/CLI provides type-safe access
to boxed value types.

You should use StreamingContext without the handle.


Yes, I figured that out that by myself.
Value types must be passed without a 'handle to object (^)'.

Also, the function pointers are always resolved as
System::IntPtr ^, but they can not be used as such directly.

For example, the PropetyInfo for the second param to EvantHandler method
constructor will return System::IntPtr,
but if you try to pass the IntPtr as a param to the constructor the
compiler will fail with:

error C3924: error in argument #2 of delegate constructor call
'System::EventHandler': pointer to member function expected.

No MSDN does not desribe C3924 at all, and how can on figure out
what the 'pointer to member function' should be?

Jan 19 '06 #3

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

Similar topics

5
by: Keeko | last post by:
Actionscriptor needs help! I have a working javascript function (getVar()) that extracts a variable from a link and returns it. (tested with alert() works fine). But I am unsure of how to right...
12
by: ectoplasm | last post by:
Abstract base class A. Derived from A are class B and C, both concrete. I hold a pointer to an object of class A, an instance which is either B or C. I have trouble with making the following...
0
by: Daimy | last post by:
I meet the same problem below, please help me! Thanks! //written by some one I have developed a windows forms user control, which I am going to host in Internet Explorer.. I am familiar...
2
by: VB Programmer | last post by:
I created a VB6 user control with a ActiveX Knob on it. Here's the simple code: Public Property Get Value() As Integer Value = CWKnob.Value End Property Public Property Let Value(Value As...
0
by: Michael | last post by:
After trying to load my java applet from <OBJECT> tag (rather than <APPLET> tag), it renders fine, except when you click between the DESIGN view then back to HTML view, the <PARAM NAME="ARCHIVE"...
4
by: Aussie Rules | last post by:
Hi, I have the Windows media object placed on a web page. Since its not a .net component (its a com object) I have placed the code in the html source of the page. The problem I am having is...
5
by: admin | last post by:
ok This is my main. Pretty much it goes through each category and starts up 4 worker threads that then ask for groups to gether from. My problem is that when the thread gets done it keeps the...
0
by: YousufHossain | last post by:
I HAVE AN OBJECT IN MY ASP.NET PAGE. IT IS NOT IN THE FORM TAGS. I WANT TO CHANGE THE VALUE OF THE MOVIE PARAM IN VB.NET <object ID="m" width="425" height="350"><param name="movie"...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
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.