C code from C#. 
Author Message
 C code from C#.

It was probably a mistake combining 2 questions as 1 in my previous
post.

Can someone please outline the various ways of using C code with C#.
Using Dll's, COM, etc. NOTE: I have both .net and Visual C++ v.6.

I am a bit confused and want to find a simple way of doing this.

Thanks,

..matthew



Fri, 19 Nov 2004 23:22:28 GMT  
 C code from C#.
Matt,

    There are a number of ways that you can interlace all of this
technology.  .NET will allow you to make calls into unmanaged code, whether
it be in the form of DLL's exporting functions or COM components.

    You have to decide what works best for you.  What are you trying to do,
and what do you have available to you?

--
               - Nicholas Paldino [.NET MVP]


Quote:
> It was probably a mistake combining 2 questions as 1 in my previous
> post.

> Can someone please outline the various ways of using C code with C#.
> Using Dll's, COM, etc. NOTE: I have both .net and Visual C++ v.6.

> I am a bit confused and want to find a simple way of doing this.

> Thanks,

> ..matthew



Fri, 19 Nov 2004 23:30:46 GMT  
 C code from C#.
Matt, MSDN has a great summary of ways to interact with unmanaged code.
(watch out for line wrap)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgu...
l/cpconinteroperatingwithunmanagedcode.asp

--
Greg
http://www.claritycon.com/


Quote:
> It was probably a mistake combining 2 questions as 1 in my previous
> post.

> Can someone please outline the various ways of using C code with C#.
> Using Dll's, COM, etc. NOTE: I have both .net and Visual C++ v.6.

> I am a bit confused and want to find a simple way of doing this.

> Thanks,

> ..matthew



Fri, 19 Nov 2004 23:52:17 GMT  
 C code from C#.

Quote:

>     There are a number of ways that you can interlace all of this
> technology.  .NET will allow you to make calls into unmanaged code, whether
> it be in the form of DLL's exporting functions or COM components.

>     You have to decide what works best for you.  What are you trying to do,
> and what do you have available to you?

Hi again Nick,

I have both .net and Visual C++ v.6. I don't really know the difference
between COM components and a dll because the only COM I've used came in
the form of a dll, for which I had to create a Runtime Callable Wrapper
using TlbImp.exe so I could use it with C#.

When making my dll for Tidy I didn't export any functions I guess that's
why I got the C# unhandled exception 'entry point error' before; do you
think that is why?

What I am trying to do is call 2 C functions both of which will control
the tidying process (see below for a recap from my earlier post), and
return a boolean success value and an error message. I'm going to write
these C functions so that the number of [dllimport]'s in my C# code is
kept to a minimum. But if I use COM maybe I won't have to to do this as
I don't think I had to import any functions when I used it before I just
linked the dll at compile time.

Tidy Recap: I've got the C open source code for a useful program called
Tidy which turns malformed html into well formed 'tidied' html or even
xml. The Tidy source is quite large so I don't want to port it to C#.
But I do need to access its functions from C#.

What do you suggest I do?

Thanks and regards,

..matthew

Quote:


> > It was probably a mistake combining 2 questions as 1 in my previous
> > post.

> > Can someone please outline the various ways of using C code with C#.
> > Using Dll's, COM, etc. NOTE: I have both .net and Visual C++ v.6.

> > I am a bit confused and want to find a simple way of doing this.

> > Thanks,

> > ..matthew



Fri, 19 Nov 2004 23:58:41 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Newbie: separate big .cs file into small .cs files

2. Include code in other Cs files

3. newbe/cs student, need help w/ code

4. Compile CS source code using ICodeCompiler

5. cs source code

6. include another form(cs) in C#?

7. How to show/call Form2.cs from Form1.cs ?

8. New C# Source Code Sample - Running JScript.NET Code from C# Apps

9. Reuse of cs files, namespace, arch advice pls

10. word - automatic numbering/bold/underline/italics

11. How to Generate .cs file at Runtime

12. Serial.cs

 

 
Powered by phpBB® Forum Software