How can I use function with a handle

  • Thread starter Thread starter Allen
  • Start date Start date
A

Allen

I am using ms visual C++ studio.NET 2003. Instead of using regular code
inside the handle, I want to use a function. My question is where to
declare the function and from where I can call it? I tried to do this in
the header file, but it does not work:
//int add (int a, int b);

namespace TimeTrack
{
Function prototype here;

{
.....
private: System::Void InBtn_Click(System::Object * sender,
System::EventArgs * e)
{
......
Function call here;
}
}
/***************************************
Function body here
{
}
 
I am using ms visual C++ studio.NET 2003. Instead of using regular
code inside the handle, I want to use a function. My question is
where to declare the function and from where I can call it? I tried
to do this in the header file, but it does not work:
//int add (int a, int b);

namespace TimeTrack
{
Function prototype here;

{
....
private: System::Void InBtn_Click(System::Object * sender,
System::EventArgs * e)
{
.....
Function call here;
}
}
/***************************************
Function body here
{
}

I don't do much C++, but one of the following should work fine:

private: System::Void InBtn_Click(System::Object * sender,
System::EventArgs * e)
{
SomeOtherFunction();
}

void SomeOtherFunction()
{
//Code here?
}

/*********** OR **************/

private: System::Void InBtn_Click(System::Object * sender,
System::EventArgs * e)
{
SomeOtherFunction();
}

private: System::Void SomeOtherFunction()
{
//Code here?
}

Unless you are talking something else when you mean function, that
should do it?

Just curious about why you are choosing C++ when it appears, from the
question, you are relatively new to this. You will find tons more
resources in C#. Not stating you should not use C++, but just curious
why you have chosen it.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

******************************************
| Think outside the box! |
******************************************
 
Back
Top