-
October 22nd, 2002, 06:10 AM
#1
Help me : change value parameter in DLL
I write MFC-DLL, it have a export fuction :
----------
void Test(int n)
{
n=100;
}
----------
I user this DLL in VB:
----------
n=200
'Call Test fuction :
Test(n)
MsgBox n
'But n is not changed (n = 200)
'Why n is not = 100?
----------
I repaired fuction Test as :
void Test(int &n)
{
n=100;
}
When call Test(n) in VB, occur an error : access memory....
Why that?
How can I do to changed value of n?
Thank you!
-
October 22nd, 2002, 08:19 AM
#2
In VB function declaration add ByRef keyword to n parameter.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|