I'm working from VBA into .NET. I have a working version of an interface using CLI and stdcall
I'm trying to remove the resulting dependency on the C++ 2015 runtime, and it looks like I can do it using UnmanagedExports.
But I have a couple of questions.
- Can I just use "ref string" as a parameter and have it work?
- If so, can I replace it with "out string"?
In either cases, do I have to do any string/string length management?
I currently pass a couple of callbacks in as "int". From an example I saw elsewhere, it looks like on the C# side, using this, I should be able to replace those parameters with Func for a callback such as Function A(p1 as String, p2 as Long, p3 as String) as Long
Any advice would be much appreciated.
You need a combination of StrPtr, possibly StrConv on the Access side, and IntPtr on the .NET side:
If you use StrConv, the string type is up to you. If you don't, the pointer will be pointing to a Unicode array.
C# side: