C# DLL cannot affect value of a number passed by reference from a VB6 application

dll.Increment( num )

Because you are using parentheses, the value is forcibly passed by value, not by reference (the compiler creates a temporary copy and passes that by reference).

Remove the parentheses:

dll.Increment num

EDIT: A more complete explanation by MarkJ.

Leave a Comment