dll

in vb6, how do I retrieve a char* parameter from a C dll?

对着背影说爱祢 提交于 2020-01-24 12:04:30
问题 I am calling a C dll from my VB6 application. The dll has a function call signature as follows. void WINAPI geterrstr(char* foo); where foo is a string that has to be returned. In my VB6 application, I have tried calling my dll by using the following syntax, but it returns an empty string. Declare Sub geterrstr Lib "technopnp.dll" (ByRef lpbuffer As String) Any ideas? 回答1: You should be able to; Declare Sub geterrstr Lib "technopnp.dll" (ByVal lpbuffer As String) ... dim buff as string buff

Reference a big DLL for a single method

和自甴很熟 提交于 2020-01-24 06:25:06
问题 I want to use a single method from a big Class library-dll in C#. Are there any drawbacks of performance or anything else? Should I "read" the method code with reflection tool and copy-paste it to my project? Update: The hard disk space isn't an issue. My application is web app. 回答1: Are there any drawbacks of performance or anything else? The only one that is actually important is the size of your distributable, if it matters to you. (Users downloading a 30 MB file instead of a 2 MB one).

How to handle destructors in DLL exported interfaces

≯℡__Kan透↙ 提交于 2020-01-23 12:29:09
问题 I'm trying to export a class from a DLL. I read this article on doing so: http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL The "mature" approach suggest, that an abstract class is used, so I have: // Header class IFoo{ public: virtual int getBar() = 0; } class Foo: public IFoo {...} DLLEXPORT IFoo* Create(); DLLEXPRT void Free(IFoo* inst); //DLL cpp IFoo* Create(){ return new Foo; } void Free(IFoo* inst){ delete inst; } What puzzles me: If I don't have a virtual

How to best tell CMake where to find dll

梦想与她 提交于 2020-01-23 02:42:08
问题 I have a simple project structure derived from the amazing tutorial https://rix0r.nl/blog/2015/08/13/cmake-guide/ It looks as follows: - src - CMakeLists.txt - mylib - include/mylib/mylibclass.h - src/mylibclass.cpp - CMakeLists.txt - myapp - src/myapp.cpp - CMakeLists.txt The top level CMakeLists.txt contains: cmake_minimum_required( VERSION 3.6 ) project( sample_project VERSION 0.1 LANGUAGES CXX ) set( BUILD_SHARED_LIBS ON CACHE BOOL "" ) add_subdirectory( mylib ) add_subdirectory( myapp )

CRT initialization and DLLMain

て烟熏妆下的殇ゞ 提交于 2020-01-23 01:35:23
问题 Quotes: From the document "Best Practices for Creating DLLs" http://download.microsoft.com/download/a/f/7/af7777e5-7dcd-4800-8a0a-b18336565f5b/DLL_bestprac.doc of Microsoft: "DLLs often have complex interdependencies that implicitly define the order in which they must be loaded. The library loader efficiently analyzes these dependencies, calculates the correct load order, and loads the DLLs in that order." [1] "(within DLLMain) Use the memory management function from the dynamic C Run- Time

How to pass argument by reference from MQL4 to C++ DLL

折月煮酒 提交于 2020-01-22 20:17:28
问题 I am trying to write a simple program in MQL4 which passes a variable to a C++ DLL function by reference and prints the updated variable value in MQL4. Given below is my code. DLL function: void Test(int* X) { *X = 6; } MQL4 Code #import "Test.dll" void Test(int&); #import void OnStart() { int A; Test(A); Alert(A); } But I am not getting any value back from C++ function for variable A. Can someone please help me what I am doing wrong here? Thanks in advance 回答1: Let's start with the DLL-side:

Unexplained crashes related to ntdll.dll

喜你入骨 提交于 2020-01-22 20:11:46
问题 I have an application that I've written that crashes intermittently, but I'm unable to capture an exception at the application layer. I always get an entry in the event log but doesn't give me much info: Faulting application name: BCS-UI.exe, version: 1.0.11.0, time stamp: 0x5c0edcbd Faulting module name: ntdll.dll, version: 10.0.17134.376, time stamp: 0x4358e406 Exception code: 0xc0000374 Fault offset: 0x000d8829 Faulting process id: 0x39b0 Faulting application start time: 0x01d49161c80079a0

Unexplained crashes related to ntdll.dll

旧巷老猫 提交于 2020-01-22 20:11:25
问题 I have an application that I've written that crashes intermittently, but I'm unable to capture an exception at the application layer. I always get an entry in the event log but doesn't give me much info: Faulting application name: BCS-UI.exe, version: 1.0.11.0, time stamp: 0x5c0edcbd Faulting module name: ntdll.dll, version: 10.0.17134.376, time stamp: 0x4358e406 Exception code: 0xc0000374 Fault offset: 0x000d8829 Faulting process id: 0x39b0 Faulting application start time: 0x01d49161c80079a0

Update DLL reference

雨燕双飞 提交于 2020-01-22 13:08:06
问题 I wanted to update some DLLs used in my .NET project to the latest version and I've noticed that, if I replace the DLLs on the file system with their new versions, VS 2012 updates the DLL version number in the Properties window. Is this some new feature of VS 2012? I don't remember seeing it in VS 2010 (I expected it would need more manual handling). Is this working right, or should I remove and re-add the DLLs manually from the references, just to be sure? Anyway, my project compiles and

Add Reference is missing in Visual Studio when using with Unity 3D - Need Npgsql.dll

馋奶兔 提交于 2020-01-22 11:08:27
问题 I installed Unity 2017 with Visual Studio 2017. I am attempting to add an external DLL to the Visual Studio project through the solution explorer. When I right click on References, the "Add Reference" option is completely missing! I'm trying to use NpgSQL. Hence, the need to add npgsql.dll. Can anyone give light? 回答1: The Add Reference... is in a different place in this case. Things to do in Unity: Create a folder named Plugins as a child to your Assets folder. (Assets\Plugins...) Next copy