create dll file in c# [closed]

File menu -> New Project -> choose your Programing language (Visual C#/VB etc.) -> Windows -> Class Library. After the project has been created, make use of Build menu -> Build Solution (or Build [Project Name]) to compile the project. You may find out the dll in the folder: project folder\bin\debug(or release)

C++/CLI wrapper for native C++ to use as reference in C#

Ok, tutorial. You have a C++ class NativeClass that you want to expose to C#. class NativeClass { public: void Method(); }; 1) Create a C++/CLI project. Link to your C++ library and headers. 2) Create a wrapper class that exposes the methods you want. Example: #include “NativeClass.h” public ref class NativeClassWrapper { NativeClass* m_nativeClass; … Read more

Call function from DLL?

Depends on what type of DLL. Is this built in .NET ? if it is unmanaged code then here is an example otherwise the Answer from Rob will work. Unmanaged C++ dll example: using System; using System.Runtime.InteropServices; You may need to use DllImport [DllImport(@”C:\Cadence\SPB_16.5\tools\bin\mpsc.dll”)] static extern void mpscExit(); or [DllImport(“user32.dll”, CharSet = CharSet.Unicode)] public static … Read more

Can I bundle the Visual Studio 2015 C++ Redistributable DLL’s with my application?

There are 4 files in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT. Does that mean I just need to copy them to my application’s directory during the install process? Yes, and the paragraph you quoted means just that. Is this OK to do? Do I need to show a license? Why aren’t more people doing this … Read more

Linking : .a, .lib and .def files

Static libraries on Linux have the .a file extension. Static libraries on Windows have the .lib file extension. Dynamic libraries on Windows have the .dll extension; in order to link against a DLL, an import library is required. The import library is a static library. It contains the code required to load the DLL. Now … Read more

BadImageFormatException when loading 32 bit DLL, target is x86

From what I understand, an assembly specifically built for x86 and running in a 64-bit operating system can only load libraries built for x86 or a BadImageFormatException will be thrown. In a 64-bit OS, an assembly built for Any CPU or x64 will throw the same exception when trying to load an x86 library. So, … Read more

Reference images stored in external dll using wpf

Assuming you reference the class library from the WPF application you can reference and display the image in the WPF application with the following XAML: <Image Source=”/ClassLibraryName;Component/images/myimage.png”/> The important thing here is “ClassLibraryName” which is the assembly name for your class library. “/images/myimage.png” is the path to your image. You can find out more about … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)