dllimport

How to use a class in DLL?

别等时光非礼了梦想. 提交于 2019-11-26 11:04:22
问题 Can I put a class inside a DLL? The class i wrote is this: class SDLConsole { public: SDLConsole(); ~SDLConsole(){}; void getInfo(int,int); void initConsole(char*, char*, SDL_Surface*, int, int, int); void sendMsg(char*,int, SDL_Surface*); void cls(SDL_Surface*); private: TTF_Font *font; SDL_Surface *consoleImg; int width, pos, height, line, size, ctLine; SDL_Surface* render(char*,int); }; I know how to load a DLL and use the function inside a DLL, but how can I put a class inside a DLL?

Is there any native DLL export functions viewer? [closed]

China☆狼群 提交于 2019-11-26 10:15:24
问题 Is there any free native Windows DLL export functions viewer, which shows the function name, and a list of their parameters? 回答1: you can use Dependency Walker to view the function name. you can see the function's parameters only if it's decorated. read the following from the FAQ: How do I view the parameter and return types of a function? For most functions, this information is simply not present in the module. The Windows' module file format only provides a single text string to identify

Docking Window inside another Window

大憨熊 提交于 2019-11-26 09:07:46
问题 I have a winform application (.NET 2.0 C#). From this application, I want to start another process (another winform application) and dock it to my window (or at least make it look like it is docked). So far, I can only find information about docking controls, not windows in separate processes. My first thought is to get the handle of the window and use unmanaged system calls to set the height/width and position of the window to my docking area. But before I got started, I wanted to check to

ADODB.Parameters error '800a0e7c' Parameter object is improperly defined. Inconsistent or incomplete information was provided

ε祈祈猫儿з 提交于 2019-11-26 08:36:04
问题 I\'m primarily an PHP developer, but I have some old ASP one of our previous developers made that broke and I can\'t figure out how to fix it. We have a program that sends some variables to a listener page that compares that data to registration codes an msSQL database and then lets the program know if the registration code is valid. I\'m getting the following error where .Parameters.Append .CreateParameter(\"@code\", adVarChar, 1, 50, x) is line 134: ADODB.Parameters error \'800a0e7c\'

DLL load failed when importing PyQt5

馋奶兔 提交于 2019-11-26 06:39:27
问题 I have installed PyQt5 on windows platform and and getting an importError: DLL load failed. I have installed pyqt5 using the command pip3 install pyqt5 Successfully installed pyqt5-5.8.1 My Python version is as follows: Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32 The import Error is as follows: from PyQt5.QtWidgets import QApplication Traceback (most recent call last): File \"<stdin>\", line 1, in <module> ImportError: DLL load

How can I specify a [DllImport] path at runtime?

若如初见. 提交于 2019-11-26 06:10:22
In fact, I got a C++ (working) DLL that I want to import into my C# project to call it's functions. It does work when I specify the full path to the DLL, like this : string str = "C:\\Users\\userName\\AppData\\Local\\myLibFolder\\myDLL.dll"; [DllImport(str, CallingConvention = CallingConvention.Cdecl)] public static extern int DLLFunction(int Number1, int Number2); The problem is that it's gonna be an installable project, so the user's folder will not be the same (ex : pierre, paul, jack, mum, dad, ...) depending computer/session where it'd be runned on. So I'd like my code to be a little more

Embedding unmanaged dll into a managed C# dll

二次信任 提交于 2019-11-26 06:08:18
I have a managed C# dll that uses an unmanaged C++ dll using DLLImport. All is working great. However, I want to embed that unmanaged DLL inside my managed DLL as explain by Microsoft there: http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.dllimportattribute.aspx So I added the unmanaged dll file to my managed dll project, set the property to 'Embedded Resource' and modify the DLLImport to something like: [DllImport("Unmanaged Driver.dll, Wrapper Engine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", CallingConvention = CallingConvention.Winapi

BadImageFormatException when loading 32 bit DLL, target is x86

萝らか妹 提交于 2019-11-26 04:27:55
问题 I have a DLL (FreeType) which is certainly 32-bit (header: IMAGE_FILE_MACHINE_I386). I want to use it from C# code, using DllImport. Target of my application is x86, IntPtr.Size is 4, process is 32-bit. But I get BadImageFormatException (Exception from HRESULT: 0x8007000B). What can be wrong? Of course I use 64-bit Windows 7. 回答1: From what I understand, an assembly specifically built for x86 and running in a 64-bit operating system can only load libraries built for x86 or a

Embedding unmanaged dll into a managed C# dll

荒凉一梦 提交于 2019-11-26 03:26:02
问题 I have a managed C# dll that uses an unmanaged C++ dll using DLLImport. All is working great. However, I want to embed that unmanaged DLL inside my managed DLL as explain by Microsoft there: http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.dllimportattribute.aspx So I added the unmanaged dll file to my managed dll project, set the property to \'Embedded Resource\' and modify the DLLImport to something like: [DllImport(\"Unmanaged Driver.dll, Wrapper

How can I specify a [DllImport] path at runtime?

匆匆过客 提交于 2019-11-26 01:13:08
问题 In fact, I got a C++ (working) DLL that I want to import into my C# project to call it\'s functions. It does work when I specify the full path to the DLL, like this : string str = \"C:\\\\Users\\\\userName\\\\AppData\\\\Local\\\\myLibFolder\\\\myDLL.dll\"; [DllImport(str, CallingConvention = CallingConvention.Cdecl)] public static extern int DLLFunction(int Number1, int Number2); The problem is that it\'s gonna be an installable project, so the user\'s folder will not be the same (ex : pierre