473,661 Members | 2,484 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ::StreamingCont ext ^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 1739
"Marko" <ma***@email.co m> 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 ::StreamingCont ext ^c = ...; StreamingContex t is a value type.
StreamingContex t^ is a reference to the boxed version
of StreamingContex t (in C# it would be object or
System.ValueTyp e). C++/CLI provides type-safe access
to boxed value types.

You should use StreamingContex t 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::Runti me::Serializati on::Formatter ^f = ...;
System::Runti me::Serializati on::StreamingCo ntext ^c = ...;


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

You should use StreamingContex t 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::EventH andler': 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
2005
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 the following line. document.write("<param name='flashVars' value=&{getVar(text)}>) This is a param from an object tag (embedding flash) and i'm trying to dynamically set the flashVars param, but this 1 line is killing me.
12
1619
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 work, while I think it should be possible: A *pA = new B; // One of... A *pA = new C; // ...these two
0
1859
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 with the security settings requirement inorder to do the
2
3924
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 Integer) CWKnob.Value = Value lblValue.Caption = CWKnob.Value End Property
0
1089
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" VALUE="jars/myapp.jar"> line completely vanishes. Click to HTML view again, and the applet just does not load or work (as would be expected!). Re-add the vanishing line and all is well again.
4
7653
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 that I get the url of the video file i want to play in the asp.net code (form_load event). How do I pass this value into the html... Ie :
5
3792
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 mysql connections open so I end up with quite a few at the end. Is there a different way that I should do this? class Program { static string categories = { "emulation" , "audio" , "console" , "anime" , "xxx" , "tv" , "pictures" , "video" };
0
810
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" value="http://www.youtube.com/v/anHkwBYH-bY"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/anHkwBYH-bY" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object> I AM TRYING...
0
8432
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
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
8762
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...
0
7365
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...
1
6185
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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 we have to send another system
2
1747
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.