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

variantchangetype problems COM interoperability C++/CLI

hi,

I'm writing a wrapper from unmanaged C++ to C++/CLI

I've replaced the variant_type by
a structure:
Type_Value
{
SupportedTypes Type,
String^ Value
}
Supported_Types //enm type
{
types written in hand
}

well, this is working very good and this is suitable for me
but now I need the results of variantchangetype cuz I'm developping an OPC server and this is the general method to use

I have many ideas but I want to hear from you experts if there's any solution or other ways to wrap variant types

thx in advance.
Apr 21 '08 #1
3 2550
weaknessforcats
9,208 Expert Mod 8TB
Let's call this by it;s real name: a typecast.

You typecast in C++ if a) you are calling a relic C function, or b) your C++ design is screwed up.

Your C++ object should be able to change it's type by a) implementing the State design pattern, or b) using conversion operators.

Not knowing your situation, I don't know which is better.
Apr 21 '08 #2
thx can u give me an idea about this State Pattern or give me a useful link.
Apr 24 '08 #3
Banfa
9,065 Expert Mod 8TB
State Design Pattern
Apr 24 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: j-integra_support | last post by:
Looking for Java/COM interoperability tools? Thousands of companies world-wide are using J-Integra for COM for interoperability between Java and Microsoft COM applications. J-Integra for COM is a...
4
by: Frederik Kesting | last post by:
Hi! I heard about the possibilty of using different languages for one project whith the .Net Framework. Is it f.e. possible to include Managed C++ code into a VB.Net project without changing...
3
by: sb | last post by:
I think streams are nice, but what do you do when you have to write to or, even worse, read from a FILE*, for example a UNIX stream? C++ streams can not be created from FILE*'s or have them...
1
by: louis | last post by:
Today I got the latest propaganda email from MSFT talking about XML and interoperability. It's been bothering me all day and while the notion of interoperability is good -- the ability to interact...
1
by: Ralph | last post by:
Does anybody know where could i find documentation of .NET interoperability with Office. I know it's through COM objects, but, where could i find documentation of those objects, their methods,...
4
by: RTJ | last post by:
I have experienced problems with Oracle OCI library. I was unable to properly link OCI library using gcc. Probably gcc compiler provided with SFU is unable to link native Windows library. Oracle...
1
by: PEACEMAKER | last post by:
if I use VariantChangeType to change a variant to a VT_BSTR am I responsible for freeing the BSTR string? even if the original was a BSTR?
0
by: j-integra_support | last post by:
Looking for Java/.NET/CORBA interoperability tools? Intrinsyc Software has just released the latest addition to its popular J-Integra Interoperability Suite... J-Integra Espresso! J-Integra...
0
by: Pradnya Patil | last post by:
Hi , I need to export some of the reports to MS EXCEL & MS WORD in a WEB APPLICATION.I also need to LOCK some of the Columns in EXCEL-sheet.Right now I need to run the Interoperability...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.