Using Delphi DLL from VB.NET

R

Ricardo Magalhaes

Hi

I need to call Delphi DLL from my VB.NET application. I try to add a
reference into my Visual Studio Solution but an error occurs saying that it
must be an COM DLL.

I have many Delphi DLL from an old application and to rewrite then I will
take a lot of time.

There are any other way to do this instead convert to COM DLL ? Where can I
find examples ?

Regards
Ricardo
 
G

Guest

You will most likely end up getting into Windows API calls. If you have used
this before from COM, make a wrapper. Sure, you end up with two wrappers (one
for Delphi and one for your COM component), but it can work.

The other direction is to look at how other non-COM components are called
(PInvoke?). A quick google search should have at least one API type example.

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

***************************
Think Outside the Box!
***************************
 
R

Ricardo Magalhaes

And About Using:

Namespace System.Runtime.InteropServices
<DllImport("DllCodeCpp.dll")>

?????


"Cowboy (Gregory A. Beamer) - MVP" <[email protected]>
escreveu na mensagem
 
A

Atul

If it is a COM dll, you can still access it by using COM Interop. You can
add references to COM dlls in a VS project. Also take a look at tlbimp.exe
tool.

-Atul
http://www.ssware.com/
Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net
 
N

Nick Malik [Microsoft]

It looks like you are saying that you have a DLL that is NOT a COM dll,
written in Delphi, and that you wish to call it from your vb.net app.

You can do this with PInvoke. If your app had been written in C++, I'd say
to use a managed C++ wrapper.

Start here:
http://msdn.microsoft.com/library/d.../en-us/vbcn7/html/vaconCallingWindowsAPIs.asp

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Joined
Feb 28, 2008
Messages
1
Reaction score
0
allmost same problem

hi all
i dont know if this the right place to post but im so lost :(
im calling Delphi dll function from vb.net 2008
after weeks of trying all i get is protected memory access error(using DllImport statement!

i have the source code for the dll (in Delphi sure) but i dont know what to change or how to call the function correctly

more information available if needed
plz help ASAP its for my graduation project :saint:
thx
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top