473,322 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Migrating from Delphi....

I am migrating my some applications from Delphi to C#. But...

Yes But I don't know C# professionally. I am using DLL in delphi like this :

.....
const
RFID_103_485IO = 'Cihaz.dll';

Function SearchPort (Prm1:LongWord) :LongWord; cdecl; External
RFID_103_485IO name 'SearchPort';
Function CheckPort (Prm1:LongWord) :LongWord; cdecl; External
RFID_103_485IO name 'CheckPort';
Function SearchReader (Prm1:LongWord; Prm2:LongWord) :LongWord; cdecl;
External RFID_103_485IO name 'SearchReader';
Function CheckReader (Prm1:LongWord; Prm2:LongWord) :LongWord; cdecl;
External RFID_103_485IO name 'CheckReader';

....

I am using it in Delphi :

.....
ResultNumber := CheckReader(n, m);

....

But how can I use my DLL functions in C#. I am trying below code in my
class. But it doesn't work. Could you help me ?

using System;

using System.Runtime.InteropServices;

namespace MyDllLoadClass

{

public class Reader

{

[DllImport("Cihaz.dll", CallingConvention=CallingConvention.Cdecl)]

static extern void SearchPort (uint Prm1);
[DllImport("Cihaz.dll", CallingConvention=CallingConvention.Cdecl)]

static extern int CheckPort (uint Prm1);

[DllImport("Cihaz.dll", CallingConvention=CallingConvention.Cdecl)]

static extern void SearchReader (uint Prm1, uint Prm2);

}

}

I am trying using this in my other class

label1.Text = Convert.ToString(MyDllLoadClass.Reader.CheckPort(i ));



Nov 16 '05 #1
10 3126
I thought Borland was bringing out Delphi.net -and if so wouldnt it be
better to retain your code base int delphi and move them across into
delphi.net?
--

--

Br,
Mark Broadbent
mcdba , mcse+i
=============
"Arda Han" <ar**@han.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
I am migrating my some applications from Delphi to C#. But...

Yes But I don't know C# professionally. I am using DLL in delphi like this :
....
const
RFID_103_485IO = 'Cihaz.dll';

Function SearchPort (Prm1:LongWord) :LongWord; cdecl; External
RFID_103_485IO name 'SearchPort';
Function CheckPort (Prm1:LongWord) :LongWord; cdecl; External
RFID_103_485IO name 'CheckPort';
Function SearchReader (Prm1:LongWord; Prm2:LongWord) :LongWord; cdecl;
External RFID_103_485IO name 'SearchReader';
Function CheckReader (Prm1:LongWord; Prm2:LongWord) :LongWord; cdecl;
External RFID_103_485IO name 'CheckReader';

...

I am using it in Delphi :

....
ResultNumber := CheckReader(n, m);

...

But how can I use my DLL functions in C#. I am trying below code in my
class. But it doesn't work. Could you help me ?

using System;

using System.Runtime.InteropServices;

namespace MyDllLoadClass

{

public class Reader

{

[DllImport("Cihaz.dll", CallingConvention=CallingConvention.Cdecl)]

static extern void SearchPort (uint Prm1);
[DllImport("Cihaz.dll", CallingConvention=CallingConvention.Cdecl)]

static extern int CheckPort (uint Prm1);

[DllImport("Cihaz.dll", CallingConvention=CallingConvention.Cdecl)]

static extern void SearchReader (uint Prm1, uint Prm2);

}

}

I am trying using this in my other class

label1.Text = Convert.ToString(MyDllLoadClass.Reader.CheckPort(i ));


Nov 16 '05 #2
I thought Borland was bringing out Delphi.net -and if so wouldnt it be
better to retain your code base int delphi and move them across into
delphi.net?


No it wouldn't (sadly said by a die hard delphi fan since version 1)
Its too buggy and unworkable for commercial use. Borland have issued a very
unfinished product this time.
Don't waste your pennies on Delphi, go c#. The 2 products are now so
similar in concept it's worth the move over for those people who are able to
pick and choose. I can't see D surviving for much longer.
C# is better for your CV too, lots of jobs there at the moment and not so
many for Delphi.
Nov 16 '05 #3
Claire wrote:
I thought Borland was bringing out Delphi.net -and if so wouldnt it be
better to retain your code base int delphi and move them across into
delphi.net?
No it wouldn't (sadly said by a die hard delphi fan since version 1)
Its too buggy and unworkable for commercial use. Borland have issued a very
unfinished product this time.


I haven't tried D8, personally, but I've heard other people say this too.

Just out of curiosity, have you tried D8 with the two (IIRC) patches
applied? Allegedly this makes it much more stable.
Don't waste your pennies on Delphi, go c#. The 2 products are now so
similar in concept it's worth the move over for those people who are able to
pick and choose. I can't see D surviving for much longer.
C# is better for your CV too, lots of jobs there at the moment and not so
many for Delphi.

Nov 16 '05 #4
That is a real shame. I bought Delphi 1 too with my hard earned
pennies -although I never really spent enough time with it I thought it was
a great product (version 5 was pretty good too).

Where are all these C# jobs then? Im looking for something that can expand
my skills (hopefully with ado programming) but not expect me to be an C#
wizard. Im in UK cambridge but dont see too many jobs in C# mostly C++.
--

--

Br,
Mark Broadbent
mcdba , mcse+i
=============
"C# Learner" <cs****@learner.here> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Claire wrote:
I thought Borland was bringing out Delphi.net -and if so wouldnt it be
better to retain your code base int delphi and move them across into
delphi.net?


No it wouldn't (sadly said by a die hard delphi fan since version 1)
Its too buggy and unworkable for commercial use. Borland have issued a very unfinished product this time.


I haven't tried D8, personally, but I've heard other people say this too.

Just out of curiosity, have you tried D8 with the two (IIRC) patches
applied? Allegedly this makes it much more stable.
Don't waste your pennies on Delphi, go c#. The 2 products are now so
similar in concept it's worth the move over for those people who are able to pick and choose. I can't see D surviving for much longer.
C# is better for your CV too, lots of jobs there at the moment and not so many for Delphi.

Nov 16 '05 #5
Mark Broadbent wrote:
That is a real shame. I bought Delphi 1 too with my hard earned
pennies -although I never really spent enough time with it I thought it was
a great product (version 5 was pretty good too).
Myself, I've used several versions of Delphi, with the latest being
version 7. It's a great language/framework and the Win32 version is a
very attractive alternative to (V)C++/MFC, IMO.
Where are all these C# jobs then? Im looking for something that can expand
my skills (hopefully with ado programming) but not expect me to be an C#
wizard. Im in UK cambridge but dont see too many jobs in C# mostly C++.


IIRC (from reading his web site), Jon Skeet's in Cambridge. Maybe he
could hook you up? :-P
Nov 16 '05 #6
C# Learner <cs****@learner.here> wrote:
Where are all these C# jobs then? Im looking for something that can expand
my skills (hopefully with ado programming) but not expect me to be an C#
wizard. Im in UK cambridge but dont see too many jobs in C# mostly C++.


IIRC (from reading his web site), Jon Skeet's in Cambridge. Maybe he
could hook you up? :-P


Nah - I *was* in Cambridge. I don't know of many C# jobs either - I'm
just happy to be in one :) (I'd be happy in another Java job, too...)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #7
Thanks friends for answer my question !

Delphi.Net ? It is calling now "Bug Hell". I want write about me why I want
change my software skill to C#.

Because MS oriented software industry. Why I use other languages. I agree
Delphi is powerfully language and now I am wining my salary from Delphi. But
it is using new technologies a few months (least 6 month or 1 year) later.
In this way I want change my skill to C# (Because my first language is C and
I hate VB)

Anybody know answer of my question?

Thanks

"Claire" <bl****@blahhhhh.com>, haber iletisinde şunları
yazdı:uD*************@TK2MSFTNGP09.phx.gbl...
I thought Borland was bringing out Delphi.net -and if so wouldnt it be
better to retain your code base int delphi and move them across into
delphi.net?
No it wouldn't (sadly said by a die hard delphi fan since version 1)
Its too buggy and unworkable for commercial use. Borland have issued a

very unfinished product this time.
Don't waste your pennies on Delphi, go c#. The 2 products are now so
similar in concept it's worth the move over for those people who are able to pick and choose. I can't see D surviving for much longer.
C# is better for your CV too, lots of jobs there at the moment and not so
many for Delphi.

Nov 16 '05 #8
>No it wouldn't (sadly said by a die hard delphi fan since version 1)
Its too buggy and unworkable for commercial use. Borland have issued a very
unfinished product this time.
Can't confirm that at all - Delphi 8 (with update 2 installed) works
fine for me.
Don't waste your pennies on Delphi, go c#. The 2 products are now so
similar in concept it's worth the move over for those people who are able to
pick and choose. I can't see D surviving for much longer.
Well, Turbo Pascal's and Delphi's death have been annouced ever since
the product's been on the market, and it's still here and going strong
- don't waste YOUR pennies betting on Delphi's demise!

And yes, C# and Delphi are very similar - actually, Delphites have had
most of the great new .NET features like a great framework and
productivity ever since the product came out in Feb 1995 :-) The rest
of the programming world has finally woken up to that "new paradigm"
now ;-)
C# is better for your CV too, lots of jobs there at the moment and not so
many for Delphi.


Depends - plus, what good are TONS of jobs, I only need ONE - thank
you! Again - the number of Delphi jobs has always been earmarked as
being very slim - I've managed to hold on to several over the years,
no problem. Don't let public perception fool you, and don't be a fool
yourself and foster that (inaccurate) public perception even
further....

Marc

================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Nov 16 '05 #9
Jon Skeet [C# MVP] wrote:
C# Learner <cs****@learner.here> wrote:
IIRC (from reading his web site), Jon Skeet's in Cambridge. Maybe he
could hook you up? :-P
Nah - I *was* in Cambridge.


Ah, okay.
I don't know of many C# jobs either - I'm
just happy to be in one :)
Kewl :-)
(I'd be happy in another Java job, too...)


Yeah, I'd be content with any programming job that doesn't involve using
a framework like MFC or a language like Fortran ;-)
Nov 16 '05 #10
oh dear doesn't sound good. Maybe I should leave IT and get myself a proper
career. I could one day aspire to getting my McDonalds 5 stars :D

Hopefully things will pick up, things seem to be improving but guess time
will tell.
--

--

Br,
Mark Broadbent
mcdba , mcse+i
=============
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
C# Learner <cs****@learner.here> wrote:
Where are all these C# jobs then? Im looking for something that can expand my skills (hopefully with ado programming) but not expect me to be an C# wizard. Im in UK cambridge but dont see too many jobs in C# mostly
C++.
IIRC (from reading his web site), Jon Skeet's in Cambridge. Maybe he
could hook you up? :-P


Nah - I *was* in Cambridge. I don't know of many C# jobs either - I'm
just happy to be in one :) (I'd be happy in another Java job, too...)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #11

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

Similar topics

6
by: Erva | last post by:
Hi, Is there someone who has moved from Delphi to VS.NET? I'am using Delphi currently but seriously considering to moving VS.NET. I would like to hear if someone has already done that, is it...
6
by: Shai Levi | last post by:
Hi, I'm trying to migrate native c++ class to managed c++ class. The native class header definition looks as: class NativeClass { public: typedef void (CbFunc1)(int n,void* p);
3
by: lukeharpin | last post by:
Currently I have been developing applications in Delphi 7. Recently I meet up with a friend of mine who previously developed in Delphi, from version 1 - 7. When Delphi 8 .net was release he found...
7
by: Sanjay Kedare | last post by:
Hi, I am evaluating various alternatives of converting Delphi (Ver 4.0) screens to C# screens. Are there any tools available for such conversion? if yes how much conversion do they achieve? The...
13
by: lukeharpin | last post by:
Hi World, We have been developing Engineering software in Delphi 3,4,5,6,7 for a few years now. This morning we had a discussion about OOP and re-programming the software to which the question...
8
by: BugHunter | last post by:
Hello C/C++ Gurus, Could someone give me a quick hint, how to make this piece of C code Borland Builder-worthy? Or just explain the meaning of this piece of code. I try to compile a...
4
by: =?Utf-8?B?ZGF2ZWJ5dGhlc2Vh?= | last post by:
Dear List, We have a large application written in Delphi. I am writing a mobile app written in .NET (C#) which reads and writes into the Delphi applications Oracle database via a .NET Web...
11
by: gnuist006 | last post by:
Is there a Delphi equivalent in the C world or Scheme/LISP world ? Recently, Delphi is in resurgence. In Russia people are using like crazy. For example, Bolega has written a free image...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.