|
.
What change made it working ?
Prasad
MS MVP - VC++
|
|
|
|
|
I dont know exactly. I declared something else, but it didnt have to do with that function.
|
|
|
|
|
Anka_Ame wrote: I dont know exactly. I declared something else...
And you're satisifed with that resolution? Doesn't that indicate to you that you might have simply masked the problem rather than actually fixed it?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
What else did you declare?
Please don't keep us in suspense ...
-- modified at 9:50 Wednesday 25th April, 2007
|
|
|
|
|
This is all the code of my interface in C++
#pragma once
namespace Interfatafinala {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::IO;
using namespace System::Globalization;
using namespace System::Text;
using namespace System::Collections::Generic;
using namespace System::Data::SqlClient;
using namespace System::Drawing;
///
/// 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.
///
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
///
/// Clean up any resources being used.
///
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::MenuStrip^ menuStrip1;
protected:
private: System::Windows::Forms::ToolStripMenuItem^ fileToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ newToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ openToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator;
private: System::Windows::Forms::ToolStripMenuItem^ saveToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ saveAsToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator1;
private: System::Windows::Forms::ToolStripMenuItem^ printToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ printPreviewToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator2;
private: System::Windows::Forms::ToolStripMenuItem^ exitToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ editToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ undoToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ redoToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator3;
private: System::Windows::Forms::ToolStripMenuItem^ cutToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ copyToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ pasteToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator4;
private: System::Windows::Forms::ToolStripMenuItem^ selectAllToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ viewToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ benchmarksToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ toolsToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ customizeToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ optionsToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ helpToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ contentsToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator5;
private: System::Windows::Forms::ToolStripMenuItem^ aboutToolStripMenuItem;
private: System::Windows::Forms::ToolStrip^ toolStrip1;
private: System::Windows::Forms::ToolStripButton^ newToolStripButton;
private: System::Windows::Forms::ToolStripButton^ openToolStripButton;
private: System::Windows::Forms::ToolStripButton^ saveToolStripButton;
private: System::Windows::Forms::ToolStripButton^ printToolStripButton;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator6;
private: System::Windows::Forms::ToolStripButton^ cutToolStripButton;
private: System::Windows::Forms::ToolStripButton^ copyToolStripButton;
private: System::Windows::Forms::ToolStripButton^ pasteToolStripButton;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator7;
private: System::Windows::Forms::ToolStripButton^ helpToolStripButton;
private: System::Windows::Forms::StatusStrip^ statusStrip1;
private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel1;
private: System::Windows::Forms::ProgressBar^ progressBar1;
private: System::Windows::Forms::PictureBox^ TourDiagram;
private: System::Windows::Forms::Panel^ Output;
private: System::Windows::Forms::Button^ Start;
private: System::Windows::Forms::Button^ Stop;
private: System::Windows::Forms::Button^ Results;
private: System::Windows::Forms::Label^ CapacityLabel;
private: System::Windows::Forms::TextBox^ capacitytextbox;
private: System::Windows::Forms::OpenFileDialog^ openf;
private: System::Windows::Forms::OpenFileDialog^ sfdas;
private:
///
/// Required designer variable.
///
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
this->fileToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->newToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->openToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator = (gcnew System::Windows::Forms::ToolStripSeparator());
this->saveToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->saveAsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->printToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->printPreviewToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->exitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->editToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->undoToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->redoToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->cutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->copyToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->pasteToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->selectAllToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->viewToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->benchmarksToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->customizeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->optionsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->helpToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->contentsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator5 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->aboutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStrip1 = (gcnew System::Windows::Forms::ToolStrip());
this->newToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->openToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->saveToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->printToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->toolStripSeparator6 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->cutToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->copyToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->pasteToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->toolStripSeparator7 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->helpToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
this->toolStripStatusLabel1 = (gcnew System::Windows::Forms::ToolStripStatusLabel());
this->progressBar1 = (gcnew System::Windows::Forms::ProgressBar());
this->TourDiagram = (gcnew System::Windows::Forms::PictureBox());
this->Output = (gcnew System::Windows::Forms::Panel());
this->Start = (gcnew System::Windows::Forms::Button());
this->Stop = (gcnew System::Windows::Forms::Button());
this->Results = (gcnew System::Windows::Forms::Button());
this->CapacityLabel = (gcnew System::Windows::Forms::Label());
this->capacitytextbox = (gcnew System::Windows::Forms::TextBox());
this->openf = (gcnew System::Windows::Forms::OpenFileDialog());
this->sfdas = (gcnew System::Windows::Forms::OpenFileDialog());
this->menuStrip1->SuspendLayout();
this->toolStrip1->SuspendLayout();
this->statusStrip1->SuspendLayout();
(cli::safe_cast<system::componentmodel::isupportinitialize^>(this->TourDiagram))->BeginInit();
this->SuspendLayout();
//
// menuStrip1
//
this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(5) {this->fileToolStripMenuItem,
this->editToolStripMenuItem, this->viewToolStripMenuItem, this->toolsToolStripMenuItem, this->helpToolStripMenuItem});
this->menuStrip1->Location = System::Drawing::Point(0, 0);
this->menuStrip1->Name = L"menuStrip1";
this->menuStrip1->Size = System::Drawing::Size(762, 24);
this->menuStrip1->TabIndex = 0;
this->menuStrip1->Text = L"menuStrip1";
//
// fileToolStripMenuItem
//
this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(10) {this->newToolStripMenuItem,
this->openToolStripMenuItem, this->toolStripSeparator, this->saveToolStripMenuItem, this->saveAsToolStripMenuItem, this->toolStripSeparator1,
this->printToolStripMenuItem, this->printPreviewToolStripMenuItem, this->toolStripSeparator2, this->exitToolStripMenuItem});
this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem";
this->fileToolStripMenuItem->Size = System::Drawing::Size(35, 20);
this->fileToolStripMenuItem->Text = L"&File";
//
// newToolStripMenuItem
//
this->newToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"newToolStripMenuItem.Image")));
this->newToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->newToolStripMenuItem->Name = L"newToolStripMenuItem";
this->newToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::N));
this->newToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->newToolStripMenuItem->Text = L"&New";
this->newToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::newToolStripMenuItem_Click);
//
// openToolStripMenuItem
//
this->openToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"openToolStripMenuItem.Image")));
this->openToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->openToolStripMenuItem->Name = L"openToolStripMenuItem";
this->openToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys: ));
this->openToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->openToolStripMenuItem->Text = L"&Open";
this->openToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::openToolStripMenuItem_Click);
//
// toolStripSeparator
//
this->toolStripSeparator->Name = L"toolStripSeparator";
this->toolStripSeparator->Size = System::Drawing::Size(148, 6);
//
// saveToolStripMenuItem
//
this->saveToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"saveToolStripMenuItem.Image")));
this->saveToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->saveToolStripMenuItem->Name = L"saveToolStripMenuItem";
this->saveToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::S));
this->saveToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->saveToolStripMenuItem->Text = L"&Save";
this->saveToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::saveToolStripMenuItem_Click);
//
// saveAsToolStripMenuItem
//
this->saveAsToolStripMenuItem->Name = L"saveAsToolStripMenuItem";
this->saveAsToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->saveAsToolStripMenuItem->Text = L"Save &As";
this->saveAsToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::saveAsToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this->toolStripSeparator1->Name = L"toolStripSeparator1";
this->toolStripSeparator1->Size = System::Drawing::Size(148, 6);
//
// printToolStripMenuItem
//
this->printToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"printToolStripMenuItem.Image")));
this->printToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->printToolStripMenuItem->Name = L"printToolStripMenuItem";
this->printToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::P));
this->printToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->printToolStripMenuItem->Text = L"&Print";
//
// printPreviewToolStripMenuItem
//
this->printPreviewToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"printPreviewToolStripMenuItem.Image")));
this->printPreviewToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->printPreviewToolStripMenuItem->Name = L"printPreviewToolStripMenuItem";
this->printPreviewToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->printPreviewToolStripMenuItem->Text = L"Print Pre&view";
//
// toolStripSeparator2
//
this->toolStripSeparator2->Name = L"toolStripSeparator2";
this->toolStripSeparator2->Size = System::Drawing::Size(148, 6);
//
// exitToolStripMenuItem
//
this->exitToolStripMenuItem->Name = L"exitToolStripMenuItem";
this->exitToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::F4));
this->exitToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->exitToolStripMenuItem->Text = L"E&xit";
this->exitToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::exitToolStripMenuItem_Click);
//
// editToolStripMenuItem
//
this->editToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(8) {this->undoToolStripMenuItem,
this->redoToolStripMenuItem, this->toolStripSeparator3, this->cutToolStripMenuItem, this->copyToolStripMenuItem, this->pasteToolStripMenuItem,
this->toolStripSeparator4, this->selectAllToolStripMenuItem});
this->editToolStripMenuItem->Name = L"editToolStripMenuItem";
this->editToolStripMenuItem->Size = System::Drawing::Size(37, 20);
this->editToolStripMenuItem->Text = L"&Edit";
//
// undoToolStripMenuItem
//
this->undoToolStripMenuItem->Name = L"undoToolStripMenuItem";
this->undoToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::Z));
this->undoToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->undoToolStripMenuItem->Text = L"&Undo";
//
// redoToolStripMenuItem
//
this->redoToolStripMenuItem->Name = L"redoToolStripMenuItem";
this->redoToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::Y));
this->redoToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->redoToolStripMenuItem->Text = L"&Redo";
//
// toolStripSeparator3
//
this->toolStripSeparator3->Name = L"toolStripSeparator3";
this->toolStripSeparator3->Size = System::Drawing::Size(147, 6);
//
// cutToolStripMenuItem
//
this->cutToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"cutToolStripMenuItem.Image")));
this->cutToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->cutToolStripMenuItem->Name = L"cutToolStripMenuItem";
this->cutToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::X));
this->cutToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->cutToolStripMenuItem->Text = L"Cu&t";
this->cutToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::cutToolStripMenuItem_Click);
//
// copyToolStripMenuItem
//
this->copyToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"copyToolStripMenuItem.Image")));
this->copyToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->copyToolStripMenuItem->Name = L"copyToolStripMenuItem";
this->copyToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::C));
this->copyToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->copyToolStripMenuItem->Text = L"&Copy";
this->copyToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::copyToolStripMenuItem_Click);
//
// pasteToolStripMenuItem
//
this->pasteToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"pasteToolStripMenuItem.Image")));
this->pasteToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->pasteToolStripMenuItem->Name = L"pasteToolStripMenuItem";
this->pasteToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::V));
this->pasteToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->pasteToolStripMenuItem->Text = L"&Paste";
this->pasteToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::pasteToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this->toolStripSeparator4->Name = L"toolStripSeparator4";
this->toolStripSeparator4->Size = System::Drawing::Size(147, 6);
//
// selectAllToolStripMenuItem
//
this->selectAllToolStripMenuItem->Name = L"selectAllToolStripMenuItem";
this->selectAllToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->selectAllToolStripMenuItem->Text = L"Select &All";
//
// viewToolStripMenuItem
//
this->viewToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->benchmarksToolStripMenuItem});
this->viewToolStripMenuItem->Name = L"viewToolStripMenuItem";
this->viewToolStripMenuItem->Size = System::Drawing::Size(41, 20);
this->viewToolStripMenuItem->Text = L"View";
//
// benchmarksToolStripMenuItem
//
this->benchmarksToolStripMenuItem->Name = L"benchmarksToolStripMenuItem";
this->benchmarksToolStripMenuItem->Size = System::Drawing::Size(142, 22);
this->benchmarksToolStripMenuItem->Text = L"Benchmarks";
//
// toolsToolStripMenuItem
//
this->toolsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->customizeToolStripMenuItem,
this->optionsToolStripMenuItem});
this->toolsToolStripMenuItem->Name = L"toolsToolStripMenuItem";
this->toolsToolStripMenuItem->Size = System::Drawing::Size(44, 20);
this->toolsToolStripMenuItem->Text = L"&Tools";
//
// customizeToolStripMenuItem
//
this->customizeToolStripMenuItem->Name = L"customizeToolStripMenuItem";
this->customizeToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->customizeToolStripMenuItem->Text = L"&Customize";
//
// optionsToolStripMenuItem
//
this->optionsToolStripMenuItem->Name = L"optionsToolStripMenuItem";
this->optionsToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->optionsToolStripMenuItem->Text = L"&Options";
//
// helpToolStripMenuItem
//
this->helpToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3) {this->contentsToolStripMenuItem,
this->toolStripSeparator5, this->aboutToolStripMenuItem});
this->helpToolStripMenuItem->Name = L"helpToolStripMenuItem";
this->helpToolStripMenuItem->Size = System::Drawing::Size(40, 20);
this->helpToolStripMenuItem->Text = L"&Help";
//
// contentsToolStripMenuItem
//
this->contentsToolStripMenuItem->Name = L"contentsToolStripMenuItem";
this->contentsToolStripMenuItem->Size = System::Drawing::Size(129, 22);
this->contentsToolStripMenuItem->Text = L"&Contents";
//
// toolStripSeparator5
//
this->toolStripSeparator5->Name = L"toolStripSeparator5";
this->toolStripSeparator5->Size = System::Drawing::Size(126, 6);
//
// aboutToolStripMenuItem
//
this->aboutToolStripMenuItem->Name = L"aboutToolStripMenuItem";
this->aboutToolStripMenuItem->Size = System::Drawing::Size(129, 22);
this->aboutToolStripMenuItem->Text = L"&About...";
//
// toolStrip1
//
this->toolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(10) {this->newToolStripButton,
this->openToolStripButton, this->saveToolStripButton, this->printToolStripButton, this->toolStripSeparator6, this->cutToolStripButton,
this->copyToolStripButton, this->pasteToolStripButton, this->toolStripSeparator7, this->helpToolStripButton});
this->toolStrip1->Location = System::Drawing::Point(0, 24);
this->toolStrip1->Name = L"toolStrip1";
this->toolStrip1->Size = System::Drawing::Size(762, 25);
this->toolStrip1->TabIndex = 1;
this->toolStrip1->Text = L"toolStrip1";
//
// newToolStripButton
//
this->newToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->newToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"newToolStripButton.Image")));
this->newToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->newToolStripButton->Name = L"newToolStripButton";
this->newToolStripButton->Size = System::Drawing::Size(23, 22);
this->newToolStripButton->Text = L"&New";
this->newToolStripButton->Click += gcnew System::EventHandler(this, &Form1::newToolStripButton_Click);
//
// openToolStripButton
//
this->openToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->openToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"openToolStripButton.Image")));
this->openToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->openToolStripButton->Name = L"openToolStripButton";
this->openToolStripButton->Size = System::Drawing::Size(23, 22);
this->openToolStripButton->Text = L"&Open";
this->openToolStripButton->Click += gcnew System::EventHandler(this, &Form1::openToolStripButton_Click);
//
// saveToolStripButton
//
this->saveToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->saveToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"saveToolStripButton.Image")));
this->saveToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->saveToolStripButton->Name = L"saveToolStripButton";
this->saveToolStripButton->Size = System::Drawing::Size(23, 22);
this->saveToolStripButton->Text = L"&Save";
this->saveToolStripButton->Click += gcnew System::EventHandler(this, &Form1::saveToolStripButton_Click);
//
// printToolStripButton
//
this->printToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->printToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"printToolStripButton.Image")));
this->printToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->printToolStripButton->Name = L"printToolStripButton";
this->printToolStripButton->Size = System::Drawing::Size(23, 22);
this->printToolStripButton->Text = L"&Print";
//
// toolStripSeparator6
//
this->toolStripSeparator6->Name = L"toolStripSeparator6";
this->toolStripSeparator6->Size = System::Drawing::Size(6, 25);
//
// cutToolStripButton
//
this->cutToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->cutToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"cutToolStripButton.Image")));
this->cutToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->cutToolStripButton->Name = L"cutToolStripButton";
this->cutToolStripButton->Size = System::Drawing::Size(23, 22);
this->cutToolStripButton->Text = L"C&ut";
this->cutToolStripButton->Click += gcnew System::EventHandler(this, &Form1::cutToolStripButton_Click);
//
// copyToolStripButton
//
this->copyToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->copyToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"copyToolStripButton.Image")));
this->copyToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->copyToolStripButton->Name = L"copyToolStripButton";
this->copyToolStripButton->Size = System::Drawing::Size(23, 22);
this->copyToolStripButton->Text = L"&Copy";
this->copyToolStripButton->Click += gcnew System::EventHandler(this, &Form1::copyToolStripButton_Click);
//
// pasteToolStripButton
//
this->pasteToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->pasteToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"pasteToolStripButton.Image")));
this->pasteToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->pasteToolStripButton->Name = L"pasteToolStripButton";
this->pasteToolStripButton->Size = System::Drawing::Size(23, 22);
this->pasteToolStripButton->Text = L"&Paste";
this->pasteToolStripButton->Click += gcnew System::EventHandler(this, &Form1::pasteToolStripButton_Click);
//
// toolStripSeparator7
//
this->toolStripSeparator7->Name = L"toolStripSeparator7";
this->toolStripSeparator7->Size = System::Drawing::Size(6, 25);
//
// helpToolStripButton
//
this->helpToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->helpToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"helpToolStripButton.Image")));
this->helpToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->helpToolStripButton->Name = L"helpToolStripButton";
this->helpToolStripButton->Size = System::Drawing::Size(23, 22);
this->helpToolStripButton->Text = L"He&lp";
//
// statusStrip1
//
this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->toolStripStatusLabel1});
this->statusStrip1->Location = System::Drawing::Point(0, 578);
this->statusStrip1->Name = L"statusStrip1";
this->statusStrip1->Size = System::Drawing::Size(762, 22);
this->statusStrip1->TabIndex = 2;
this->statusStrip1->Text = L"statusStrip1";
//
// toolStripStatusLabel1
//
this->toolStripStatusLabel1->Name = L"toolStripStatusLabel1";
this->toolStripStatusLabel1->Size = System::Drawing::Size(235, 17);
this->toolStripStatusLabel1->Text = L"Open a City List or click the map to place cities. ";
//
// progressBar1
//
this->progressBar1->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Right));
this->progressBar1->Location = System::Drawing::Point(659, 584);
this->progressBar1->Name = L"progressBar1";
this->progressBar1->Size = System::Drawing::Size(91, 16);
this->progressBar1->TabIndex = 3;
//
// TourDiagram
//
this->TourDiagram->Anchor = static_cast<system::windows::forms::anchorstyles>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom)
| System::Windows::Forms::AnchorStyles::Left)
| System::Windows::Forms::AnchorStyles::Right));
this->TourDiagram->BackColor = System::Drawing::SystemColors::ActiveCaptionText;
this->TourDiagram->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->TourDiagram->Location = System::Drawing::Point(8, 52);
this->TourDiagram->Name = L"TourDiagram";
this->TourDiagram->Size = System::Drawing::Size(618, 339);
this->TourDiagram->TabIndex = 4;
this->TourDiagram->TabStop = false;
//
// Output
//
this->Output->Anchor = static_cast<system::windows::forms::anchorstyles>(((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left)
| System::Windows::Forms::AnchorStyles::Right));
this->Output->BackColor = System::Drawing::SystemColors::ActiveCaptionText;
this->Output->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->Output->Location = System::Drawing::Point(8, 397);
this->Output->Name = L"Output";
this->Output->Size = System::Drawing::Size(617, 181);
this->Output->TabIndex = 5;
//
// Start
//
this->Start->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Right));
this->Start->Location = System::Drawing::Point(654, 479);
this->Start->Name = L"Start";
this->Start->Size = System::Drawing::Size(97, 27);
this->Start->TabIndex = 6;
this->Start->Text = L"Start";
this->Start->UseVisualStyleBackColor = true;
this->Start->Click += gcnew System::EventHandler(this, &Form1::Start_Click);
//
// Stop
//
this->Stop->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Right));
this->Stop->Location = System::Drawing::Point(654, 512);
this->Stop->Name = L"Stop";
this->Stop->Size = System::Drawing::Size(96, 27);
this->Stop->TabIndex = 7;
this->Stop->Text = L"Stop";
this->Stop->UseVisualStyleBackColor = true;
//
// Results
//
this->Results->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Right));
this->Results->Location = System::Drawing::Point(654, 545);
this->Results->Name = L"Results";
this->Results->Size = System::Drawing::Size(96, 23);
this->Results->TabIndex = 8;
this->Results->Text = L"Results";
this->Results->UseVisualStyleBackColor = true;
this->Results->Click += gcnew System::EventHandler(this, &Form1::Results_Click);
//
// CapacityLabel
//
this->CapacityLabel->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
this->CapacityLabel->AutoSize = true;
this->CapacityLabel->Location = System::Drawing::Point(655, 71);
this->CapacityLabel->Name = L"CapacityLabel";
this->CapacityLabel->Size = System::Drawing::Size(86, 13);
this->CapacityLabel->TabIndex = 9;
this->CapacityLabel->Text = L"Vehicle Capacity";
//
// capacitytextbox
//
this->capacitytextbox->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
this->capacitytextbox->Location = System::Drawing::Point(659, 87);
this->capacitytextbox->Name = L"capacitytextbox";
this->capacitytextbox->Size = System::Drawing::Size(65, 20);
this->capacitytextbox->TabIndex = 10;
this->capacitytextbox->Text = L"100";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(762, 600);
this->Controls->Add(this->capacitytextbox);
this->Controls->Add(this->CapacityLabel);
this->Controls->Add(this->Results);
this->Controls->Add(this->Stop);
this->Controls->Add(this->Start);
this->Controls->Add(this->Output);
this->Controls->Add(this->TourDiagram);
this->Controls->Add(this->progressBar1);
this->Controls->Add(this->statusStrip1);
this->Controls->Add(this->toolStrip1);
this->Controls->Add(this->menuStrip1);
this->MainMenuStrip = this->menuStrip1;
this->Name = L"Form1";
this->Text = L"Vehicle Routing Problem";
this->menuStrip1->ResumeLayout(false);
this->menuStrip1->PerformLayout();
this->toolStrip1->ResumeLayout(false);
this->toolStrip1->PerformLayout();
this->statusStrip1->ResumeLayout(false);
this->statusStrip1->PerformLayout();
(cli::safe_cast<system::componentmodel::isupportinitialize^>(this->TourDiagram))->EndInit();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
Stream^ myStream;
String^ filename;
//////// Region Declaration MenuItem
private: System::Void newToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
String^ currentFile;
try
{
if (currentFile == "")
{
System::Windows::Forms::DialogResult answer;
answer = MessageBox::Show("Save current document before creating new document?", "Unsaved Document", MessageBoxButtons::YesNo, MessageBoxIcon::Question);
if (answer == System::Windows::Forms::DialogResult::No)
{
currentFile = "";
return;
}
else
{
saveToolStripMenuItem_Click(this, gcnew EventArgs());
currentFile = "";
return;
}
}
else
{
currentFile = "";
return;
}
}
catch (Exception^ ex)
{
MessageBox::Show(ex->Message->ToString(), "Error");
}
}
private: System::Void openToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
String^ ofd;
OpenFileDialog^ openf = gcnew OpenFileDialog();
openf->Title = "Open file";
openf->InitialDirectory = "C:\\";
openf->Filter = "TSP Files (*.tsp)|*.tsp|All files (*.*)|*.*|XML Files (*.xml)|*.xml|Text Files (*.txt)|*.txt";
openf->FilterIndex = 2;
openf->RestoreDirectory = true;
if ((openf->ShowDialog())== System::Windows::Forms::DialogResult::OK)
{
// txtContents.Load(openf->FileName);
//textBox1.Text = openf->FileName;
}
//MessageBox.Show(String.Format("Filen skapades: {0}", File.GetCreationTime(textBox1.Text)));
ofd = openf->FileName;
try
{
}
catch (System::IO::FileNotFoundException())
{
MessageBox::Show("File not found: " + ofd, "Error", MessageBoxButtons::OK, MessageBoxIcon::Error, MessageBoxDefaultButton::Button1);
}
catch (System::InvalidCastException())
{
MessageBox::Show("Cities XML file is not valid", "Error", MessageBoxButtons::OK, MessageBoxIcon::Error, MessageBoxDefaultButton::Button1);
}
}
private: System::Void saveToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
/*using (FileStream f = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
{
// scribbleBox1.Document.Save(f);
}
*/
SaveFileDialog^ sfd = gcnew SaveFileDialog();
sfd->InitialDirectory = "c:\\";
sfd->DefaultExt = ".xml";
sfd->Filter = "TSP Files (*.tsp)|*.tsp|All files (*.*)|*.*|XML Files (*.xml)|*.xml|Text Files (*.txt)|*.txt";
sfd->Title = "Save";
sfd->RestoreDirectory = true;
if (sfd->ShowDialog() == System::Windows::Forms::DialogResult::OK)
{
if ((myStream = sfd->OpenFile()) != nullptr)
{
// Code to write the stream goes here.
myStream->Close();
}
}
filename = sfd->FileName;
}
private: System::Void saveAsToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
/*using (FileStream f = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
{
// scribbleBox1.Document.Save(f);
}
*/
SaveFileDialog^ sfdas = gcnew SaveFileDialog();
sfdas->InitialDirectory = "c:\\";
sfdas->Filter = "TSP Files (*.tsp)|*.tsp|All files (*.*)|*.*|XML Files (*.xml)|*.xml|Text Files (*.txt)|*.txt";
sfdas->FilterIndex = 2;
sfdas->FileName = filename;
sfdas->Title = "Save As...";
sfdas->RestoreDirectory = true;
sfdas->OverwritePrompt = true;
sfdas->CreatePrompt = true;
System::Windows::Forms::DialogResult dia = sfdas->ShowDialog();
if (dia != System::Windows::Forms::DialogResult::OK)
return;
}
private: System::Void exitToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
/*if (filename.modified == true)
{
MessageBox.Show("Save this document before closing?", "Unsaved document", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (System.Windows.Forms.DialogResult.Yes)
{
return;
}
else
{
filename.modified == false;
Application.Exit();
}
}
else
{
filename.modified == false;
Application.Exit();
}*/
Application::Exit();
}
private: System::Void cutToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
Clipboard::Clear();
Clipboard::SetText(this->ActiveControl->Text);
this->ActiveControl->Text = "";
}
private: System::Void copyToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
Clipboard::Clear();
Clipboard::SetText(this->ActiveControl->Text);
}
private: System::Void pasteToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
this->ActiveControl->Text = Clipboard::GetText();
}
//// Sfarsit Region Declaration MenuItem
///// Region Declaratia Butoane
private: System::Void Start_Click(System::Object^ sender, System::EventArgs^ e)
{
int vehiclecapacity = 0;
try
{
vehiclecapacity = Convert::ToInt32(capacitytextbox->Text, CultureInfo::CurrentCulture);
}
catch (System::FormatException())
{
}
if (vehiclecapacity <= 0)
{
MessageBox::Show("You must specify a Vehicle Capacity greater then 0", "Error", MessageBoxButtons::OK, MessageBoxIcon::Error, MessageBoxDefaultButton::Button1/*, MessageBoxOptions.DefaultDesktopOnly*/);
return;
}
}
///// Sfarsit Regiune Declaratie Butoane
////////////#region Toolbar Methods
private: System::Void newToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
newToolStripMenuItem_Click(this, e);
}
private: System::Void openToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
openToolStripMenuItem_Click(this, e);
}
private: System::Void saveToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
saveToolStripMenuItem_Click(this, e);
}
private: System::Void cutToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
cutToolStripMenuItem_Click(this, e);
}
private: System::Void copyToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
copyToolStripMenuItem_Click(this, e);
}
private: System::Void pasteToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
pasteToolStripMenuItem_Click(this, e);
}
//////////// Sfarsit #region Toolbar Methods
private: System::Void Results_Click(System::Object^ sender, System::EventArgs^ e)
{
}
};
}
|
|
|
|
|
I am a new student of Visual C++ programming. I have difficulty in message handling in Dll. I have made some program which uses WM_messages to notify the main program for some specific event. I had no problem with developing windows exe as in windows I can specify message handler function along with specifying which window should receive the message. but how to specify window to receive message in a dll program which has to run in back ground without any windows.
Regards
|
|
|
|
|
smzhaq wrote: but how to specify window to receive message in a dll program which has to run in back ground without any windows.
Dll's doesn't runs in background. It loads and unloads.
You probably can do some reading of Dll[^] section on CP.
You may need to export some functions from dll to communicate with it.
Prasad
MS MVP - VC++
|
|
|
|
|
Thank you very much Sir. My prolem is that I do not need to have any User interface like dialog or otherwise for the task performed byt the Dll. It is related to speech recognition using miscrosoft Speech SDK. There is a function SetNotifyWindowMessage(hWnd,WM_MESSAGE,WPARAM,LPARAM) to specify which window (hWnd) will receive the message sent by events. Can you please tell me how to handle it in Dll. I mean what to do for argument Hwnd.
Thank you very much
|
|
|
|
|
Hi,
My requirement is to find font file name. Not from registry any other method i need.
Thanks in advance!
Murali.M
Have A Nice Day!
Murali.M
|
|
|
|
|
Use SHGetFolderPath(hWnd, CSIDL_FONTS, ...) .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have created a Visualization plugin for WMP but when i was developing it i also created a different visualization using the same project files. Both these plugins are now finished and different but they overwrite each other when they are registered via regsvr32.exe.
Im sure there must be some small bit of code within the dll that i can change to stop this?
Any Ideas?
|
|
|
|
|
You probably kept the GUIDs the same in the two projects, so when COM registration happens, they write to the same reg keys. Change all the GUIDs in one of the projects.
|
|
|
|
|
I want to get the output of the console.using the pipe i can get most of them.
but a console use multithreads i cannot get the threads output,
so can anybody tell me what to do!!
|
|
|
|
|
linsion wrote: I want to get the output of the console.
Did you create the console window via CreateProcess() or ShellExecute() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i used CreateProces
or maybe the threads return too fast the app cannot capture them?
|
|
|
|
|
linsion wrote:
i used CreateProces
Then see here and here.
linsion wrote: or maybe the threads return too fast the app cannot capture them?
You should not need to be concerned with how slow/fast a thread executes. That's the whole paradigm behind asynchronous code.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanks for your help!
but the method your show me didnt work.
i have to give it up;
another question,when i connect to a remote computer(using nc),my console change,and this time i cannot input commands through the pipe.
how to solve this?
|
|
|
|
|
How can we use web parts as in like >> have a look at this site
http://www.pageflakes.com (asp.net 2.0 )
Please Help
|
|
|
|
|
i have made a sdi application, in that i have made a class derived from CForm view named CHttp.
Now from my main application class i have called a function which is inside CHttp
by simply making a object like this
CHttp test_http;
using this object i have called a function which is inside CHttp class
test_http.StartPingThread(URL_Name,nIndex);
void CHttp::StartPingThread(CString ping_url,int ping_index)
{
CWnd *obj_t = this;
th_run = 0;
error_ping_url = ping_url;
assocsping[ping_index] = (CPingThread*) AfxBeginThread(RUNTIME_CLASS(CPingThread),
THREAD_PRIORITY_NORMAL,
NULL,
CREATE_SUSPENDED,
NULL);
assocsping[ping_index]->ping_str = ping_url;
assocsping[ping_index]->ping_int = ping_index;
assocsping[ping_index]->ping_bool = TRUE;
assocsping[ping_index]->ResumeThread();
if(assocsping[ping_index])
{
m_PingThreadList.Add(pingThread);
assocsping[ping_index]->SetLogWindow(this);
assocsping[ping_index]->ResumeThread();
}
}
now in second last line it is not passing any value in this
ie. passing null
how to pass handle of a window in this function....
thanks in advance
|
|
|
|
|
this->GetSafeHwnd() returns you the handle to the current window
You mean this?
|
|
|
|
|
When i m not getting any value in this then how will GetSafeWnd() function will return anything..
|
|
|
|
|
When i m not getting any value in this then how will GetSafeWnd() function will return anything..
Is your function static?
If not, this has a value, as you have callted the function you are in on this. I.E> as if you had written
this->Function();
Failure is not an option - it's built right in.
|
|
|
|
|
Right,
If you are inside an object and "this" is corrupt, you have a big problem.
You did already verify if the constructor is correctly executed?
If you create a view without templates, you need to create the object, then execute Create(...),
to create the window and following a OnInitialUpdate.
Then your view is correctly created and initialized.
But even not to create and initialize the window, the "this"-pointer should have a value
|
|
|
|
|
neha.agarwal27 wrote: assocsping[ping_index]->SetLogWindow(this);
At this statement, what is the value of the this pointer? Perhaps you meant to use AfxGetMainWnd() instead.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi everybody,
i create a ContextMenu myself via AppendMenu(...);
The string is for example "List customers"
So i can choose the "List customers" via the contextmenu or via Key F2;
If i wish to add a Accelerator Key ( which is ONLY for this view )
I catch the KeyDown Message and if it's the F2 Key i open the window.
Now i like to display the menu in this way "List customers F2" with a tabulator between the
string and F2 ( that other menu-items displays the corresponding key in one "column" )
"List customers\tF2" doesn't work.
Has someone an idea?
Thanks
|
|
|
|
|