dll

How to hide member variables in a dll-exported class

邮差的信 提交于 2020-05-13 18:13:32
问题 I'd like to export a class with 1024 bytes in a dll file. class __declspec(dllexport) ExportedClass { private: char Data[1024]; // Holding 1024 bytes. public: void Foo(); }; So, when I give this header file of the class to my clients, I'd like to hide its member variable, char Data[1024] in this case. class __declspec(dllimport) ExportedClass { private: // char Data[1024]; // You don't have to know. public: void Foo(); }; However without the difinition of the Data, there is no allocation of

How to hide member variables in a dll-exported class

假装没事ソ 提交于 2020-05-13 18:12:09
问题 I'd like to export a class with 1024 bytes in a dll file. class __declspec(dllexport) ExportedClass { private: char Data[1024]; // Holding 1024 bytes. public: void Foo(); }; So, when I give this header file of the class to my clients, I'd like to hide its member variable, char Data[1024] in this case. class __declspec(dllimport) ExportedClass { private: // char Data[1024]; // You don't have to know. public: void Foo(); }; However without the difinition of the Data, there is no allocation of

How do you return an struct or class from a .NET COM dll to a consuming VB6 application?

ε祈祈猫儿з 提交于 2020-05-13 08:04:13
问题 This seems like something that would be easy to find on here, but if this has been asked before, I don't see where. Basically, I'm a.NET developer and am having to work with VB6 for a minute and learn about making a COM DLL. I'm working in C# and am trying to get a COM DLL made in that language to return a custom class/struct to some VB6 code, and though the answer here was easy enough to use when returning a string or int from the COM method, I'm having trouble getting it to work with an

.NET dll hot swap, no application restart

与世无争的帅哥 提交于 2020-05-12 11:27:42
问题 Suppose that you have the following situation in .NET (C#): namespace MyDll { public class MyClass { public string GetValue() { return "wrong value"; } } } this code goes compiled into a dll say, MyDll.Dll. Then you have an application called MyApplication.exe that, using MyDll.dll as reference, creates an instance of the class MyClass and calls the method GetValue: MyClass instance = new MyClass(); instance.GetValue(); Once you realize that the current implementation of MyClass.GetValue() is

How can I add WPF items into a c# class library project in VS2019

夙愿已清 提交于 2020-05-11 07:36:33
问题 I have started a Class library project in Visual Studio 2019 and now wish to add WPF items (Window, user control, custom control) into it, but the 'Add Item' dialogue box doesn't list anything under the WPF section. I have come across this problem in previous versions of VS and managed to get round it by adding the element into the csproj file with the relevant WPF guids, however that doesn't appear to work with the new VS2019 stripped down csproj file, or I don't know where to find the

Can't reference a library project (DLL) because .lib file is missing

雨燕双飞 提交于 2020-05-11 05:37:05
问题 I'm trying to start a C++ game engine project. I don't have much knowledge of dll's and lib's but figured the engine itself would be a dll and I would have separate dll projects such as renderer, input, etc that would be used by the engine and the engine dll would be used by the game. I seem to have the engine project referenced fine in the demo.exe project(by adding a reference and adding the path to additional include directories) but when trying to add a reference to a renderer dll project

SQLConfigDataSource does not add System DSN for 64-bit drivers

妖精的绣舞 提交于 2020-05-09 07:18:11
问题 I load the odbccp32.dll from System32 and even tried to use from SysWow64 . I use SQLConfigDataSource function to configure my System DSN for specified Driver. This function successfully configure drivers which are 32-bit, but does not do the same for 64-bit drivers. Does this dll only works for drivers which are 32-bit? When I ran ODBC Administrator tool (64-bit) I am able to see the 64-bit drivers and add them manually to System DSN, but I cannot do this using this DLL . 回答1: Only 64-bit

SQLConfigDataSource does not add System DSN for 64-bit drivers

雨燕双飞 提交于 2020-05-09 07:16:30
问题 I load the odbccp32.dll from System32 and even tried to use from SysWow64 . I use SQLConfigDataSource function to configure my System DSN for specified Driver. This function successfully configure drivers which are 32-bit, but does not do the same for 64-bit drivers. Does this dll only works for drivers which are 32-bit? When I ran ODBC Administrator tool (64-bit) I am able to see the 64-bit drivers and add them manually to System DSN, but I cannot do this using this DLL . 回答1: Only 64-bit

DLL Injection with CreateRemoteThread

寵の児 提交于 2020-04-29 06:15:09
问题 If you take a look at the following working code of a simple DLL injection: //Open the target process with read , write and execute priviledges Process = OpenProcess(PROCESS_CREATE_THREAD|PROCESS_QUERY_INFORMATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_VM_OPERATION, FALSE, ID); //Get the address of LoadLibraryA LoadLibrary = (LPVOID)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA"); // Allocate space in the process for our DLL Memory = (LPVOID)VirtualAllocEx(Process, NULL,

Unable to run qt-creator executable outside ide compiled in release mode

旧街凉风 提交于 2020-04-18 05:42:38
问题 After switch to release mode to build a small project I have, when I try run it from inside the qt-creator ide, all goes fine. But when I go to the folder build-<project_name>-Desktop_Qt_5_14_1_MinGW_64_bit- Release and try run the executable generated in this directory, I got this error: Anyone knows what the problem here? If it was some missing dll, I supose it will specify what dll was missing, right? Or I am mistaken? update After run windeployqt , this command found dependencies for my