-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API Proposal]: aot export api stdcall,UnmanagedCallersOnly for vb6 #96103
Comments
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsBackground and motivationHOW TO EXPORT API IN VB.NET? LIKE:DotNetRuntimeDebugHeader c# can export stdcall api by UnmanagedCallersOnly,but vb.net can't do this,how can you fix? aot will auto set add_export_stdcall to export as :add `public static class MyFunctions
}` API Proposalnamespace System.Collections.Generic;
public class MyFancyCollection<T> : IEnumerable<T>
{
public void Fancy(T item);
} API Usage// Fancy the value
var c = new MyFancyCollection<int>();
c.Fancy(42);
// Getting the values out
foreach (var v in c)
Console.WriteLine(v); Alternative DesignsNo response RisksNo response
|
I assume this is because Bad workaround: manually inject attribute in IL using reflection etc. |
It is by design that Visual Basic cannot do everything that C# can do. .NET language strategy explains our approach in more detail.
Yes, this is the right solution. |
Cc @dotnet/interop-contrib - UnamangedCallersOnlyAttribute cannot be used with VB due to the non-CLS compliant constructor |
Background and motivation
HOW TO EXPORT API IN VB.NET? LIKE:DotNetRuntimeDebugHeader
c# can export stdcall api by UnmanagedCallersOnly,but vb.net can't do this,how can you fix?
or i can use
public function add_export_stdcall(a as long,b as long) as long
return a+b
end function
aot will auto set add_export_stdcall to export as :add
`public static class MyFunctions
{
[UnmanagedCallersOnly(EntryPoint = "Add")]
public static int Add(int a, int b)
{
return a + b;
}
}`
API Proposal
API Usage
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: