c++-cli

Redirecting data from MFC CArchive to boost::archive::xml_oarchive

这一生的挚爱 提交于 2019-12-12 00:57:01
问题 We are rewriting an old MFC VC++ UI component in C# .NET there are multiple applications involved here which share data using binary serialized files created using CArchive functionality provided by MFC. New requirements only ask us to rewrite UI component without changing anything is current business logic. As a solution for this issue, we are planning to change MFC binary serialization with boost XML serialization so that that same XML serialized data can be processes by C# XML parser and

Creating a vector of a struct in a c++ windows form

被刻印的时光 ゝ 提交于 2019-12-11 21:30:58
问题 I am trying to write a program that uses a global vector of a struct in a c++ windows form. Below is the code. The commented areas are attempts I've made to create a vector. Most of them do not compile. Some of them compile, but the program will not display. I do not understand the nature of this error because I was able to create vectors of structs in command line programs. Any help would be appreciated! #pragma once #include <vector> #include <cliext/vector> namespace student_database {

C++/CLI - XML based active reports

回眸只為那壹抹淺笑 提交于 2019-12-11 20:31:58
问题 This is in continuation to one of my previous queries(active reports in C /CLI). I am accessing an xml-based active report from a C++/CLI application. Is there any way by which I can have a data communication with the active report from C++/CLI, for example, I want to print the managed data present in the C++/CLI application on the details section of the XML report which the application accesses. I don't want to use any c# code. Can it be done? Thanks. 回答1: Sure, ActiveReports can do it.

Console output from thread

被刻印的时光 ゝ 提交于 2019-12-11 19:39:44
问题 I've just started experiencing with thread and can't get some basics. How can i write to Console from thread with interval say 10 msec? So i have a thread class: public ref class SecThr { public: DateTime^ dt; void getdate() { dt= DateTime::Now; Console::WriteLine(dt->Hour+":"+dt->Minute+":"+dt->Second); } }; int main() { Console::WriteLine("Hello!"); SecThr^ thrcl=gcnew SecThr; Thread^ o1=gcnew Thread(gcnew ThreadStart(SecThr,&thrcl::getdate)); } I cannot compile it in my Visual c++ 2010 c++

Text from Textbox covert from String^ to int

二次信任 提交于 2019-12-11 19:24:38
问题 Currently I'm making an application and try to get a value from a textBox and convert it then to an integer for further use. I have the following code: System::String^ maxTTL = textBoxMaxTTL->Text; std::string bla = marshal_as<std::string>(maxTTL); //System string^ to std::string int maxTTL2 = std::atoi(bla.c_str()); It seems that maxTTL2 still got the value of '0'. When I use the stoi argument it throws the following exception: stoi argument out of range. Has somebody an idea to resolve this

active reports in C /CLI

走远了吗. 提交于 2019-12-11 19:18:41
问题 Can we use Active Reports 7.0 in C++/CLI? I have just started using active reports. I tried building a report in C# without any problem. I tried doing the same in C++/CLI, but I am unable to use the Active reports toolbox. And also when running the application, it is giving licensing errors. 回答1: The designer that generates code-based won't work with C++/CLI. You also won't be able to write "script" inside the reports with C++. However, you can design reports as the XML-based reports (rpx)

Calling MASM PROC from C++/CLI in x64 mode yields unexpected performance problems

瘦欲@ 提交于 2019-12-11 18:45:32
问题 This is my first question here... I'm writing an arbitrary precision integer class to be used in C# (64-bit). Currently I'm working on the multiplication routine, using a recursive divide-and-conquer algorithm to break down the multi-bit multiplication into a series of primitive 64-to-128-bit multiplications, the results of which are recombined then by simple addition. In order to get a significant performance boost, I'm writing the code in native x64 C++, embedded in a C++/CLI wrapper to

Section of the code of our c++ DLL crashes wen ran on a Windows 7 SP1

▼魔方 西西 提交于 2019-12-11 18:37:41
问题 I am developing a desktop Air application that uses an Air Native Extension (ANE). The native part of the ANE is composed only by a DLL written partially in C and partially in C++. The app was compiled with Visual Studio 2010 and requires the MSVCR100.DLL and the MSVCP100.DLL to be on the same directory as the application's exe file. The app and DLL work great on many computers but on clean Windows 7 SP1 computers, part of its code makes the DLL crash. I've narrowed down the conflicting code

WinForm Control BeginInvoke/Invoke Issue

孤者浪人 提交于 2019-12-11 17:53:38
问题 I am trying to write a multithreaded WinForm in C++/CLI app using VS2012. I know that only the UI thread can update a control and I have been using delegates and the invoke methods. However, I have run into a memory access issue when using BeginInvoke that I do not see when using Invoke. Delegate Function: public: delegate void pictureboxShowDelegate(int tChannelNumber,System::Windows::Forms::PictureBox^,System::Drawing::Bitmap^ colorImage); Called Function: void DrawCVImageShow(int

Where is this managed object stored?

给你一囗甜甜゛ 提交于 2019-12-11 17:52:08
问题 value class ValBase { public: int a; }; ref class RefBase { public: int a; }; int main(array<System::String ^> ^args) { RefBase^ RefBase1 = gcnew RefBase; //LEGAL. Ref type Managed Obj created on CLR heap. ValBase^ ValBase1 = gcnew ValBase; //LEGAL. Value type Managed Obj created on CLR heap. RefBase* RefBase2 = new RefBase; //ILLEGAL: new cannot be used on Managed Ref Class ValBase* ValBase2 = new ValBase; //This compiles okay but where is this "Managed Object" stored ? CLR heap or Native