Re: Passing VB.NET classes as arguments to VC7 DLLs.
"Patrick Ireland" <email@example.com> wrote in message
> I have encountered a problem with passing data elements in a class to
> a DLL. The data is marshalled and sequential so the data appears correct
> to the DLL however when I update field in the DLL the change is not
> mapped back to the VB7 app.
> What did I miss?
You are passing the structure by-value(a copy is placed on the stack), not
by reference, thus the copy worked with on the VC7 side is not the one on
the VB.NET side, so your changes will not, and should not, be reflected
If you change the C++ function to tkae a pointer to this structure (or a
reference), and then change the declaration in your vb code to be byref, you
should get the behavior you are expecting.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center