c++-cli

Calling a Visual Basic DLL in C++, Part 2

This question is a follow up to a previous question (here). I have acquired a DLL that was created in Visual Basic from a third party vendor(Sensor DLL.dll). This DLL contains functions for talking to a sensor, and I need to call these functions from a Visual C++ program I am writing. The vendor will not provide a header file, and I d...

mean absolute difference method for video stabilisation project in C++/CLI

Hello, I try to implement video stabilization project in C++/cli.First of all I have bmp image sequences,and I found motion vectors that show how much specific pixel region move between each image frame . For example I have 256*256 image, I selected 200*200 region in first image frame and secong image frame.And I found how much pixel m...

C++ native Vs C++/Cli Performance ( for OpenCV project)

We're developing a project that uses OpenCV library to track hand gestures and motion sensing. I'm confused whether to go for native c++ program or to use C++/CLI provided in .NET (VC++). Performance is of utmost importance and heavy image processing is required. since we're planning to use the OpenCV extensive methods and the project r...

In the VS2008 vcproj file how important are the ProjectGUID and the UniqueIdentifier?

I have copy and pasted entire C++/CLI projects and been able to run them without any trouble as long as the relative paths to assemblies, headers, and libs remain the same. In each one of these copied projects the vcproj files are exactly the same (as one would hope). I have been doing this so that we can use one project as a template ...

cli/C++ how to define cli::array with unmanaged type element?

I have a native C/C++ struct typedef struct { ... } AStruct; and in C++/CLI code i define one delegate and one cli array as following public delegate void UpdateDataDelegate(AStruct% aSt,AStruct% bSt); cli::Array<AStruct>^ args=gcnew cli::Array<AStruct>(2); // complile failed!!!!。 this->Invoke(updateData,args); AStruct has many f...

Visual Studio 2010 managed c++ targets .NET 2.0 PROBLEM

For someone who's been down this road, please share your breadcrumbs. I have old VS2005 solution. Most of the parts are c# but I have one c++ managed project. Dev machine: Windows XP. Target framework version: 2.0 I moved the project to the Windows 7 64 BIT, VS 2010, did the project conversion. First thing I noticed were build erro...

call a delegate from click event using C++/CLI

Hello, In C#, We can call a new function from button click with arguments like this, ////My function public static void Method1(int x) { Console.WriteLine("Method 1"); } and set this function on click event of a command button like this, button1.Click += delegate { mydelegate with argument }; Eg: delegate v...

How can I check whether a control has an event?

Hello, I have a combo box and I need to add an event to that combo box using C++/CLI. eg: pComboBox->DropDownOpened += gcnew EventHandler( pFunctor, &Functor::Handler ); But before adding this event, I need to check if this event is added, If it is, how can i remove the existing event? ...

Native namespace exported in C++/CLI project?

I am wrapping a native C++ library for consumption by the CLR. However, I'm running into a strange... problem? The native library's headers look like so: namespace Foo { class Bar { public: Bar(); //etc... }; } So, to consume this class, I have my own class definition: #include "Foo/Bar.h" namespace Fo...

How to awake and enable clients of .NET Remoting server for fetch data asynchronously?

Hello, I need to perform inter process communication using .NET Remoting. For this I would share some data in form of Data(Objects) & Methods . Is there any way out by which my .NET Remoting client can detect that there's some data that is being shared or not, if its just go on and collect that data.Each time server server shares the d...

Produce SoapHeader with only one node/tag inside for C++

I have researched all MSDN information on SoapHeaders and have built the solution the way Microsoft says to. That actually happens to be my problem. What they suggest is that you create a class derived from the SoapHeader class and include a string member to hold the value for the header. The problem is that the SoapHeader class crea...

Redirect stdout to Visual Studio output window from native c++ dll

I have a c# windows app that calls a managed c++ dll, which, in turn, calls a native c++ dll. There seem to be some performance issues in the native c++ code, so I'm doing some simple profiling. I'd like to dump the results of the profiling so that the Visual Studio output window picks it up. I thought that printf would do the trick, but...

How to use arguments?

Hi, I have two file generated in visual studio c++ 2010 express. test2.cpp // test2.cpp : main project file. #include "stdafx.h" #include "Form1.h" using namespace test2; [STAThreadAttribute] int main(array<System::String ^> ^args) { // Enabling Windows XP visual effects before any controls are created Application::EnableVisualStyl...

How to get answer from messagebox

I copy if ((MessageBox::Show( "Are you sure that you would like to close the form?", "Form Closing", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == DialogResult::No)) { // cancel the closure of the form. Application::Exit(); } From msdn. Where I compiling this i have 1>------ Build started: P...

Unable to get ImageMagick .Net working with Asp.Net 4.0.

I have downloaded the ImageMagick.Net source code from Codeplex and compiled using Visual Studio 2010. It builds but when I use the generated ImageMagickNET.dll into my Asp.Net 4.0 application I get the following error. External component has thrown an exception. Description: An unhandled exception occurred during the execution of the ...

calling native function pointer in c++/cli

Hi all, this is my first post. I have a native function inside a managed (c++/cli) mixed-mode library that calls a seperate native dll. Here is the native function that initializes some function pointers using windows GetProcAdress: //in header static HMODULE hDll; static void (*MYDLL_Func1)(void*); static void (*MYDLL_Func2)(void); ...

Best practice of sending array from native code to managed code(C++/CLI)?

I'm writing a win32 dll for read/write USB HID device. The data for exchange is a 64 byte unsigned char array. The client program is written in C++/CLI. In order to achieve max speed and minimum overhead, I need an efficient way to sending the array to managed client. There are two options I can think of right now: Native: use PostMe...

What is the safe way to call Debug.Assert from C++ CLI?

This blog does not recommend it: http://blog.kalmbachnet.de/?postid=78 But I want to do it anyway. I suppose I need to wrap my Debug.Assert with some sort of #if or #ifdef or something like that. Also, does anyone have a good example of a Debug.Assert in C++ CLI? Suppose I have the following variable: String^ validationError = bldError...

How to read the C++ CLI .obj files (result of compilation of a single file).

I have a small (<300 lines) C++ file in a C++ CLI project in Visual Studio 2010. I have crafted some macros which do different things depending on the Debug/Release configurations. I would like to be able to look at the resulting .obj files (when I compile in Debug and Release) and be able to compare the two. The hard part is that files...

How do I programmatically change a .lnk to change its target?

Is there any way to open a windows shortcut (.lnk file) and change it's target? I found the following snippet which allows me to find the current target, but it's a read-only property: Shell32::Shell^ shl = gcnew Shell32::Shell(); String^ shortcutPos = "C:\\some\\path\\to\\my\\link.lnk"; String^ lnkPath = System::IO::Path::GetFullPath(s...