开发者

C#.net to Vb.net

开发者 https://www.devze.com 2022-12-16 01:50 出处:网络
I was trying to convert some C# code t开发者_Go百科o Vb.net but there was a variable with an asterisk, which apparently VB.net doesn\'t support. (pointer variables I think they were called, were it re

I was trying to convert some C# code t开发者_Go百科o Vb.net but there was a variable with an asterisk, which apparently VB.net doesn't support. (pointer variables I think they were called, were it refers or something) How would I convert that into VB.net


VB.NET to date does not have any support for pointers or what is generally termaned "unsafe" code in C#. The usual way to do interop with unmanaged code is to make use of the Marshal class and friends in the Base Class Library. This is slightly more cumbersome to use that simple pointers, and not exactly the same, but it's the only real alternative unless you want to write that bit of your code in C#.


If the code really has pointers in it, you can't. C# can do unsafe code; VB .NET can't.

One option would be to isolate the code in its own C# project, while doing the rest of the projects in your solution in VB .NET.

0

精彩评论

暂无评论...
验证码 换一张
取 消