470,870 Members | 1,406 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 developers. It's quick & easy.

CLR Class Libary

Can anyone tell me how to write a CLR Class Library (C++/CLI DLL)

I have declared my class in .h file as

namespace Test
{
public ref class TestFunctions
{
public:
static bool Function1( );
}
}

and my .cpp file is
namespace Test
{
bool TestFunctions::Function1()
{
bool bRet = false;
return bRet;
}
}

Is this the best way to write a dll using C++/CLI.
I am declaring the functions as static so that I can use them directly from
my application.

Thanks,
-Asfar
Mar 1 '06 #1
1 1297
> Can anyone tell me how to write a CLR Class Library (C++/CLI DLL)

I have declared my class in .h file as

namespace Test
{
public ref class TestFunctions
{
public:
static bool Function1( );
}
}

and my .cpp file is
namespace Test
{
bool TestFunctions::Function1()
{
bool bRet = false;
return bRet;
}
}

Is this the best way to write a dll using C++/CLI.
I am declaring the functions as static so that I can use them directly
from my application.


Hi,

Another possibility is to implement the class completely in your .h file,
just like WinForms are implemented in VC++.
It is not the default C++ way, but you'll see the same style in C# where
there are no separate declaration and implementation.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
Mar 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by C-Sharper or C-Hasher, one of the two | last post: by
1 post views Thread by Tom Edelbrok | last post: by
4 posts views Thread by David McCallum | last post: by
7 posts views Thread by Peter Bradley | last post: by
7 posts views Thread by patr0805 | last post: by
4 posts views Thread by vedrandekovic | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.