I am trying to get knowledge of some of the WinAPI's in vb.net, but can't find the tool that used to exist for vb6, API Viewer.
Does VS2015 happen to come with something easier?
Is there a similar way of importing WinAPI code from a tool into vb.net?
It appears that VS2015 does not include a tool for browsing the Win32 API.
I was able to find through the assistance of some helpful comments above, a website known as PInvoke.net. However, this is outdated.
I did find references to PInvoke Interop Assistant, which is exactly what I was looking for.
Related
I have followed this example on how to mix C# and C++ code in single assembly and all compiles fine. But all this is from the developer command prompt. I want to put all this in one Visual Studio solution and can't succeed. Does anybody know how to do that? (I am still very inexperienced with Visual Studio)
I have found several articles about this, but all give examples from the command prompt. This SO answer even recommends not doing this at all, not sure why?
Also, many of those articles talk about creating a managed DLL (using dllexport/dllimport, but I need to link the obj/lib files directly in the same C# assembly.
Note: The reason I need to do this, is to add a licensing static library to my C# desktop application project. The library is written in C/C++ and is already used in my back-end, I would like to use the same logic for the front-end. Loading the library as a DLL would defeat the purpose since anybody could just change it for a fake one. Therefore linking it in the same assembly is essential.
I am using Agile .NET's virtualization features since a time, and I have wanted to try their Code Encryption. The obfuscation completes fine, but once I deploy my DLL with It, the application just doesn't work.
I hardly found that the obfuscator will provide you some dlls like AgileDotNetRT and AgileDotNetRT64, in the options, but I don't get any.
I even tried copying those dlls from the install folder without luck.
Anyone knows why? I haven't found any info on the "docs".
Old question, but Encryption doesn't work on mono, which was confirmed by the devs.
Background
I'm currently doing a benchmark of solutions to convert java code to c#
We have a fast evolving java software and wan't to port some low level (not ui) apis with a tool, because maintaining all changes between versions could prove really tiresome...
Anyway, I've been trying to use Sharpen, as I heard it's a pretty wicked tool used by some mono "freaks" to keep some versions of their tools in check.
What I did
For this purpose, I tried several tutorials I found on internet, the easiest to understand being http://www.pauldb.me/post/14916717048/a-guide-to-sharpen-a-great-tool-for-converting-java
As the link he gives for a pre-build sharpen plugin is now broken, I build my own version of the plugin using sources and instructions found here : https://github.com/xamarin/XobotOS/
Result
The plugin build perfectly, and is installed in my eclipse folder. But when I try to run the ant script after setting everything up, I get an error :
java.lang.RuntimeException: Application "sharpen.core.application" could not be found in the registry.
Conclusion
Well. I'm lost here.
I have no idea what that means.
I'm using Windows 7 64bit
I'm using Eclipse 3.7
I'm using java 6 sdk 64 bit
If anyone ran into this and has a solution... That be helpful.
Thanks in advance.
Initially I tried the same approach as you did, with the same result. But if you follow the instructions in the README.build file, section Setting things up, you should be able to launch a secondary Eclipse applications with the sharpen.core and sharpen.xobotos plug-ins included.
You could then import your Java project subject to conversion into the secondary Eclipse app, provided that you have included a Sharpen Xobot builder command and nature into your project file, like this .project file in the XobotOS/android folder. I edited the .project file manually before importing the project, but I assume you can also configure this from within Eclipse?
The configuration files provided by Paul Du Bois are not applicable, instead you will need to copy and edit the converter-config.xml file from the XobotOS/android folder. This file in turn references a file in the app sub-folder, which probably also needs to be copied and edited.
This is basically as far as I have been able to take it until now. I have been able to edit the configuration files to enable the converter to run, but at this point I have only been able to generate C# stubs. If you or someone else manages to take this even further, I would be happy to learn how to generate real C# files using the XobotOS Sharpen converter.
UPDATE
Asked Miguel de Icaza if there were any instructions for converting arbitrary Java projects using the XobotOS Sharpen version. He responded that there are many hard-coded details in this version that makes it difficult to apply to arbitrary projects. At this stage he recommends Lluis Sanchez' Sharpen version to be used instead.
BTW, the NGit library has been moved to here. You will find a fully functional sharpen plug-in for Eclipse in the gen/plugins sub-folder.
UPDATE MAY 17
Note that you need to have the Plug-in Development Environment software installed in Eclipse to be able to build and run the plug-in projects. IF you are running Eclipse IDE for Java (SE) Developers, you need to extend it with the PDE software.
Just discovered Quantlib and am evaluating it for use. I am not a C++ developer, and no one on staff where I work really has deep experience with it, so I am pretty much following the instructions by rote found here:
http://quantlib.org/install/vc10.shtml
The next step will be to convert to C# using SWIG (based on instructions found here: Compiling Quantlib via SWIG for C#).
My question is, when I have completed all of the steps listed in both posts, will the result be a library that can only be compiled as 32-bit? The Boost download seems to indicate that it is 32-bit only.
Is compiling as a 64-bit application possible and/or are 64-bit binaries available anywhere (Windows platform) and/or are alternative wrapper libraries (like QLNet) a good alternative?
I'm a regular user of QuantLib. Why would you convert QuantLib to C#??? There's QLNet, which is a direct port of the library in C#. Regarding about 64 bits, you just need to compile the source yourself.
I am writing in C#.
How can i find out which methods/functions I can use in an unmanaged dll that doesn't belong to windows?
Exmaple : I have some installed software on my computer, it has a dll, and i want to know what my options are as to creating code to connect to that software?
For native DLL's that you do not have a reference for you can use the dumpbin utility in the Visual Studio SDK to extract the list of exported functions in a DLL.
Dumpbin reference is here: http://msdn.microsoft.com/en-us/library/c1h23y6c(VS.71).aspx
And a CodeProject page giving some additional details on how to use dumpbin in conjunction with finding the correct P/Invoke signatures is here: http://www.codeproject.com/KB/mcpp/usingcppdll.aspx#Retrieve
PInvoke.net is great resource for .NET interop. They list not only the functions available in Windows native libraries, but also the signature you need to use in your .NET code.
use Depends.exe (which comes along with VS).
Depends would display all the exported function that can be invoked from Managed code using Pinvoke.
I read a blog about PInvoke Interop Assistant, which can deal with our own DLLs as well
http://www.codeplex.com/clrinterop/Release/ProjectReleases.aspx?ReleaseId=14120
I would just like to add that if it's a COM assembly, like a VB6 COM component, it can be browsed in the Object Explorer in Visual Studio and that's pretty nice because it breaks everything out for you quite nicely.