3f / examples Goto Github PK
View Code? Open in Web Editor NEWAn complete examples and related support for various popular projects, and more.
Home Page: https://github.com/3F/DllExport/issues/84
License: MIT License
An complete examples and related support for various popular projects, and more.
Home Page: https://github.com/3F/DllExport/issues/84
License: MIT License
Can you please provide an example where a complex type or an arrary of complex types is handed to c# by ref.
Unmanaged code (c++) creates a complex type and fills this type with some data.
Unmanaged code calls an c# Function and hands over the complex type.
c# Reads the data that has been provided by unmanaged code.
c# Modifies the data and hands back the modified data to unmanaged code.
Unmanaged code (c++) uses the data which has been modified by c#.
VS2012, C#.
Create ClassLibrary project, install DllExport 1.7.3 package, add function from example. Compiler can't find DllExport and DllExportAttribute.
What's wrong?
Thinking to convert a method from synchronous to async
[DllExport]
[return: MarshalAs(UnmanagedType.LPWStr)]
public static string IsAppRegistered()
{
try
{
string[] scopes = "User.Read,User.ReadBasic.All".Split(',');
var tokenRequest = tokenAcquisitionHelper.AcquireATokenFromCacheOrIntegratedWindowwAuthenticationAsync(scopes);
AuthenticationResult authenticationResult = tokenRequest.Result;
}
Have my doubts on if this would be supported at all, or if I am not understanding how to configure it
[DllExport]
[return: MarshalAs(UnmanagedType.LPWStr)]
public static async Task<string> IsAppRegistered()
{
try
{
string[] scopes = "User.Read,User.ReadBasic.All".Split(',');
var tokenRequest = tokenAcquisitionHelper.AcquireATokenFromCacheOrIntegratedWindowwAuthenticationAsync(scopes);
AuthenticationResult authenticationResult = await tokenRequest;
}
catch (MsalUiRequiredException ex) when (ex.Message.Contains("AADSTS65001"))
DLL is built, function exported, but on trying to use method it raises the exception about the result
Unhandled Exception: System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'return value': Generic types cannot be marshaled.
I am brand new to .NET, so maybe this is a silly thing to post. I downloaded your BasicExport example and loaded it in Visual Studio to experiment with it. I could get the VB.net/C# .NET framework projects to display in the debug console properly, but the DotNotCore would not, erroring with "specified module could not be found".
After tinkering I saw that the DotNotCoreLibrary was not checked under dependencies. Checking that allowed it to debug properly. I don't know if I did something to mess that up, but figured I'd post it here just in case.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.