dll

using uDMX API in c#

陌路散爱 提交于 2020-01-25 08:05:46
问题 I am relative new in c# and I want to use this uDMX API, but when I try to add the uDMX.dll file I get this error: "The reference is not vaild or not supported" (see screenshot (in german)) - I can't add images yet - Or am I doing it completely wrong? I did not find another uDMX api or .dll file. Hope for your help and Ideas. 回答1: You cant import an unmanaged win32 dll into a managed c# application like that, you need to specify the methods and parameters yourself. The uDMX api exposes these

C string through dll boundaries

不想你离开。 提交于 2020-01-25 07:50:10
问题 We need to return a C string through dll boundaries in a safe way! How can we do this? My idea: extern "C" __declspec(dllexport) const char *const Api { ... static const char *output = result.c_str(); return output; } 回答1: A pointer is being returned in your example code, but the memory region it is pointing to is probably not staying resident. If the result variable (std::string?) is on the stack, it's going to be destroyed when the function returns and the returned pointer will be dangling

Accessing DLLs through VBA

大城市里の小女人 提交于 2020-01-25 07:22:07
问题 How can I access the functions inside a third-party DLL from VBA (Excel)? Also, is there a way to see what all functions are available inside a DLL? 回答1: To call a function in a third-party DLL, you need to use the Declare statement. For example: Private Declare Function GetTempPath Lib "kernel32" _ Alias "GetTempPathA" (ByVal nBufferLength As Long, _ ByVal lpBuffer As String) As Long See How to: Access DLLs in Excel on MSDN for more information. To list the functions that are available, take

Calling DLL Functions under a namespace in RAD Studio

人盡茶涼 提交于 2020-01-25 06:49:09
问题 I'm new to using RAD Studio as I currently have to use it for this current project. What I am trying to do is call functions defined in a DLL file which I generated in Visual Studio in a RAD Studio C++ project . Following the advice from this question below Using Visual Studio DLL in Embarcadero RAD Studio XE? I have converted the C++ DLL file I have generated from Visual Studio to a supported file for RAD studio using their command: mkexp pub-sub-sample.a pub-sub-sample.dll I can verify that

Calling a class defined function from a DLL file C++

孤人 提交于 2020-01-25 06:47:09
问题 I've built an example project from the Amazon IoT Device SDK which is the PubSub Sample project from the examples folder. I've had to output the project as a DLL file so that the sample can be used in RAD studio, which I have been able to build successfully. Using the tutorials from generating a DLL, I've added in the __declspec(dllexport) line to the function definitions in the class. PubSub.hpp file #ifdef PUBSNUB_EXPORTS #define PUBSNUB_API __declspec(dllexport) #else #define PUBSNUB_API _

Using “C” dll in C# [duplicate]

老子叫甜甜 提交于 2020-01-25 04:34:28
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How do I call unmanaged C/C++ code from a C# ASP.NET webpage I have a dll file that is written in "C" language, i want to use it in C#. How can i do that? 回答1: You can use PInvoke Platform Invocation Services (PInvoke) allows managed code to call unmanaged functions that are implemented in a DLL. Here is a great tutorial by the NAG (Numerical Algorithms Group) group 回答2: You can do a DllImport in your C# code

Force application to run with optional DLL

那年仲夏 提交于 2020-01-25 03:39:50
问题 I have made desktop application. I have make class library and then make its DLL from University assembly. Now i want to make library DLL optional. In short i want to run the application weather or not library DLL is refereed. Right now if i remove reference of library DLL then it gives error on library methods that they are not defined. I want this application to run with oujt giving error of library method. I have search on google but i am unable to find out any reliable answer. 回答1: Check

dll to main program communication

房东的猫 提交于 2020-01-25 02:24:05
问题 I want to trace some text from dll module to a main program window (to a log subwindow). How can I do this correctly? (through kernel primitives, via sending messages from window to window, passing callback interfaces?) The working example I've seen: Matlab and Octave. When calling mexPrintf then output printed in their main windows. 回答1: Your main program should export a logging function and make it known to the DLL. Your DLL needs to export a function, such as InitLogging, that takes a

dll to main program communication

给你一囗甜甜゛ 提交于 2020-01-25 02:23:45
问题 I want to trace some text from dll module to a main program window (to a log subwindow). How can I do this correctly? (through kernel primitives, via sending messages from window to window, passing callback interfaces?) The working example I've seen: Matlab and Octave. When calling mexPrintf then output printed in their main windows. 回答1: Your main program should export a logging function and make it known to the DLL. Your DLL needs to export a function, such as InitLogging, that takes a

COMMAND AND UPDATE_COMMAND_UI handlers not called in MFC dll

烂漫一生 提交于 2020-01-25 00:45:31
问题 I have ON_COMMAND and ON_UPDATE_COMMAND_UI handlers for menu items in an MFC dll. But they are not invoked. The same code compiled as .exe has the handlers being invoked. What could be the reason for this? 回答1: ON_UPDATE_COMMAND_UI and ON_COMMAND handler are only called when the object that contains the handler is within the command routing. So the DLL itself isn't the problem but also this depends on how you created your DLL. For a standard DLL and without sharing the MFC as a DLL this will