I checked the DLL and the string were received OK and yet I was getting the
system.runtime.execution error, so I changed the call to multiple calls
passing one string and it worked without any other modification. It must be a
bug in the net framework. The strings are not nodified in the DLL.
"Tom Shelton" wrote:
> On Mon, 13 Sep 2004 16:09:03 -0700, Rodrigue wrote:
>
> > I am writing this from home, so I do not have the code in front of me but it
> > goes something like this
> > In Vb: declare sub procedure(mystring1 as string, mystring2 as string)
> > in the dll which is written in C:
> > void procedure(BSTR mystring1, BSTR
> > mystring2)
> > call convert to string......
>
> Are these string parameters altered at all by the procedure? Off the top
> of my head, I would say:
>
> Declare Ansi Function procedure lib "mylib.dll" (ByVal mystring1 as string,
> Byval mystring2 as string)
>
> That's if the the strings are to be constant values... If the strings are
> to be altered by the calling procedure, then I would pass them as
> System.Text.StringBuilder instead.
>
> --
> Tom Shelton [MVP]
>
|