Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 7th, 2006, 05:14 AM
Authorized User
Join Date: Apr 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default convert from 'ref double[]' to 'ref object'

I developed a c++ ATL com dll. I'm trying to use it in C#.

In C# I have a method with a parametr of "ref object" type (in C++ is a VARIANT* I convert it to SAFEARRAY of doubles).
For use this method I create a double[] variable but it throws me this error:

Argument '3': cannot convert from 'ref double[]' to 'ref object'

If I create
object x =null;

And after call to method I execute: double[] myarray = (double []) x;
It run ok, but I would like avoid those steps.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ref numbers RubyRue ASP.NET 2.0 Basics 2 January 16th, 2008 11:29 AM
Membership - Ref: Chapter 8 JayLou BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 0 April 11th, 2007 10:24 AM
Using ref in xml ooper01 XML 1 February 24th, 2007 06:10 AM
By Val By Ref B.V.Madhav Crystal Reports 1 May 12th, 2005 11:37 PM
Array to ref parameter dedex C# 4 February 12th, 2005 02:58 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.