Migrating from Delphi....

  • Thread starter Thread starter Arda Han
  • Start date Start date
A

Arda Han

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));
 
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
=============
 
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.
 
Claire said:
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.
 
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
=============
 
Mark said:
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
 
C# Learner said:
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...)
 
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
 
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
 
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
=============
 
Back
Top