Can .Net talk to regular C Dll's

B

Brad Panek

I have tried finding some information on this by searching the News
groups however I have not found anything yet, so I thank you in
advance for your information on these questions.

1. Can VB.Net or VC# or VC++.Net communicate with regular C Dll's
created in Visual C++ 6.0?
I know I can call these from VB 6.0.

2. Could you recommend which .Net language is best to use?
I will need to call VC++ 6 regular Dll's, and I need to use the
Windows Media Player. I am most familiar with VB 6 but would like to
use one of the .Net languages in order to move ahead my abilities and
keep current with MS technology.

Thanks for your help.
 
S

Scott M.

1. Can VB.Net or VC# or VC++.Net communicate with regular C Dll's
created in Visual C++ 6.0?
I know I can call these from VB 6.0.

Sure. You just make a COM reference to the .dll in quesiton.
2. Could you recommend which .Net language is best to use?
I will need to call VC++ 6 regular Dll's, and I need to use the
Windows Media Player. I am most familiar with VB 6 but would like to
use one of the .Net languages in order to move ahead my abilities and
keep current with MS technology.

There is no 'best' .NET language. All the languages were designed to work
on an equal footing. It really comes down to a matter of which language you
prefer.
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (Brad Panek) scripsit:
I have tried finding some information on this by searching the News
groups however I have not found anything yet, so I thank you in
advance for your information on these questions.

1. Can VB.Net or VC# or VC++.Net communicate with regular C Dll's
created in Visual C++ 6.0?
I know I can call these from VB 6.0.

Yes. Have a look at the 'Declare' keyword and the 'DllImportAttribute'
class.
2. Could you recommend which .Net language is best to use?
I will need to call VC++ 6 regular Dll's, and I need to use the
Windows Media Player. I am most familiar with VB 6 but would like to
use one of the .Net languages in order to move ahead my abilities and
keep current with MS technology.

Use the .NET programming language you like most. Personally, I don't
recommend using MC++ or J# for new projects, but instead VB.NET (or C#,
if you don't get sick from the semicolons and curly braces).
 
G

Guest

I recommend using C++ for everything, but again, its a matter of preference and requirements, you wouldn't write a mission critical application or a driver in VB

Technically, .NET can call any dll as long as the dll implements one of the interfaces supported by .NET. In VC++, regardless of the version, it must support either the COM or API interfaces

Mark
 
C

CJ Taylor

Scott M. said:
Sure. You just make a COM reference to the .dll in quesiton.

*regular* Dll's do not expose COM, you have to use the Declare (VB/VB.NET)
keyword or [DllImportAttribute] (.NET all)
 
S

Sven Groot

Scott said:
Sure. You just make a COM reference to the .dll in quesiton.

I'm pretty sure he means a plain old C DLL which exports functions, not a
COM DLL. In which case he needs PInvoke, not COM Interop.
 
C

CJ Taylor

Mark said:
I recommend using C++ for everything, but again, its a matter of
preference and requirements, you wouldn't write a mission critical
application or a driver in VB.
What? Thats one of the most assinine things I have ever heard.
Technically, .NET can call any dll as long as the dll implements one of
the interfaces supported by .NET. In VC++, regardless of the version, it
must support either the COM or API interfaces.
What on earth are you talking about?
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?TWFyaw==?= said:
I recommend using C++ for everything, but again, its a matter of
preference and requirements, you wouldn't write a mission critical
application or a driver in VB.

ACK, writing drivers is not a job for VB.NET, but I believe that nobody
really wants to do that.
 
S

Scott M.

Mark said:
I recommend using C++ for everything, but again, its a matter of
preference and requirements, you wouldn't write a mission critical
application or a driver in VB.

What are you talking about. VB.NET is not VB 6.0. It is just as good as
any other .NET language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top