dll

Python, ctypes, DLLs and PCOMM emulation. How can I pre-allocate a variable?

允我心安 提交于 2019-12-24 05:07:09
问题 After a long time learning python I finally managed to make some breakthroughs: I'm using the following code to connect to a personal communications terminal: from ctypes import * import sys PCSHLL32 = windll.PCSHLL32 hllapi = PCSHLL32.hllapi def connect_pcomm(presentation_space): function_number = c_int(1) data_string = c_char_p(presentation_space) lenght = c_int(4) ps_position = c_int(0) hllapi(byref(function_number), data_string, byref(lenght), byref(ps_position)) And so far so good. It

Native C++ use C# dll via proxy C++ managed dll

百般思念 提交于 2019-12-24 04:45:26
问题 This is rather convoluted, so bear with me. I have a 3rd party program (the "target") that is coded in Native (Win32 only) C++. As part of the target's design, it implements a dll-plugin system. Native DLLs, when placed in the "ext" directory of the program, are loaded by the target. The target then invokes four methods that each DLL provides (Initialize, SendHook, RecvHook, Terminate) as appropriate. As you may have guessed from the function names, the add-ins hook certain functions in the

Add a WPF XAML resourcedictionary to a DLL

被刻印的时光 ゝ 提交于 2019-12-24 04:17:30
问题 Maybe I'm misunderstanding how this all works and you can't really stuff plain old XAML files into a DLL as data which can be grabbed out later - but I thought this was possible. I have tried over and over and over again for like five hours to get this to work so I'm finally asking Stack Overflow. I have a XAML file in a WPF User Control Library project. In a perfect world, I should be able to have this XAML file embedded in some way into the DLL for reference in another project. I don't want

Unity internal compiler error with custom dll

大城市里の小女人 提交于 2019-12-24 03:47:18
问题 I spent some hours trying solutions I found online but nothing worked so here's my question for Stackoverflowers. I made a small plugin for Unity and imported the dll into my project folder. It works fine when I launch the game within the editor but if I try to compile I get the following: Internal compiler error. See the console log for more information. output was: Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper

Python ctypes Unable to pass memory array in a structure

巧了我就是萌 提交于 2019-12-24 03:40:06
问题 Python 2.7.8, Windows 7, Phyton USB programmer's DLL I am stuck with the Data element which should be a large memory array, I have tried using several different definitions, but I cannot understand what the errors are trying to tell me. Most of the errors I have encountered have been type errors, this code below is the closest I have been, it seems to be calling the function, but it does not process due to the error. C API: typedef struct tagACI_Memory_Params { UINT Size; // (in) Size of

Importing C# dll to C++ managed code (.NET)

↘锁芯ラ 提交于 2019-12-24 03:27:06
问题 I'm using Visual Studio 2010. I've written a dll in C#, managed dll then. Now for some reason, I need to write a software in C++ (.NET then also managed). I need to import the C# dll into my C++ .NET code. I can't figure out to do this, I've made several search but this problem seems to not be covered. For example, in C# I don't have include file, then how my C++ (.NET) projet knows about classes and functions inside the dll? Thanks, 回答1: In Visual Studio, bring up the properties of the C++

Calling a C# .dll from Ruby via COM

吃可爱长大的小学妹 提交于 2019-12-24 03:26:35
问题 I'm trying to call a few methods from C# in my Ruby code. First, I am creating a .dll in Visual Studio 2008. I'm registering for COM interop when I build. To test out this new process, I created a simple little DivideTwo method in C#- public double DivideTwo(double a, double b) { return a / b; } In Ruby, I do the following: require 'win32ole' test=WIN32OLE.new('DllAttempt.CsharpDll') x=test.DivideTwo(5,5) puts x #x=1 I get all excited because I think I've gotten it to work! I decide to return

Trouble compiling Windows DLL using Golang 1.10

拜拜、爱过 提交于 2019-12-24 03:21:56
问题 I'm having issues building a Windows DLL in Golang 1.10, which is supported in this latest version: "The various build modes have been ported to more systems. Specifically, c-shared now works on linux/ppc64le, windows/386, and windows/amd64;" (Source: https://golang.org/doc/go1.10) I have a very simple program right now ( main.go ) that only exports one function "Test", but am having issues when using the following "go build" command: env GOOS=windows GOARCH=386 go build -buildmode=c-shared

Dynamically load ASP.NET Page from DLL

心不动则不痛 提交于 2019-12-24 03:03:13
问题 I want to create a modular ASP.NET application. Something like, I have a main application that is just some kind of module loader. It only have the one "Default.aspx" page. And, based on the loaded modules, this page will create a menu and links to the pages found in the modules. I want the modules to be ASP.NET projects packed into dll. So, I want to drop that dll into the "Modules" folder of my main application, it will identify the module, and use reflection to load the modules, inspect

Embedded Unmanaged DLLs don't load in ASP.NET

杀马特。学长 韩版系。学妹 提交于 2019-12-24 02:47:11
问题 I'm working on an ASP.NET host for a WCF service. The service references a C++/CLI wrapper library, which itself references an unmanaged DLL. Based on this question I've embedded the unmanaged DLL in the ASP.NET DLL. I then extract it like this: string[] dlls = new [] { "myDLL.dll", "myDLLD.dll" }; Assembly assembly = Assembly.GetExecutingAssembly(); string location = Path.GetDirectoryName(assembly.Location); Dictionary<string, Stream> streams = (from dll in dlls select new KeyValuePair