Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 30th, 2004, 09:19 PM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to pass address of an array to a dll(in c++)

HI..
i'm a newbie in using vb.net...
need help on how to pass address of an array to a dll(coded in c++). i am just testing out my intended coding in a simpler code as shown below.

code is somthing like this

Public Shared Sub testpoint(ByRef N() As Byte)
' Leave function empty - DLLImport attribute forwards calls to
' testpoint to testpoint in test1.DLL.
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Dim c(20) As Byte
testpoint(c)
MsgBox(c(9))
End Sub

*function to call in the test1.dll*
void testpoint(char & output)
{
char * t = &output;
t[9] = 'a';
t[10]='b';
}

i have created an array which can holds 21 items... but when i call the dll.. the array i got back is just contain 1 item..c(0).

is this the correct way to do it? or there is a better way?
Pls help...

thks in advance...
iceman11
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
array address problem chris1012 Java Basics 3 December 18th, 2007 11:46 AM
DLL Base Address cf2006 BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 July 14th, 2006 10:59 AM
How to Pass c++ object across ATL DLL ann123 Visual C++ 0 January 30th, 2006 06:55 AM
Take the address of a stack based array Obnox BOOK: Professional C#, 2nd and 3rd Editions 1 April 21st, 2005 08:12 AM
How to pass option button array? John Pennington Classic ASP Professional 2 March 8th, 2004 04:41 PM



All times are GMT -4. The time now is 11:53 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.