© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
2y ago
•
84 replies
voltagex
LibraryImport examples, especially on Linux
Has anyone got examples of usage of the newer LibraryImport infrastructure
(
?
) as opposed to DllImport
?
I have seen
https://stackoverflow.com/questions/75304403/marshalling-function-pointers-with-net-7-libraryimport
which just about melted my face off
and
https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke-source-generation
isn
't bad but no one seems to be using this in open source code
.
Stack Overflow
Marshalling Function Pointers with .NET 7 LibraryImport
I
'm trying to implement some P
/Invoke code using the new LibraryImport attribute
, as opposed to the old DllImport
. Specifically
, I am trying to marshal a WNDCLASSEXW struct for use in RegisterClass
.
.
.
P/Invoke source generation - .NET
Learn about compile
-time source generation for platform invokes in
.NET
.
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Next page
Similar Threads
SourceGenerator and LibraryImport
C
C# / help
2y ago
Help with LibraryImport and custom marshalling
C
C# / help
2y ago
❔ C# on Linux
C
C# / help
3y ago
❔ Developing on linux?
C
C# / help
3y ago