dll

Calling C# dll from C++

别说谁变了你拦得住时间么 提交于 2020-02-16 05:22:41
问题 I have a native C++ DLL, and I want to import a C# DLL and use some of its functions (for example connecting to a database). Now I have read that you can turn the DLL into a TLB COM file, and I have done that no problems. My problem lies with the C++. To call that TLB file I need to set CLR support. I use themida to help secure all my DLL's as well as PEC. They do not support .net DLL's and when I enable CLR the programs recognize it as a .net DLL. Is there anyway to call a c# function inside

Accessing classes that are in another DLL?

北城以北 提交于 2020-02-15 10:05:57
问题 Is there is a way of exporting and using classes from another dll, I have 2 dll's and I am trying to access classes in between, was wondering if this is possible. 回答1: There are a variety of ways to achieve this, including but not limited to the following: Use runtime packages rather than DLLs. Then you can use any types, variables, etc. from another module. Note that this forces you to use runtime packages in all of your modules, and to compile all of the modules with the same version of

Hooking into an “OnLoad” for class library

荒凉一梦 提交于 2020-02-11 08:26:47
问题 Does anyone know if there's a way to hook into an "OnLoad" event to run some operations when an assembly loads? Specifically, I am creating a plug-in for an application. The plug-in's DLL gets loaded and objects start being used, but the problem is I need to load another assembly dynamically before anything happens. This assembly can't be copied to the application's directory and must remain invisible to it. 回答1: You need to hook on to AssemblyLoad event. Refer- http://msdn.microsoft.com/en

C DLL crack when called from Python

ε祈祈猫儿з 提交于 2020-02-07 02:01:07
问题 I've a DLL that embeds Python interpreter using the C/Python API. The DLL works fine if called one time, but if the DLL is called twice, the code cracks and my program catch memory error. The C code calling DLL is simple and the call to DLL function(Which calls Python interpreter) is done one time, if the second call(In the code) is not commented the code cracks and this happens only if "Numpy" is called in the Python code. #include <stdio.h> #include <conio.h> #include <math.h> #include <dll

Access Violation in LogonUserW in Python 3

旧时模样 提交于 2020-02-06 07:49:37
问题 I am writing a Python3 script for someone, that utilizes the advapi dll and its LogonUserW function via ctypes. When running the code in the __init__ function dll_location = find_library("advapi32"); if (dll_location == None): raise FileNotFoundError adv_dll = WinDLL(dll_location); #gets the pointer to the function logonUser = adv_dll.LogonUserW; self.logonUser = logonUser In login(username, domain, password) function #Sets the parameters to call the DLL loginType = DWORD(2) loginProvider =

Access Violation in LogonUserW in Python 3

北城余情 提交于 2020-02-06 07:49:13
问题 I am writing a Python3 script for someone, that utilizes the advapi dll and its LogonUserW function via ctypes. When running the code in the __init__ function dll_location = find_library("advapi32"); if (dll_location == None): raise FileNotFoundError adv_dll = WinDLL(dll_location); #gets the pointer to the function logonUser = adv_dll.LogonUserW; self.logonUser = logonUser In login(username, domain, password) function #Sets the parameters to call the DLL loginType = DWORD(2) loginProvider =

.NET exe not picking dll dependencies

删除回忆录丶 提交于 2020-02-05 05:23:05
问题 I have developed an EXE again :) The problem is it has refernces of SQLite dll file so I included the file on the same path. Now in Windows 8 it is running fine, but in Windows 7 it is not The error is System.IO.FileLoadException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.90.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application

Get string return value from C DLL in Delphi

拜拜、爱过 提交于 2020-02-03 08:52:31
问题 I have a legacy DLL written in C that contains a function that returns a string, and I need to access this function from Delphi. The only info I have about the DLL is the VB declare for accessing the function: Public Declare Function DecryptStr Lib "strlib" (Str As String) As String I've tried the following without success: Declaration: function DecryptStr(s: PChar): PChar; cdecl; external 'strlib.dll'; Usage: var p1, p2 : pchar; begin GetMem( p1, 255 ); StrPCopy( p2, 'some string to decrypt'

Get string return value from C DLL in Delphi

余生长醉 提交于 2020-02-03 08:51:07
问题 I have a legacy DLL written in C that contains a function that returns a string, and I need to access this function from Delphi. The only info I have about the DLL is the VB declare for accessing the function: Public Declare Function DecryptStr Lib "strlib" (Str As String) As String I've tried the following without success: Declaration: function DecryptStr(s: PChar): PChar; cdecl; external 'strlib.dll'; Usage: var p1, p2 : pchar; begin GetMem( p1, 255 ); StrPCopy( p2, 'some string to decrypt'

Configure CMake in windows to use clang from command line to get modern OpenMP support

末鹿安然 提交于 2020-02-03 04:07:45
问题 I have a small test project that uses OpenMP for parallelization. My target is to compile it so it produces .dll and .lib for libraries (because my real project links to external libraries distributed using these types), with support for OpenMP 4.5 or newer and do it from the command line so it can be done on a docker for testing and checking (the docker part is out of the scope of this question, it is just for reference on why I need it to work from the command line). I can compile this