Giter Club home page Giter Club logo

Comments (11)

zalintyre avatar zalintyre commented on July 23, 2024

Hi,
it seems like you have compiled the Legacy Wrapper for yourself. If so, please ensure that the LegacyWrapper project is compiled as 32bit (not AnyCPU) to match your C++ dll.

from legacywrapper.

MiroljubA avatar MiroljubA commented on July 23, 2024

Hello dsfranzi,
thanks for the quick reply.

The problem above was with the nugget package of Legacy.Wrapper.
I did try to manually build your example, with LegacyWrapper built in x86 and the others (Client and Test) in x64 however then I get the crash message below at Process.Start ("Codefoundry.LegacyWrapper.exe", token);. This was in Win7 x64

Problem Event Name: APPCRASH
Application Name: Codefoundry.LegacyWrapper.exe
Application Version: 1.0.1.0
Application Timestamp: 584fbbf8
Fault Module Name: KERNELBASE.dll
Fault Module Version: 6.1.7601.18015
Fault Module Timestamp: 50b83c8a
Exception Code: e0434352
Exception Offset: 0000c41f
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

from legacywrapper.

MiroljubA avatar MiroljubA commented on July 23, 2024

In windows10 Legacy.Wrapper doesn't crash but the program just waits at _pipe.Connect();

from legacywrapper.

rjm2k avatar rjm2k commented on July 23, 2024

Thanks for this project, I wonder if the issue above is the same as one I found in that the caller of your client library needs to be compiled for AnyCpu as it causes a deserialisation issue in the 32 bit exe host otherwise, my library which called the client was compiled to 64bit so failed with the badimageformat exception in the exe.
Additionally, it seems the library isn't setup to return reference params to the caller, I assume there is no reason this can't be done and that DynamicInvoke can and does return ref param changes?

from legacywrapper.

zalintyre avatar zalintyre commented on July 23, 2024

@MiroljubA can you post some of your code calling the dll?

from legacywrapper.

zalintyre avatar zalintyre commented on July 23, 2024

@rjm2k I'll try to include support for ref params.

from legacywrapper.

zalintyre avatar zalintyre commented on July 23, 2024

I improved the error handling of the wrapper exe, so that exceptions thrown should be more detailed now. @MiroljubA if there are still unrelated exceptions, feel free to post them here.

Also, ref parameters are possible now, the values in your passed parameters array will get updated.

from legacywrapper.

rjm2k avatar rjm2k commented on July 23, 2024

awesome thanks, I'll try to check it out today and replace my local version with your updates.

Any idea how loading the lib each time affects internal state of any dll loaded? I was wondering it it would be better to create one WrapperClient per library to be called and passing the library name into the constructor instead of every time into invoke, that way a library can be loaded once, used and then disposed when finished.

from legacywrapper.

zalintyre avatar zalintyre commented on July 23, 2024

I think loading the DLL only once is a good idea. I'll think of a solution that won't break the exising API.

from legacywrapper.

zalintyre avatar zalintyre commented on July 23, 2024

@rjm2k please have a look at LegacyWrapper 2.0 ;)
I think this issue is solved now, but feel free to open a new one if you have more suggestions or encounter any problems.

from legacywrapper.

rjm2k avatar rjm2k commented on July 23, 2024

Yes already found it thanks, I can confirm that ref Param's and single load of the DLL work perfectly thanks. Just a comment to others that they still might have to compile the client of your library as msil but I haven't verified that after you introduced the common library.

from legacywrapper.

Related Issues (20)

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.