Closed gayan-rb closed 4 years ago
Then maybe CallingConvention.Winapi
is not the right thing for you? Did you try other calling conventions?
Yes I have others too. when i tried with CallingConvention.ThisCall
I'm getting this exception
You might want to look for the DLL's documentation - they need to state the correct calling convention.
@zalintyre Thanks for the support and awesome project .. I love it
Thank you! :) Were you able to solve your problem?
@zalintyre actually I'm trying still I couldn't figure it out what's wrong.!! I posted the same issue on StackOverflow and one guy suggested a path so go on. I'm trying to figure it out. if you get any clue please update the issue I will keep it open. Thank you very mcuh.
Is the DLL provided by yourself or a third party library? Are you able to view the library source code?
If the DLL relies on returning pointers to memory addresses, this will not work with legacy wrapper. Because the wrapper will run in a different memory space than your application, you will not be able to access memory the DLL allocates. As someone in that Stackoverflow question suggested, the DLL should return actual result structures instead of pointers.
It's a third party dll. I'm not able to view source code. they have already written a wrapper only for 32 bit. that's why I'm trying to write a wrapper for 64 bit. I can share the source code that I'm trying if you are interested.
As I said in my previous comment, if the DLL is only handing out pointers, that won't work with LegacyWrapper.
it seems works without exception but. When I call the function, as a result, I'm getting 0x0000000000000000 which should be something like 0x0186ad58 what causes the issue?