Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-20-2005, 11:04 AM   #1 (permalink)
ace
Registered User
 
Join Date: Jun 2005
Posts: 1
ace is on a distinguished road
C#: How do I pass in a object array to a C Dll using Marshal?

Hi all...

I have a local class

private class ComplexNum: object
{
System.Double re, im;

public niComplexNum()
{
this.re = 0;
this.im = 0;
}
}

I call into a C dll which has a output array of CompleNum[]. After doing some research, I think I am doing something incorrect with the marshalling of the data

for eg... say my function signature is void foo(ComplexNum[] data)
I was trying to use the MarshalAs directive for the ComplexNum parameter -
[MarshalAs(UnmanagedType.LPArray)] ComplexNum[] data

but that doesn't seem to be working. I get a NullReferenceException ..

any ideas why?
ace is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
import delphi dll in c# eandras MS Technologies ( ASP, VB, C#, .NET ) 0 05-20-2004 05:36 AM
edit? anon Lounge 10 11-21-2002 03:02 PM
creating an array of an object on the freestore in c++ ?? sde Standard C, C++ 7 08-04-2002 01:39 PM


All times are GMT -8. The time now is 04:48 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting