Coder Social home page Coder Social logo

3f / examples Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 16.0 570 KB

An complete examples and related support for various popular projects, and more.

Home Page: https://github.com/3F/DllExport/issues/84

License: MIT License

C# 19.55% Batchfile 27.37% C++ 47.19% C 4.06% Visual Basic .NET 1.84%
automation build conari dllexport examples msbuild projects samples scripts vssbe vssolutionbuildevent

examples's Introduction

examples's People

Contributors

3f avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

examples's Issues

VS2012 don't undestand DllExport attribute

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?

Does export work with async ?

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.

DLLExport Example with by-ref parameters

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#.

Basic Export needs dotnetcore dependency checked

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.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.