Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2003

Tip: Looking for answers? Try searching our database.

Variant Type or 2dim Array

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marc Reiter - 15 Sep 2003 15:06 GMT
Hi,
I want to pass a 2dim Array of Double to a COM Class done with vb.net. If I
declare Sub setData(InData()() as Double) it does not work (I think the type
mappimg can't be done). So I want to get a Variant by Sub setData(InData as
Object). If now a vb6 made application calls this with a VARIANT as
parameter I get an Error? How can this be done? Is there a way to explicit
declare a variant in .net?

Best Regards

Marc Reiter
Ying-Shen Yu[MSFT] - 16 Sep 2003 15:48 GMT
Hi Marc,
    I'm not sure but I think you should try marshaling the two-dimensional
array to SAFEARRAY. Try defining your COM method like this
Public Sub generateMatrix(<[In](),Out()>ByVal matrix(,) As Double)
Implements IMatrix.generateMatrix
and use normally in your VB6. for more information you may refer to
http://msdn.microsoft.com/library/en-us/cpguide/html/cpcondefaultmarshalingf
orarrays.asp?frame=true
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" shouldbe removed before
sending, Thanks!

--------------------
| From: "Marc Reiter" <marc@reitec.de>
| Subject: Variant Type or 2dim Array
[quoted text clipped - 8 lines]
| NNTP-Posting-Host: pd903f9b4.dip.t-dialin.net 217.3.249.180
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA0
5.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.interop:18729
| X-Tomcat-NG: microsoft.public.dotnet.framework.interop
[quoted text clipped - 10 lines]
|
| Marc Reiter

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.