c++-cli

Performance issue while using PictureBox

拥有回忆 提交于 2019-12-13 06:23:02
问题 I'm working on an application in Visual Studio 2010 and I'm coding in C++/CLI. In my previous questions I had issue with data series from a serial port. Now it seems ok and now I'm trying to plot them. I don't want to use Chart , so I would like to use handmade functions that use the class Graphics . In order to test my code, I created two arrays: the first one is filled with values coming from a Gaussian. The second one is filled with random numbers. When I plot the values, I would like to

Calling a native C compiled with VS 2005 from C++/CLI Visual studio 2010 - Cannot open .lib file…

拟墨画扇 提交于 2019-12-13 06:08:13
问题 Hi I want to call functions from a C dll to C++/CLI. The C functions are declared extern. I followed this tutorial for linking the dll: http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/84deabaa-ae82-47cc-aac0-592f5a8dfa22 and then in my C++/CLI dll I have the following: // testWrapper.h #pragma once using namespace System; namespace testWrapper { extern "C" int GtoCalcImpliedVolatility2( double premium, int optionType, double underPrice, double strike, double yearsToExpiry,

CryptAcquireContextA fails in C++ CLR for “Aloaha Cryptographic Provider”

喜欢而已 提交于 2019-12-13 05:18:26
问题 I have C++ CLR project with both managed and unmanaged code. In this project I loop through list of cryptoproviders and search for suitable. So I use functions CryptEnumProvidersA CryptAcquireContextA I have C# project which uses C++ project. When I call the method to loop through list of cryptoproviders twice, my application crashes. And it crashes on CryptAcquireContextA. And only on "Aloaha Cryptographic Provider". When i use debug mode, it also crashes. But when i use debug mode, set

C++/CLI marshaling .NET delegate to native delegate

北战南征 提交于 2019-12-13 05:13:35
问题 I am trying to pass a delegate with managed parameters to native code to be invoked. My code below runs ok, but the string output is garbage. Native Class Header #pragma once typedef void (* SegmentCreatedDelegate)(char** arg); public class SampleClass { public: SampleClass(void); ~SampleClass(void); void DoWork(SegmentCreatedDelegate callback); }; Code SampleClass::SampleClass(void) { } SampleClass::~SampleClass(void) { } void SampleClass::DoWork(SegmentCreatedDelegate callback) { for(int x

How do I check if my DirectShow Renderer filter is being used?

僤鯓⒐⒋嵵緔 提交于 2019-12-13 04:41:12
问题 In my DirectShow project I create a filter (derived from CBaseVideoRenderer ) to render to a block of memory. This works in most cases perfectly well, with me adding the filter mGraphBuilder->AddFilter(pInterfaceInfo, MemoryRendererName); and relying on GraphBuilder to do the rest. However in some cases the graph builder and my filter cannot agree on a common format and it creates a new ActiveMovie window, bypassing my filter. I would like to detect when this occurs so that I know my filter

visual studio 2010 C++, Including windows form recurrly

这一生的挚爱 提交于 2019-12-13 04:37:59
问题 I am using visual studio 2010. I have two windows form that calls each other. Form1 has include Form2 i read that i can not include Form1 in Form2 again. but instead use ref class Form1. but i am getting the following error c:\users\seuntech\documents\visual studio 2010\projects\spl_project\spl_project\Form2.h(85): error C2512: 'spl_project::Form1' : no appropriate default constructor available 1>c:\users\seuntech\documents\visual studio 2010\projects\spl_project\spl_project\Form2.h(86):

How to compile using framework libraries?

别等时光非礼了梦想. 提交于 2019-12-13 04:26:08
问题 I have wrriten a managed code for SMO application.How can i comiled it using .NETFRAMEWORK2.0. i dont wnat to use visulastudio due to certain limitataions. how can i do this. can nay body help me in this regard. msbuild.exe TestMsBuild.sln /:t Rebuild /:p configuration=release gives error as TestMsBuild.sln : Solution file error MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be bu ilt by MSBuild. even though my project is

C++/CLI: how to overload an operator to accept reference types?

十年热恋 提交于 2019-12-13 03:48:32
问题 I am trying to create a CLI value class c_Location with overloaded operators, but I think I have an issue with boxing. I have implemented the operator overloading as seen in many manuals, so I'm sure this must be right. This is my code: value class c_Location { public: double x, y, z; c_Location (double i_x, double i_y, double i_z) : x(i_x), y(i_y), z(i_z) {} c_Location& operator+= (const c_Location& i_locValue) { x += i_locValue.x; y += i_locValue.y; z += i_locValue.z; return *this; } c

How can i copy from a .NET Bitmap all pixels to av_image frame data?

旧时模样 提交于 2019-12-13 03:39:26
问题 I just created a new function in my c++ project using an example with Bitmap lock bits: void GetFrameData(Bitmap ^b) { typedef System::Drawing::Rectangle R; R rect = R(0,0,b->Width,b->Height); System::Drawing::Imaging::BitmapData^ bmpData = b->LockBits( rect, System::Drawing::Imaging::ImageLockMode::ReadWrite, b->PixelFormat ); // Get the address of the first line. IntPtr ptr = bmpData->Scan0; // Declare an array to hold the bytes of the bitmap. // This code is specific to a bitmap with 24

Ternary operator on System::Boolean variable

二次信任 提交于 2019-12-13 03:28:02
问题 How to use ternary operator with System::Boolean? This sample code always returns true: bool Test(Boolean^ value) { return value ? true : false; } 回答1: Your usage of System::Boolean is wrong in the first place and it has nothing to do with ternary operator. Never pass a value types as reference. Regadless of unnecessary penalities, the code in your answer will work but not in C#. The compiler will complain when you want to call bool Test(Boolean^ value) function. Because there is no concept