c++-cli

How to embed a DLL within a C++/CLI executable?

安稳与你 提交于 2019-12-24 11:04:59
问题 I'm on a C++/CLI project, and I'm trying to embed some DLL files (WPF custom control library) within my executable to avoid having over 9000 DLLs in the same folder. There is a lot of information about embedding a C++/CLI DLL in a C# project (moreover, it is very simple), but the documentation about the reverse seems to be poor. The closest solution I have found is here: Embedding resource in a C++/CLI project, but unfortunately I can't see my WPFWidget.dll in resources when I open the .exe

va_arg prevents me from calling a managed delegate in a native callback

左心房为你撑大大i 提交于 2019-12-24 10:39:11
问题 In a C++/CLI assembly, I'm trying to call a managed delegate from a native callback. I followed Doc Brown's answer here, and my implementation so far looks like this: The native callback - ignore the commented out parts for now: static ssize_t idaapi idb_callback(void* user_data, int notification_code, va_list va) { switch (notification_code) { case idb_event::byte_patched: { //ea_t address = va_arg(va, ea_t); //uint32 old_value = va_arg(va, uint32); return IdaEvents::BytePatched(0, 0); }

Proper Object Disposal In C++/CLI

自古美人都是妖i 提交于 2019-12-24 10:00:18
问题 Consider the following class: public ref class Workspace { protected: Form^ WorkspaceUI; SplitContainer^ WorkspaceSplitter; AvalonEditTextEditor^ TextEditor; ScriptOffsetViewer^ OffsetViewer; SimpleTextViewer^ PreprocessedTextViewer; ListView^ MessageList; ListView^ FindList; ListView^ BookmarkList; ListView^ VariableIndexList; TextBox^ VariableIndexEditBox; Label^ SpoilerText; ToolStrip^ WorkspaceMainToolBar; ToolStripButton^ ToolBarNewScript; ToolStripButton^ ToolBarOpenScript;

Translate MSDN example from C# to C++/CLI

大城市里の小女人 提交于 2019-12-24 09:58:55
问题 this is a code sample from Microsoft(MSDN) (build sql dependency application) , could you please help me translate this code from c# into C++/CLI, I've been trying I, but I'm not really good in c++. private void dependency_OnChange( object sender, SqlNotificationEventArgs e) { // This event will occur on a thread pool thread. // Updating the UI from a worker thread is not permitted. // The following code checks to see if it is safe to // update the UI. ISynchronizeInvoke i =

C++/CLI: Embedding MFC into WinForm

限于喜欢 提交于 2019-12-24 09:29:51
问题 Hello, Since a few weeks, we are trying to "transform" a MFC dialog into a "MFC form" which can be embedded into a WinForm User Control. We've succeeded to do that: We made a WinForm User Control, called Dlg_WU_MFC_Container When created, the UC creates the MFC form called CDlgEdgeType Then, every time the UC is resized or moved, we also move and resize the MFC form Here is the code (I tried to remove a lot of unnecessary stuff..): Dlg_WU_MFC_Container.h: #pragma once public ref class Dlg_WU

C++/CLI Thread synchronization including managed and unmanaged code

心已入冬 提交于 2019-12-24 05:39:06
问题 I am working on a wrapper class for an unmanaged algorithm class. I've come to a point where I need separate threads for the processing and on-the-fly display of the results. I have a single method in my unmanaged class that does the work(I don't think I can change that). Inside it there is a main loop. My plan was to enable drawing the results at the end of each iteration. I wanted to use System::Threading::Monitor methods to perform the synchronization. However they require a managed

Native C++ use C# dll via proxy C++ managed dll

百般思念 提交于 2019-12-24 04:45:26
问题 This is rather convoluted, so bear with me. I have a 3rd party program (the "target") that is coded in Native (Win32 only) C++. As part of the target's design, it implements a dll-plugin system. Native DLLs, when placed in the "ext" directory of the program, are loaded by the target. The target then invokes four methods that each DLL provides (Initialize, SendHook, RecvHook, Terminate) as appropriate. As you may have guessed from the function names, the add-ins hook certain functions in the

Cannot understand relationship between normal c++ vs vc++, win32 programming, mfc, win32 api, CLI [closed]

早过忘川 提交于 2019-12-24 04:41:00
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . What is the mfc, cli and win32? Can you please help me understand how visual studio works in relationship with these 2? what is the diff between c++ and vc++? When we say "vc++" does it imply the dialog boxes,

Fixed Size Byte Array

与世无争的帅哥 提交于 2019-12-24 04:00:15
问题 public : array<Byte>^ Foo(array<Byte>^ data) gets dynamic size managed array but how can I get fixed size managed byte array? I wanna force C# user to send me 8 byte array; and get 8 bytes back style: public : Byte[8] Foo(Byte[8] data) EDIT: can any1 explain why its impossbile in safe context? 回答1: C# does not allow you to do that. You'll simply have to validate the array's length and maybe throw an exception if the length is not 8. Also, the type of your function can't be Byte[8] ; you'll

Importing C# dll to C++ managed code (.NET)

↘锁芯ラ 提交于 2019-12-24 03:27:06
问题 I'm using Visual Studio 2010. I've written a dll in C#, managed dll then. Now for some reason, I need to write a software in C++ (.NET then also managed). I need to import the C# dll into my C++ .NET code. I can't figure out to do this, I've made several search but this problem seems to not be covered. For example, in C# I don't have include file, then how my C++ (.NET) projet knows about classes and functions inside the dll? Thanks, 回答1: In Visual Studio, bring up the properties of the C++