flat assembler
Message board for the users of flat assembler.

Index > Windows > Can't load dll from C# nor C

Author
Thread Post new topic Reply to topic
mov



Joined: 22 Jul 2017
Posts: 1
mov 22 Jul 2017, 11:57
I just can't manage to get a dll working, not even the example dll code that is already present when you make a new project in Fresh.

I set everything in C# to x86 and checked the dll file with dependency walker and everything looks fine.

But this call

Code:
IntPtr pDll = NativeMethods.LoadLibrary(@"D:\Develop\FASM\testDLL\template.dll");    


fails every time with "[file] is not made for execution on Windows or contains an error."

I'm 100% sure that both (dll and exe) are 32bit applications. I checked everything twice with dependency walker and PE Explorer.

Any ideas or does someone have an example that works?

I tried it with C#, C++ with QT and C
Post 22 Jul 2017, 11:57
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2505
Furs 23 Jul 2017, 11:37
You can't from C either? Can you upload a simple test dll that fails or whatever? Otherwise it's a blind guess.

I don't know anything about C# but don't you need to escape backslashes in strings like in C?
Post 23 Jul 2017, 11:37
View user's profile Send private message Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 257
Trinitek 28 Jul 2017, 20:44
Furs wrote:
I don't know anything about C# but don't you need to escape backslashes in strings like in C?
The @ prefix on string literals escapes all special characters. For every other case, this is true.
Post 28 Jul 2017, 20:44
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.