❔ Linking C# and C++
This may be a region issue but I couldn't find an exact answer, I have a simple GUI for an application in Winforms C#, and I want to make it functional using C++ or C not C# itself, is there any SIMPLE way to make buttons and text boxes etc functional using C++ or C#?
26 Replies
There's no simple way, no
p/invoke comes to mind, or maybe DLLImport
Thank you. For a Macro would it be more efficient to learn C# or just try to use C++? because I need a language that can execute many things in milliseconds
I'd say try C#, see if it fits your performance requirements, if not try fiddling with P/Invoke'ing C++ code
thank you so much
what are you asking exactly
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I'm trying to make a simple macro application
It would have:
-Keybind selector, Intervals between clicks and total amount of clicks before it stops clicking
a mouse click macro*
I'm more comfortable with C and C++ but making GUIs in them is too hard for my current level, so i thought of using C#
Only code that needs to be executed in C:
Simulating mouse clicks
Using keybinds to start/stop
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Personal project / gaming
it's my first year coding and I thought it'd be a good start
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Not really you're right
but I'm using it on a singleplayer world in Minecraft
It's an SMP but I own the server so it's okay
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I think I'll try that if I hit a roadblock for now, because the channel specified low-level and macros are generally not very low level
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Have you tried CLR? (Common Language Runtime)
tebeco#0205
unsure if that still works in .net core
I would also ask if C++.Net is still a thing
because you could then have both unmanaged and managed code together
Quoted by
<@!689473681302224947> from #Linking C# and C++ (click here)
React with ❌ to remove this embed.
id rather do ipc than c++/cli
Yea, but it depends on OP, if he didn’t know about cli he should atleast give it a try
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
blurr#9735
I think I'll try that if I hit a roadblock for now, because the channel specified low-level and macros are generally not very low level
Quoted by
<@!689473681302224947> from #Linking C# and C++ (click here)
React with ❌ to remove this embed.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
clr is the .net runtime
what youre talking about is called c++/cli
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
frfr
Don't use
[DllImport]
actually use [LibraryImport]
way better and the managed types marshaling is covered by a source generatorWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.