> Hi,
>
[quoted text clipped - 5 lines]
> how to do this either. I'm just looking for any straightforward way to
> make my c++ class available to c#.
In general, there is no straightforward way - unless your C++ class happens
to already be a COM class. For any other case, you need to learn and
understand the intricacies of native/managed interop. There are a myriad of
possibilities, depending on the class and how it's used - so you're unlikely
to find a step by step tutorial that tells you exactly what you need to
know.
If you can provide more information about the C++ class, I or others can
give you more detailed help.
What does the interface of the C++ class look like? How is it used? How is
it's lifetime managed? Does it make callbacks from arbitrary threads?
These and potentially many other questions may influence your options for
using this class from C#.
-cd
sherifffruitfly - 22 Jul 2007 18:41 GMT
On Jul 21, 10:52 pm, "Carl Daniel [VC++ MVP]"
<cpdaniel_remove_this_and_nos...@mvps.org.nospam> wrote:
> In general, there is no straightforward way - unless your C++ class happens
> to already be a COM class. For any other case, you need to learn and
> understand the intricacies of native/managed interop.
Dammit all to hell - lol!
> If you can provide more information about the C++ class, I or others can
> give you more detailed help.
[quoted text clipped - 3 lines]
> These and potentially many other questions may influence your options for
> using this class from C#.
Rather than answer these questions piecemeal, I'll just point you to
the code - it's very short and simple, though I'm unfamiliar with
winsock/tcpip stuff in c++:
http://random.irb.hr/index.php
Perhaps it would be simplest to simply rewrite the code in c#?
Thanks for your reply!
cdj
Carl Daniel [VC++ MVP] - 25 Jul 2007 04:14 GMT
> On Jul 21, 10:52 pm, "Carl Daniel [VC++ MVP]"
> <cpdaniel_remove_this_and_nos...@mvps.org.nospam> wrote:
[quoted text clipped - 20 lines]
>
> Perhaps it would be simplest to simply rewrite the code in c#?
If it's short and simple, it probably IS easier to simply rewrite the code
in C#. The .NET BCL has very good support for doing TCP/IP programming
(more efficient than the vast majority of native C++ apps that use sockets
for communications).
-cd
sherifffruitfly - 25 Jul 2007 05:37 GMT
On Jul 24, 8:14 pm, "Carl Daniel [VC++ MVP]"
<cpdaniel_remove_this_and_nos...@mvps.org.nospam> wrote:
> > On Jul 21, 10:52 pm, "Carl Daniel [VC++ MVP]"
> > <cpdaniel_remove_this_and_nos...@mvps.org.nospam> wrote:
[quoted text clipped - 27 lines]
>
> -cd
Cool - thanks!
Ben Voigt [C++ MVP] - 23 Jul 2007 19:10 GMT
>> Hi,
>>
[quoted text clipped - 12 lines]
> you're unlikely to find a step by step tutorial that tells you exactly
> what you need to know.
I don't know about that. In many cases, changing "class" to "public ref
class" is more than halfway there.
> If you can provide more information about the C++ class, I or others can
> give you more detailed help.
[quoted text clipped - 5 lines]
>
> -cd