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 11-06-2004, 05:11 AM   #1 (permalink)
john_tran
Registered User
 
Join Date: Oct 2004
Posts: 22
john_tran is on a distinguished road
Question Have a problem while create DLL!!!Need Help

I create a DLL in VC++, call VD.DLL, and include file VD.CPP, its contain:

int _stdcall VD(int *index)
{
int i;
for(i=0;i<5;i++)
index[i] = i;
return (i);
}

In VB6.0, i declare to use this DLL:
Private Declare Function VD "my-dll-path" (ByRef intIndex as integer) as Integer

And use this function in VB's body like this:

Dim intIndex(0 to 50) as Integer //Global Integer Array

Sub VD()
Dim i as integer, intI as Integer
intI = VD(intIndex)
for i=0 to intI-1
MsgBox "Value " & i & " = " & intIndex(i)
Next
End Sub

And It shows :
Value 0 = 0
Value 1 = 0
Value 2 = 1
Value 3 = 0
Value 4 = 2

Those Bold line is not correct. Because in my case, i must show:

Value 0 = 0
Value 1 = 1
Value 2 = 1
Value 3 = 3
Value 4 = 4

Why this happen? Anything wrong in my code?
Thanks
john_tran 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
JavaScript Problem dawkim HTML, XML, Javascript, AJAX 2 01-26-2004 07:02 PM
strange posting problem on my website......... trevor PHP 2 12-19-2003 12:25 PM
Web Design Problem elusionsdesign HTML, XML, Javascript, AJAX 2 11-09-2003 07:01 PM
Help debugging a power problem Belisarius Lounge 0 10-25-2003 04:44 PM
This is a windows/C problem UnderWing Standard C, C++ 6 03-28-2003 06:17 AM


All times are GMT -8. The time now is 08:34 PM.


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