473,394 Members | 1,567 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,394 software developers and data experts.

type casting object to STRUCT or LP to STRUCT

I am having a C++ component (managed) and I want to use this frommy C# client. One of the methods in the C++ component takes in aLP to a struct (LPMAPIPROP). I want to expose this as a Objectto the C# client. How can I type cast to LPMAPIPROP or any otherSTRUCT from Object.

C2440: 'type cast' : cannot convert from 'System::Object __gc *'to 'LPMAPIPROP'

--------------------------------
From: IUnknown

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>wAN+jxKdwUqKU+yk3B+lNg==</Id>
Jul 21 '05 #1
0 1327

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

Similar topics

4
by: Jacob Jensen | last post by:
This question has probably been asked a million time, but here it comes again. I want to learn the difference between the three type cast operators: static_cast, reinterpret_cast, dynamic_cast. A...
25
by: hugo2 | last post by:
Obrhy/hugo July 12, 2004 Take a look at this memcpy() definition. Is there a good reason the void pointer args are cast to byte just to assign their addresses to byte pointers? /*from Steve...
4
by: Fabrizio | last post by:
Hi I cannot figure why it isn't possible to cast a struct array to an object array. I written a structure like this: public struct Test { private int TestA; private int TestB;
10
by: Bob | last post by:
This has been bugging me for a while now. GetType isn't availble for variables decalred as interface types, I have to DirectCast(somevariable, Object). In example: Sub SomeSub(ByVal...
0
by: IUnknown via .NET 247 | last post by:
I am having a C++ component (managed) and I want to use this frommy C# client. One of the methods in the C++ component takes in aLP to a struct (LPMAPIPROP). I want to expose this as a Objectto the...
3
by: Greg Roberts | last post by:
Hi I am writing a program using the SortedList class . Please contain laughter if i am doing something stupid., I am using a struct as the value part to store a range of information against a...
6
by: crook | last post by:
I have code below and it works properly but when I'm compiling it with "--pedantic" flag, GCC(3.4.2) shows such warning: "ISO C forbids casting nonscalar to the same type". How can I change this...
25
by: SRR | last post by:
Consider the following code: #include <stdio.h> #include <string.h> struct test{ char a; } funTest( void ); int main( void ) {
2
by: pallav | last post by:
I'm using an old sparse matrix C library in my C++ code and I'd like to know how to downcast a boost::shared_ptr to char *. The sparse matrix data structure is like this: struct...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.