Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing native dlls out of the box #70

Open
Binto86 opened this issue Jul 19, 2022 · 2 comments
Open

Importing native dlls out of the box #70

Binto86 opened this issue Jul 19, 2022 · 2 comments

Comments

@Binto86
Copy link
Contributor

Binto86 commented Jul 19, 2022

In c# to use functions from native dll you need to create new function in c# and mark it with dllimport attribute.
It would be nice to be able to use native functions without any of this code.
Because Fresh supports free functions, this should be much more doable than in c# where you need class for everything.

Edit:
(I am editing this long time after I created this issue and we have now much better idea how the language should look)
This could probably be done using macros, syntax could be import_native!("user32.dll") and the signature information would be read from the .h file

@svick
Copy link

svick commented Jul 19, 2022

How would that work? As I understand it, native DLLs generally don't expose signatures of the exported symbols.

@LPeter1997
Copy link
Member

As @svick mentioned, this is impossible without symbolic information, which is usually not present in native DLLs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants