473,473 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Import a dll written in delphi into C#

Hi there!

I want to import a dll that is written in borland delphi.

The function looks as follow:
DLLEXP HRESULT DLLCALL LoadFromFile( char * TheFileName )

My code in C#:
[DllImport( "ipascom.dll", EntryPoint = "LoadFromFile", SetLastError =
true,
CharSet = CharSet.Ansi, ExactSpelling = false,
CallingConvention = CallingConvention.StdCall )]

private static extern uint LoadFromFile( [MarshalAs(
UnmanagedType.LPStr )] string fileName );

What's wrong with this code snippet? There's a problem with the string
parameter...

Thanks,
- Michael

Nov 17 '05 #1
0 894

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ktxn1020 | last post by:
Hi Experts, I built a scrip file which cleans up the old log files starting from the oldest till the necessary free space on the drive reaches. The script ran well independently using Python's...
132
by: Kevin Spencer | last post by:
About 2 years ago, and as recently as perhaps 1 year ago, I can recall seeing many posts about what language to use with ASP.Net. The consensus was that employers paid more for C# programmers, and...
2
by: Chavoux | last post by:
Hi When I try to compile the following code I get an error: ) { cout << "starting... Creating COMPORT1"; int x = CreatePort("COM1"); } </code> I'm using Dev-C++ (minGW compiler) on Windows...
9
by: fegge | last post by:
i have written script save as hello.py. i can run it. but why cant i import it as a modular in other programs?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.