dll

DLL memory manager mixup

巧了我就是萌 提交于 2019-12-29 09:07:16
问题 I wrote an application which allows people to contribute plugins to extend the functionality. Such plugins are deployed as DLL files, which the framework picks up during runtime. Each plugin features a factory function which is called multiple times during the lifetime of the application to create objects. So far, in order to handle the ownership issue with these objects, I used a simple counting shared pointer on the returned objects so that they are destroyed whenever the last reference is

DLL memory manager mixup

此生再无相见时 提交于 2019-12-29 09:07:13
问题 I wrote an application which allows people to contribute plugins to extend the functionality. Such plugins are deployed as DLL files, which the framework picks up during runtime. Each plugin features a factory function which is called multiple times during the lifetime of the application to create objects. So far, in order to handle the ownership issue with these objects, I used a simple counting shared pointer on the returned objects so that they are destroyed whenever the last reference is

C Program Compiled with Cygwin and Called from Python Hangs

六月ゝ 毕业季﹏ 提交于 2019-12-29 08:59:09
问题 I'm trying to call a c program from Python using ctypes . I've got a minimum (non-)working example below. C Program Here is the C program I'm trying to call into. Just your standard hello world program. I compile this, on windows, using eclipse and the cygwin gcc compiler to produce a .dll file. main.h #ifndef INC_MAIN_H_ #define INC_MAIN_H_ void helloWorld(); unsigned char buf[] = "Hello World!"; #endif /* INC_MAIN_H_ */ main.c #include <stdio.h> #include "main.h" void helloWorld(){ printf("

How do I call a visual basic 6.0 method in c#?

杀马特。学长 韩版系。学妹 提交于 2019-12-29 08:46:10
问题 I would like to call a method which is written in visual basic 6.0 from c# (visual studio 2008). Is it possible? How would I do it? 回答1: Easiest way to do it is to just compile the VB6 code as an ActiveX DLL. Then you can reference the DLL in your .net project. (Visual studio can reference ActiveX DLLs properly.) 回答2: Compile your VB6 DLL as activex dll Register it using -> regsvr32 "Full Name And Path of newly compiled vb6 dll".(use Run Dialog or Command Prompt to register) In .net Add

VS2012 Error: The application was unable to start correctly (0xc000007b)

守給你的承諾、 提交于 2019-12-29 08:43:07
问题 I received the error "The application was unable to start correctly (0xc000007b)" after attempting to run my exe file of my C++ SFML 32-bit program I built in Visual Studio 2012. I statically linked the SFML dlls in my project, but incorporated the following dlls along with my program: libsndfile-1.dll openal32.dll msvcp110.dll msvcp110d.dll msvcr110.dll msvcr110d.dll What is the problem? 回答1: The actual error code that you encountered is 0xC000007B . That is the NTSTATUS error code STATUS

Could not load file or assembly X or one of its dependencies. is not a valid Win32 application. (HRESULT: 0x800700C1)

浪子不回头ぞ 提交于 2019-12-29 08:16:29
问题 OS: Windows 8.1 64 I tried to play multiple sounds in VB.Net with DirectX, there are no errors in my code. The problem is whenever the event is fired I get this error System.BadImageFormatException was unhandled Message: An unhandled exception of type 'System.BadImageFormatException' occurred in System.Windows.Forms.dll Additional information: Could not load file or assembly 'Microsoft.DirectX.AudioVideoPlayback.dll' or one of its dependencies. is not a valid Win32 application. (Exception

CreateRemoteThread, LoadLibrary, and PostThreadMessage. What's the proper IPC method?

依然范特西╮ 提交于 2019-12-29 08:15:24
问题 Alright, I'm injecting some code into another process using the CreateRemoteThread/LoadLibrary "trick". I end up with a thread id, and a process with a DLL of my choice spinning up. At least in theory, the DLL does nothing at the moment so verifying this is a little tricky. For the time being I'm willing to accept it on faith alone. Besides, this question needs to be answered before I push to hard in this direction. Basically, you can't block in DllMain. However, all I've got to communicate

Linking to a static lib compiled with MSVC

微笑、不失礼 提交于 2019-12-29 07:52:10
问题 I'm trying to link with a simple C lib on windows against Rust library My lib is .h extern "C" { void say_hello(const char* s); } .cpp #include <stdio.h> void say_hello(const char* s) { printf("hello world"); } My Rust file #[link(name="CDbax", kind="static")] extern "C" { fn say_hello(s: *const libc::c_char) -> () ; } Linking fails by giving an error with one of the data symbols error: linking with `gcc` failed: exit code: 1 note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker

GetProcAddress cannot find my functions

孤街浪徒 提交于 2019-12-29 07:46:07
问题 I made a DLL with a function named "render()" and I want to load it dynamically to my application, but GetProcAddress cannot find it. Here's the DLL .h: #ifdef D3D_API_EXPORTS #define D3D_API_API __declspec(dllexport) #else #define D3D_API_API __declspec(dllimport) #endif D3D_API_API void render(); And here's DLL .cpp: #include "stdafx.h" #include "D3D_API.h" #include <iostream> D3D_API_API void render() { std::cout << "method called." << std::endl; } Here's the application that tries to use

How to call a Managed DLL File in C#?

守給你的承諾、 提交于 2019-12-29 07:17:48
问题 I am making a scripting language but I have a serious problem. I need to make it so you can call .NET DLLs in the language but I have found no way to do this in C#. Does any one know how can I load and call a .NET dll programmatically? (I can not just Add reference so don't say that) 回答1: Here's how I did it: Assembly assembly = Assembly.LoadFrom(assemblyName); System.Type type = assembly.GetType(typeName); Object o = Activator.CreateInstance(type); IYourType yourObj = (o as IYourType); where