dll

Exporting C++ code as a DLL and import using C#?

为君一笑 提交于 2020-01-06 13:27:25
问题 I have a program written in C++ with a main function that calls a bunch of other C++ classes/functions. I am new to C++ (been a python programmer), so I'm wondering - What are the steps I need to follow to be able to export this as a DLL that is importable from a C# program? Any suggestions? 回答1: If you want your C++ classes to be usable in a C# application you will need to use COM or target the CLR in your C++ program (i.e., use C++/CLI). If you simply have some functions in the C++ DLL that

Calling static function of C# .NET in C (ICLRRuntimeHost_ExecuteInDefaultAppDomain)

夙愿已清 提交于 2020-01-06 10:40:48
问题 I have this class KernelHelper which is written in C# .NET Framework 2.0. What I want to do is call its static functions in a C program. namespace Kernel.Client { public class KernelHelper { public static int testc(string msg) { // Removing the message box does not change anything System.Windows.Forms.MessageBox.Show(msg); return 0; } // ... } } which compiles and does not seem to make any problems so far. But calling ICLRRuntimeHost_ExecuteInDefaultAppDomain() returns 0x80131513 which is

Dynamically linked DLL is loaded immediately after starting the application

筅森魡賤 提交于 2020-01-06 10:20:51
问题 I've dynamically linked libhunspell.dll (HunSpell) to my application. It works, but there is a dumb problem which I don't know why it happens. Even before I use LoadLibrary("path\\to\\libhunspell.dll"); to load it and use it, on the start of the application it attempts to load the library by itself. If I place the libhunspell.dll into the path where my main executable resides, it can load it, otherwise it reports an error, immediately after starting the application - This application has

Dynamically linked DLL is loaded immediately after starting the application

。_饼干妹妹 提交于 2020-01-06 10:16:12
问题 I've dynamically linked libhunspell.dll (HunSpell) to my application. It works, but there is a dumb problem which I don't know why it happens. Even before I use LoadLibrary("path\\to\\libhunspell.dll"); to load it and use it, on the start of the application it attempts to load the library by itself. If I place the libhunspell.dll into the path where my main executable resides, it can load it, otherwise it reports an error, immediately after starting the application - This application has

How to use an external interpreter for Maya?

∥☆過路亽.° 提交于 2020-01-06 07:26:28
问题 Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import maya.standalone ImportError: No module named maya.standalone This is my condition: Python version provided by Maya Environment variable PYTHONPATH set to sitepackages folder and MAYA_LOCATION to Maya root folder site-packages address appended to sys.path dll files are here in this address %:\Program Files\Autodesk\Maya2014\Python\DLLs I set the environment to address above and still got the same error Why should

Using DLL in windows Go

无人久伴 提交于 2020-01-06 07:12:21
问题 I'm trying to use proprietary DLL in my Go project. One of DLL's method description looks like this: BYTE* Init(const BYTE* path, int id); in my test Go project I'm doing something like: import ( "golang.org/x/sys/windows" ) var ( lib = windows.MustLoadDLL("dllname.dll") init = lib.MustFindProc("Init") ) func main() { path := "some" bytePath = []byte(path) init.Call( uintptr(unsafe.Pointer(&bytePath)), uintptr(9) ) } Library gets called, there is an error message "path isn't exist", but I

C++ linker options for DLL (DEF, LIB, etc)

末鹿安然 提交于 2020-01-06 06:43:43
问题 I have downloaded a library for the purposes of writing a program that can uncompress a RAR file. (http://www.rarlab.com/rar/UnRARDLL.exe) This supplies me with unrar.dll , unrar.h , unrar.lib and UnRDLL.def . I have copied the C example code and have tried compiling it with both Dev-Cpp and Eclipse. I don't have much experience using DLLs, so I don't know how to deal with the following linker errors: UnRDLL.o(.text+0x151):UnRDLL.c: undefined reference to RAROpenArchiveEx@4' UnRDLL.o(.text

Register DLL (ActiveX) for Non-Admin user

喜你入骨 提交于 2020-01-06 06:41:33
问题 I try to register dll (ActiveX) for non-admin user using MSI. To create registry settings I have register the dll in admin mode, then exported the relevant registry entries and renamed all HKLM to HKCU. When I install it for non-admin user all works fine. But when I use the same settings with admin user, there is a problem of discovering TypeLib. What should be changed in the registry entries to work both for admin and non-admin user, when the registration done under HKCU? Thank you 回答1: If

C# crash when loading C++ dll

夙愿已清 提交于 2020-01-06 06:35:07
问题 My program is written in C# NET 2.0,it's using external functions from a dll written in C++ using Microsoft Visual Studio 2008 SP1. If I remove the dll from the directory the program is placed,the program crashes at the moment it should use the dll.That's normal. But the users that are using my program get the same error at the same place without moving the dll.They all have C++ Redistributable 2008 from >here< Does it happen because I made the program in .NET 2.0 instead of NET 3.5 or it

Code execution cannot proceed because libquickmail-0.dll was not found?

*爱你&永不变心* 提交于 2020-01-06 06:19:32
问题 I was looking for a quick and easy way to automatically send a file to my gmail for debugging purposes on multiple remote machines. However I am apparently having linking issues which I can't seem to solve. I downloaded the win64 zip file of libquick, IDE is CodeBlocks, compile target is x64 and running on 64-bit Windows 10. There were 10 files that came in the zip folder, in lib/include/bin. They were bin > libquickmail-0.dll , libquickmaillight-0.dll , quickmaillight.exe . include >