dll

Let a dll call a .exe function by sending a pointer [duplicate]

百般思念 提交于 2019-12-24 22:31:23
问题 This question already has answers here : letting a DLL call a exe function with function pointer (2 answers) Closed 6 years ago . This question looks like one I asked before, except that I now know that you can't call the main function from a global object. So this code doesn't work with main. But why does it fail with other functions as well? This is the code. .exe main.cpp #include "dll_class.h" #include <iostream> int my_main(void) { std::cout << "Enter the my_main code.\n"; std::getchar()

VB 2010 Assembly doesn't load at startup

ⅰ亾dé卋堺 提交于 2019-12-24 22:23:58
问题 I'm a long-time Delphi programmer that's been handed an older VB app to make compatible with Win7. (I haven't touched any species of basic since the DOS days, so I'm new to VB/VS 2010 - I've taken the beginner DevU trainings, and have a handle on the basics of VB syntax compared to Delphi, but don't have much clue on the vagaries of how VS and .NET put that code together into an app.) The code has worked fine for years under WinXP, but it does some things (registry writes, cfg files stored in

WiX installer project: CefSharp.Core.dll could not be loaded, file not found

眉间皱痕 提交于 2019-12-24 21:55:02
问题 I am working on a windows application on c# visual studio, i have set up a WiX project for the installer and have added CefSharp, CefSharp.Core, CefSharp.Wpf references to it also. However, upon building, it throws an error that the extension '..\packages\CefSharp.Common.57.0.0\CefSharp\x86\CefSharp.Core.dll' could not be loaded because of the following reason: Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies. The specified module could not be found. InstallProj

callback function from unmanaged dll in VB .NET

旧街凉风 提交于 2019-12-24 21:33:35
问题 I'm trying to use an unmanaged dll in VB.NET. The example source code provided with the dll is in VB6 and below is my attempt to convert it to .NET. When the dll tries to do a callback I get a "Attempted to read or write protected memory" exception. I really don't care about the callback function getting actually called. My code: <DllImport("AlertMan.dll")> _ Public Shared Function AlertManC( _ ByVal CallbackAddr As AlertManCallbackDel) As Long End Function Public Delegate Sub

Calling C++ function with LPStr return value from C#

ぐ巨炮叔叔 提交于 2019-12-24 20:53:50
问题 I have a C++ dll in 64-Bit, which contains a function that returns an LPStr . I would like to call this function in C#. The function declaration looks like this: __declspec(dllexport) LPSTR __stdcall function(int16_t error_code); In my C# code I have tried the following: [DllImport(@"<PathToInterface.dll>", EntryPoint = "function")] [return: MarshalAs(UnmanagedType.LPStr)] public static extern string function(Int16 error_code); And then in the program: string ErrorMessage = ""; ErrorMessage =

Where/how to get the MSVC dlls Java 1.8.0_144 wants?

五迷三道 提交于 2019-12-24 20:19:43
问题 I'm experimenting with building my application with Java 1.8.0_144 to workaround an issue that apparently started after that. I run this command to build: gradle jfxNative -Dorg.gradle.java.home="c:\Program Files\Java\jdk1.8.0_144" and it stops with this error: Execution failed for task ':jfxNative'. > Not found MSVC dlls Where and how do I get these MSVC dlls? The full output looks like this: c:\...\>gradle jfxNative -Dorg.gradle.java.home="c:\Program Files\Java\jdk1.8.0_144" > Task

C#: DLL is registered but COM error 80040154 still appear

女生的网名这么多〃 提交于 2019-12-24 19:23:53
问题 When I debug my Windows Form Application I get this error: Retrieving the COM class factory for component with CLSID {27526253-6119-4B38-A1F9-2DC877E72334} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) and because of it, my WFA can't interface with the software Solidworks installed on my computer; the only library that WFA needs to interface with Solidworks is SolidWorks.Interop.sldworks.dll (native position in the

Can I build 2 or more dlls from C# project in Visual Studio 2008?

僤鯓⒐⒋嵵緔 提交于 2019-12-24 19:18:05
问题 Because I'm working on Creating RIA Framework with Silverlight & C#. So I need to use rich features of Silverlight such as dynamic loading. But I found that Visual Studio will merge all class library(same namespace or difference namespace) into one dll. Do you have any idea to build 2 or more dlls from C# project? I just create 1 project for 1 child page. So If I have 100 child pages in my solution, I will create 100+ projects for this solution that doesn't make sense. Thanks 回答1: Just make

Passing an image pointer to a DLL function in python

随声附和 提交于 2019-12-24 19:16:21
问题 I have a camera that has its own DLL library for passing parameters to the camera, and taking images. I am trying to make calls with this DLL library through python. I need to make a pointer for the raw image data, and i'm not exactly sure how to do this. The DLL has a function name and takes those parameters as inputs: StTrg_TakeRawSnapShot(hCamera, pbyteraw, dwBufferSize, dwNumberOfByteTrans, dwFrameNo, dwMilliseconds) hCamera: This parameter sets the camera control handle that obtains by

Resolve Function Address with PE Export Table

∥☆過路亽.° 提交于 2019-12-24 17:48:49
问题 Can anyone explain me how to properly obtain a function address from a PE image and then call that function with a delegate? I found a good piece code googling around that loads exports from a DLL library, but it only get function names out of it... so I modified it as follows: [DllImport("ImageHlp", CallingConvention = CallingConvention.Winapi), SuppressUnmanagedCodeSecurity] public static extern bool MapAndLoad(string imageName, string dllPath, out LOADED_IMAGE loadedImage, bool dotDll,