Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call method on C# User control from c++

Status
Not open for further replies.

lpatnaik

Programmer
Jul 11, 2002
53
Hi,

I am trying to create a very simple application in vc++ 6.0. I have a c# user control (all it contains is a button btnSomething) as below:
namespace CtrlLib
{
public interface IAcontrol
{
void SetButtonText();
}
public partial class AControl : UserControl, IAcontrol
{
public AControl()
{
InitializeComponent();
}

private void btnSomething_Click(object sender, EventArgs e)
{
//Do Something;
}

public void SetButtonText()
{
btnSomething.Text = "I have changed!";
}
}
}

Now I have compiled it into a COM visible comp and created a type library using regasm with codebase attribute. All I want is to display this control in a C++ dialog and be able to chnage its text by calling SetButtonText from c++ code. Please help.

Pls note: I am very very very new to coding in c++.

Thanks LP
 
You can't use C# with VS6: not easily anyway. Better if you try a later version of Visual Studio (2003 onwards).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top