dll

Sharing variables between multiple Dlls in C++

主宰稳场 提交于 2019-12-25 07:54:23
问题 I need to share a variables (1000s) between 2 C++ Dlls. How should I do that? MyVariables.Dll contains: int a = 0; ModifyMyVariables.Dll contains: extern int a; a++; // do more stuff with a; What am i supposed to write in the following files? myvariables.h myvariables.cpp ModifyMyVariables.h ModifyMyVariables.cpp 回答1: You can share data between images (EXE, DLL...) using several fundamental mechanisms (using extern does not work to share data - it only instructs the linker and not the loader!

Pinning a Structure to avoid AccessViolationException

妖精的绣舞 提交于 2019-12-25 07:47:09
问题 I am calling an function from a DLL which is loaded run-time (Using LoadLibrary()). This DLL is written in C++ and my code is in C#. API requires Structure Pointer. I am passing "ref" instead of Pointer. While doing this, I getting "AccessViolationException". After 3 days of Googling, I think the problem could be solved by Pinning the Structure so that GC won't disturb it. (See: Passing struct by reference causing AccessViolationException) My question is Can I pin a structure without using

How do I stop a delay-loaded DLL from throwing a “missing from your computer” system error?

筅森魡賤 提交于 2019-12-25 07:25:45
问题 I set up delay loading in my plugin yesterday: #ifdef _WIN32 #pragma warning (disable : 4100) /* Disable Unreferenced parameter warning */ #include <windows.h> #include <delayimp.h> #endif ... // Configuration Properties / Linker / Input / Additional Dependencies: ./lib/libcurl.lib;./lib/libxml2.lib;./lib/iconv.lib;./lib/zlib1.lib;%(AdditionalDependencies) // Configuration Properties / Linker / Input /Delay Loaded Dlls: libcurl;libxml2;iconv;zlib1;%(DelayLoadDLLs) #include "curl.h" #include

clr.dll causes 800703e9 on Microsoft .NET 4.6.1

帅比萌擦擦* 提交于 2019-12-25 07:15:05
问题 When using a DLL that works fine in a .NET-based Windows app in Excel 2013, it crashes the clr.dll: Application: EXCEL.EXE Framework Version: v4.0.30319 Description: The process was terminated due to an internal error in the .NET Runtime at IP 6F033A0F (6EDA0000) with exit code 800703e9. Faulting application name: EXCEL.EXE, version: 15.0.4833.1000, time stamp: 0x573ac30d Faulting module name: clr.dll, version: 4.6.1076.0, time stamp: 0x56d7a0ff Exception code: 0x800703e9 Fault offset:

application-defined exception (code 0x0eedfade) after actual exception

跟風遠走 提交于 2019-12-25 07:05:20
问题 I've got a piece of legacy code written in Delphi, long before I jointed the company and the behaviour of my IDE makes me doubt a lot of my own skills. After loading a DLL and assigning the functions OpenDB, GetError and GetErrorStr from the DLL, this code gets called: If @OpenDB <> nil then begin DB_num := OpenDB((PAnsiChar(file))); if DB_num = -1 then begin err := GetError; ErrorString := GetErrorString(err); raise Exception.Create(ErrorString); Exit; end end else Exit; OpenDB returns -1

Could not load file or assembly 'MSHTML, Version=4.0.0.0,

随声附和 提交于 2019-12-25 06:49:11
问题 So I am working on a ASP.NET/C# application. It basically scrapes a certain website based on some parameters. I open my project and try to run it. It seems to work fine until I try to actually scrape the site I get this error: Could not load file or assembly 'MSHTML, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. Which is weird because I have a similar project using the same dll's and no I have no problems. 回答1: So

Accessing a non-COM visible DLL method from a COM visible DLL registered in GAC

心不动则不痛 提交于 2019-12-25 06:32:01
问题 My website application uses C# COM+ components running under a particular identity to access SQL Server, invoked from classic ASP. There's also a web service that utilises a \bin DLL in the website application that contains a method to insert some data into the SQL Server database (let's call it MyApp.Database.dll ). From the website front end, I want to be able to provide authenticated users with this same functionality. I don't want to duplicate code in MyApp.Database.dll within the COM+

Problem in calling a virtual function across Symbian DLLs

纵然是瞬间 提交于 2019-12-25 06:28:27
问题 My IM application setup is like below: User Interface module (exe) Plugin module ( A polymorphic DLL that provides an abstract interface for different protocols to the UI module ) Several Protocol DLLs ( Shared library DLLs that implement the respective protocols, like Jabber, ICQ etc ) Now, I was asked to implement contact list caching feature and that meant doing File I/O. Since File I/O cannot be done in the protocol DLLs ( it cannot access the applications private folder ) I implemented a

DllNotFound Exception when I use glut functions in my Dll

自作多情 提交于 2019-12-25 05:49:18
问题 I have a c++ dll and c# application. In C# application I call function from dll. With simple function like: extern "C" { __declspec(dllexport) void HelloFromDll() { MessageBox(NULL, _T("Hello from DLL"), _T("Hello from DLL"), NULL); } } all works fine. When i use function with glut like this: extern "C" { __declspec(dllexport) int InitGlut() { glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowPosition(100,100); glutInitWindowSize(320,320); glutCreateWindow("MyWindow");

Unloading dll rxtx before exit to avoid jvm crashes or hide hs_err_pid.log files

情到浓时终转凉″ 提交于 2019-12-25 05:25:12
问题 Well, I'm on a project that uses rxtxSerial.dll (very buggy by the way). Anyway, I made a modification on the GUI to make it more user-friendly, initially the program shows up the main window and it's possible to open some other frames where the user can monitor certain devices designed by the company I work for. So when the user wanted to close the hole program and any windows where openend it showed up a dialog asking for the user close the oppened windows himself and then close the program