dll

Call Delphi CLASS exported in DLL from C++ code

。_饼干妹妹 提交于 2021-02-04 21:39:14
问题 i have a problem to use delphi class from C++ code. delphi dll demo that export a function that return an object. my delphi Dll code is as follow: library DelphiTest; // uses part.... type IMyObject = interface procedure DoThis( n: Integer ); function DoThat : PWideChar; end; TMyObject = class(TInterfacedObject,IMyObject) procedure DoThis( n: Integer ); function DoThat: PChar; end; // TMyObject implementation go here ... procedure TMyObject.DoThis( n: Integer ); begin showmessage('you are

Visual C++ methods in vfptr in reverse order

ぐ巨炮叔叔 提交于 2021-02-04 20:57:54
问题 Is there a way to control the order of some classes methods in the vfptr? It seems that Visual C++ 2010 at least puts the method pointers in the declaration order, except for overloaded methods. Below is sample code: enum ENUM { }; class CLASS { virtual void foo1() { }; virtual CLASS& __cdecl operator<<(const ENUM x) { return *this; }; virtual void foo2() { }; virtual CLASS& __cdecl operator<<(const char* x) { return *this; }; virtual CLASS& __cdecl operator<<(int x) { return *this; };

Compiling DLL with Version Information

﹥>﹥吖頭↗ 提交于 2021-02-04 14:48:26
问题 What steps are needed to compile Version Information inside a windows DLL from the command line. I have been looking at VersionInfo files, but could not figure out how to link them to the DLL. Thank you 回答1: You need to create a version resource and add it to your project. This can be very easily done from within visual studio. in VS 2008, right click a folder of the project, choose add and under "Visual C++" select "Resource File" (not resource template), in the resource file just created

Writing a Windows STDCALL DLL with Mingw64 or Cygwin compilers

百般思念 提交于 2021-01-29 20:14:12
问题 I am trying to create a C wrapper DLL to interface a commercial DLL written with the CDECL calling convention, so that it can be interfaced with existing programs written in Excel VBA (hence using STDCALL calling convention). I have exactly the same issue, probably after trying very similar things. I have tried using mingw (gcc & g++, 32 & 64 bits), and cygwin gcc flavors (gcc & g++ 32 & 64 bits). No luck. I suspect an issue with the compilation or linker, as some combinations of compiler

Register a 32-bit COM class for use in 64-bit Python without Administrator rights

女生的网名这么多〃 提交于 2021-01-29 19:38:24
问题 I'm making a Python script that uses SAP's GUI scripting API through win32com. The first usage is like this: from win32com.client import Dispatch objWrapper = Dispatch("SapROTWr.SapROTWrapper") This works fine when using a 32-bit Python interpreter, but not when using a 64-bit interpreter, which gives me a "Class not registered" error. Is there any way to do this, specially without Administrator privileges? The default answer will probably be something like "A 64-bit process can't load a 32

Why do 64-bit DLLs go to System32 and 32-bit DLLs to SysWoW64 on 64-bit Windows?

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-29 17:46:49
问题 I would like to know when do we need to place a file under C:\Windows\System32 or C:\Windows\SysWOW64, on a 64-bits windows system. I had two DLL's, one for 32-bit, one for 64-bit. Logically, I thought I'd place the 32-bit DLL under C:\Windows\System32, and the 64-bit DLL under C:\Windows\SysWOW64. To my surprise, it's the other way around ! The 32 -bit one goes into C:\Windows\SysWOW 64 , and the 64 -bit DLL goes into C:\Windows\System 32 . Very confusing stuff. What's the reason behind this

Generate a DLL which uses protocol-buffers

不问归期 提交于 2021-01-29 11:04:18
问题 I am working on a C++ (VS2017) project that uses a protobuf type I created. However, this project requires a .dll of said protobuf type. The __declspec( dllexport ) in each class declaration are not there by default, and I read online that they can be added by generating the protobuf object with this command line: --cpp_out=dllexport_decl=MY_EXPORT_MACRO:output/directory No one has explained what MY_EXPORT_MACRO is or how to define it. When I first generated my protobuf objects I used the

std::thread increses DLL reference count, which prevents the unloading of the DLL

北城以北 提交于 2021-01-29 04:35:01
问题 I have a windows c++ dll which gets loaded by a third party program. I recently added a thread pool (this one https://github.com/progschj/ThreadPool/blob/master/ThreadPool.h). But now the dll get no longer unloaded when the third party program no longer needs it. The reason is that every thread spawned in the thread pool increases the dll reference count by one. One problem is that I don't know when the third party program no longer needs the dll, so I can't manually shutdown the thread pool

Calling GetProcAddress from VBA always returns null

孤街浪徒 提交于 2021-01-29 03:50:51
问题 I have 64 bit windows 10 with MS Office 64 bit. I am trying to get the VBA for Powerpoint to load and execute a function in a self-written 64 bit windows DLL. To prevent export name mangling I have used extern C: extern "C" { __declspec(dllexport) long jaadd(long a, long b) { return a + b; } } This simple function can be called by a C++ module with no problems: hinstDLL = LoadLibrary(L"D:\\Visual Studio 2017\\Projects\\PopUpDLL\\x64\\Debug\\PopUpDLL.dll"); if (hinstDLL != NULL) { jaadd =

Calling GetProcAddress from VBA always returns null

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-29 03:49:27
问题 I have 64 bit windows 10 with MS Office 64 bit. I am trying to get the VBA for Powerpoint to load and execute a function in a self-written 64 bit windows DLL. To prevent export name mangling I have used extern C: extern "C" { __declspec(dllexport) long jaadd(long a, long b) { return a + b; } } This simple function can be called by a C++ module with no problems: hinstDLL = LoadLibrary(L"D:\\Visual Studio 2017\\Projects\\PopUpDLL\\x64\\Debug\\PopUpDLL.dll"); if (hinstDLL != NULL) { jaadd =