Click here to Skip to main content
15,884,472 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionSecurity issue Pin
xiwangxin23-Mar-09 22:26
xiwangxin23-Mar-09 22:26 
QuestionPause button..... Pin
Thilek23-Mar-09 4:30
Thilek23-Mar-09 4:30 
QuestionIs this a Managed CLI question? [modified] Pin
led mike23-Mar-09 5:06
led mike23-Mar-09 5:06 
AnswerRe: Is this a Managed CLI question? Pin
Thilek23-Mar-09 5:56
Thilek23-Mar-09 5:56 
GeneralRe: Is this a Managed CLI question? Pin
led mike23-Mar-09 5:58
led mike23-Mar-09 5:58 
AnswerRe: Is this a Managed CLI question? Pin
Thilek24-Mar-09 23:37
Thilek24-Mar-09 23:37 
GeneralRe: Is this a Managed CLI question? Pin
Sci_fie26-Mar-09 6:45
Sci_fie26-Mar-09 6:45 
Questionhow to use #pragma data_seq Pin
ernst2002053020-Mar-09 8:36
ernst2002053020-Mar-09 8:36 
I should write a Windows32 form, in which I can input Unicode. When I create multiple instances of application.all the form must display some content, and When I change the content, the content in all instances must change according to the changed Unicode.
Now I can get the content of input, but how can I put the value into the variable in commen memory area?

#include "stdafx.h"
#include "windows.h"
#include <memory.h>
#include <TCHAR.h>
//#pragma once

#pragma data_seq("Shared")
volatile wchar_t* content;
#pragma data_seq()
#pragma comment(linker, "/Section:Shared,RWS")


namespace ShareMemory2 {

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}

protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::Button^ button1;
protected:

private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->button1 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(67, 26);
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(164, 20);
this->textBox1->TabIndex = 0;
//
// button1
//
this->button1->Location = System::Drawing::Point(105, 64);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(75, 23);
this->button1->TabIndex = 1;
this->button1->Text = L"button1";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(296, 111);
this->Controls->Add(this->button1);
this->Controls->Add(this->textBox1);
this->Name = L"Form1";
this->Text = L"Form1";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->ResumeLayout(false);
this->PerformLayout();

}
#pragma endregion

private : System::String^ Pwchar_tToString(wchar_t* content){
System::IntPtr ptr(content);
System::String^ string = System::Runtime::InteropServices::Marshal::PtrToStringUni(ptr);
return string;
};

private : wchar_t *StringToPwchar_t(System::String^ str){
IntPtr ptr = System::Runtime::InteropServices::Marshal::StringToHGlobalUni(str);
wchar_t *string = reinterpret_cast<wchar_t*>(ptr.ToPointer());
return string;
};

private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
/*wchar_t**/ content=TEXT("abc");
//memcpy((void*)content,content2,4);
wchar_t* cont2=TEXT("abc");
int i=0;
this->textBox1->Text=Pwchar_tToString(cont2);
}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
wchar_t* in=StringToPwchar_t(this->textBox1->Text);
int i=0;
}
};


}
AnswerRe: how to use #pragma data_seq Pin
ernst2002053020-Mar-09 8:39
ernst2002053020-Mar-09 8:39 
AnswerRe: how to use #pragma data_seq Pin
Mark Salsbery22-Mar-09 6:23
Mark Salsbery22-Mar-09 6:23 
GeneralRe: how to use #pragma data_seq Pin
ernst2002053022-Mar-09 15:06
ernst2002053022-Mar-09 15:06 
GeneralRe: how to use #pragma data_seq Pin
led mike23-Mar-09 5:03
led mike23-Mar-09 5:03 
GeneralRe: how to use #pragma data_seq Pin
Mark Salsbery23-Mar-09 10:00
Mark Salsbery23-Mar-09 10:00 
QuestionMouse hook problem Pin
g_sandipan19-Mar-09 19:50
g_sandipan19-Mar-09 19:50 
QuestionHow to Access numerical array data from various controls? Pin
isaaks16-Mar-09 13:12
isaaks16-Mar-09 13:12 
AnswerRe: How to Access numerical array data from various controls? Pin
N a v a n e e t h16-Mar-09 22:36
N a v a n e e t h16-Mar-09 22:36 
GeneralRe: How to Access numerical array data from various controls? Pin
isaaks17-Mar-09 8:52
isaaks17-Mar-09 8:52 
GeneralRe: How to Access numerical array data from various controls? Pin
N a v a n e e t h17-Mar-09 22:33
N a v a n e e t h17-Mar-09 22:33 
QuestionHaving a program create its own variables? [modified] Pin
TabascoSauce14-Mar-09 21:33
TabascoSauce14-Mar-09 21:33 
AnswerRe: Having a program create its own variables? Pin
N a v a n e e t h15-Mar-09 5:41
N a v a n e e t h15-Mar-09 5:41 
GeneralRe: Having a program create its own variables? [modified] Pin
TabascoSauce15-Mar-09 11:36
TabascoSauce15-Mar-09 11:36 
QuestionUpdating form controls outside of form file Pin
Lavake14-Mar-09 11:14
Lavake14-Mar-09 11:14 
AnswerRe: Updating form controls outside of form file Pin
N a v a n e e t h14-Mar-09 16:28
N a v a n e e t h14-Mar-09 16:28 
GeneralRe: Updating form controls outside of form file Pin
Lavake15-Mar-09 4:06
Lavake15-Mar-09 4:06 
GeneralRe: Updating form controls outside of form file Pin
N a v a n e e t h15-Mar-09 5:21
N a v a n e e t h15-Mar-09 5:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.