R
Renato T. Forti
Hi all,
How to access API function of a Managed C++ application?
Sample:
This doesn't work. :MessageBox.)
----------------------------------------------------------------------------
------------------------
#pragma once
namespace teste
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:ata;
using namespace System:rawing;
/// <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 __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super:ispose(disposing);
}
private: System::Windows::Forms::LinkLabel * CallingAPI;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container * components;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->CallingAPI = new
System::Windows::Forms::LinkLabel();
this->SuspendLayout();
//
// CallingAPI
//
this->CallingAPI->Location = System:rawing:oint(96,
96);
this->CallingAPI->Name = S"CallingAPI";
this->CallingAPI->TabIndex = 0;
this->CallingAPI->TabStop = true;
this->CallingAPI->Text = S"linkLabel1";
this->CallingAPI->LinkClicked += new
System::Windows::Forms::LinkLabelLinkClickedEventHandler(this,
CallingAPI_LinkClicked);
//
// Form1
//
this->AutoScaleBaseSize = System:rawing::Size(5, 13);
this->ClientSize = System:rawing::Size(292, 266);
this->Controls->Add(this->CallingAPI);
this->Name = S"Form1";
this->Text = S"Form1";
this->ResumeLayout(false);
}
private: System::Void CallingAPI_LinkClicked(System::Object * sender,
System::Windows::Forms::LinkLabelLinkClickedEventArgs * e)
{
::MessageBox(NULL, "Call API MessageBox Function",
NULL, NULL); /***********************HERE**********************/
}
};
}
And COM+, How to access ? Any Idea?
How to access API function of a Managed C++ application?
Sample:
This doesn't work. :MessageBox.)
----------------------------------------------------------------------------
------------------------
#pragma once
namespace teste
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:ata;
using namespace System:rawing;
/// <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 __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super:ispose(disposing);
}
private: System::Windows::Forms::LinkLabel * CallingAPI;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container * components;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->CallingAPI = new
System::Windows::Forms::LinkLabel();
this->SuspendLayout();
//
// CallingAPI
//
this->CallingAPI->Location = System:rawing:oint(96,
96);
this->CallingAPI->Name = S"CallingAPI";
this->CallingAPI->TabIndex = 0;
this->CallingAPI->TabStop = true;
this->CallingAPI->Text = S"linkLabel1";
this->CallingAPI->LinkClicked += new
System::Windows::Forms::LinkLabelLinkClickedEventHandler(this,
CallingAPI_LinkClicked);
//
// Form1
//
this->AutoScaleBaseSize = System:rawing::Size(5, 13);
this->ClientSize = System:rawing::Size(292, 266);
this->Controls->Add(this->CallingAPI);
this->Name = S"Form1";
this->Text = S"Form1";
this->ResumeLayout(false);
}
private: System::Void CallingAPI_LinkClicked(System::Object * sender,
System::Windows::Forms::LinkLabelLinkClickedEventArgs * e)
{
::MessageBox(NULL, "Call API MessageBox Function",
NULL, NULL); /***********************HERE**********************/
}
};
}
And COM+, How to access ? Any Idea?