Click here to Skip to main content
15,886,110 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Want to stop full screen display when using Windows media player Pin
V Shah11-Mar-10 6:28
V Shah11-Mar-10 6:28 
GeneralRe: Want to stop full screen display when using Windows media player Pin
Keith Worden11-Mar-10 6:45
Keith Worden11-Mar-10 6:45 
QuestionGetSaveFileName: does not work propoerly when the option "Hide file extension for know file type" is checked Pin
zouzoulikou20-Mar-09 7:49
zouzoulikou20-Mar-09 7:49 
AnswerRe: GetSaveFileName: does not work propoerly when the option "Hide file extension for know file type" is checked Pin
David Crow20-Mar-09 7:57
David Crow20-Mar-09 7:57 
GeneralRe: GetSaveFileName: does not work propoerly when the option "Hide file extension for know file type" is checked Pin
zouzoulikou20-Mar-09 22:48
zouzoulikou20-Mar-09 22:48 
GeneralRe: GetSaveFileName: does not work propoerly when the option "Hide file extension for know file type" is checked Pin
David Crow21-Mar-09 16:11
David Crow21-Mar-09 16:11 
AnswerRe: GetSaveFileName: does not work propoerly when the option "Hide file extension for know file type" is checked Pin
norish21-Mar-09 1:54
norish21-Mar-09 1:54 
Questionhow to use #pragma data_seq() Pin
ernst2002053020-Mar-09 7:48
ernst2002053020-Mar-09 7:48 
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
David Crow20-Mar-09 7:55
David Crow20-Mar-09 7:55 
GeneralRe: how to use #pragma data_seq() Pin
ernst2002053020-Mar-09 8:04
ernst2002053020-Mar-09 8:04 
GeneralRe: how to use #pragma data_seq() Pin
David Crow20-Mar-09 8:09
David Crow20-Mar-09 8:09 
GeneralRe: how to use #pragma data_seq() Pin
ernst2002053020-Mar-09 8:18
ernst2002053020-Mar-09 8:18 
GeneralRe: how to use #pragma data_seq() Pin
David Crow20-Mar-09 8:29
David Crow20-Mar-09 8:29 
AnswerRe: how to use #pragma data_seq() Pin
cmk20-Mar-09 10:38
cmk20-Mar-09 10:38 
QuestionErase previous drawings Pin
llp00na20-Mar-09 6:53
llp00na20-Mar-09 6:53 
AnswerRe: Erase previous drawings Pin
Chris Losinger20-Mar-09 7:09
professionalChris Losinger20-Mar-09 7:09 
GeneralRe: Erase previous drawings Pin
llp00na20-Mar-09 7:27
llp00na20-Mar-09 7:27 
GeneralRe: Erase previous drawings Pin
Chris Losinger20-Mar-09 7:35
professionalChris Losinger20-Mar-09 7:35 
GeneralRe: Erase previous drawings Pin
David Crow20-Mar-09 9:25
David Crow20-Mar-09 9:25 
AnswerRe: Erase previous drawings Pin
Code-o-mat20-Mar-09 7:30
Code-o-mat20-Mar-09 7:30 
GeneralRe: Erase previous drawings Pin
llp00na20-Mar-09 8:17
llp00na20-Mar-09 8:17 
GeneralRe: Erase previous drawings Pin
llp00na20-Mar-09 8:23
llp00na20-Mar-09 8:23 
QuestionRe: Erase previous drawings Pin
David Crow20-Mar-09 8:31
David Crow20-Mar-09 8:31 
AnswerRe: Erase previous drawings Pin
llp00na20-Mar-09 9:04
llp00na20-Mar-09 9:04 
QuestionRe: Erase previous drawings Pin
David Crow20-Mar-09 9:06
David Crow20-Mar-09 9:06 

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.