Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How porting TRTLCriticalSection to .net

1 view
Skip to first unread message

Software_EDMI

unread,
Oct 18, 2005, 9:26:58 PM10/18/05
to
Hi,

How to porting such Delphi 7 code into .net?
Such as, EnterCriticalSection(),LeaveCriticalSection(),
InitializeCriticalSection(); etc.

Thanks a lot.

Regards,
Chunfu


Marc Rohloff [TeamB]

unread,
Oct 18, 2005, 11:57:23 PM10/18/05
to
On Wed, 19 Oct 2005 09:26:58 +0800, Software_EDMI wrote:

> How to porting such Delphi 7 code into .net?
> Such as, EnterCriticalSection(),LeaveCriticalSection(),
> InitializeCriticalSection(); etc.

You probably want to use an instance of System.Threading.Monitor, if
this is not exactly what you want there are several other options in
the System.Threading namespace.

--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com

Software_EDMI

unread,
Oct 19, 2005, 8:47:27 PM10/19/05
to
Thanks a lot!

Where can I find all the porting Delphi7 to Delphi 2005 .Net information?
I encountered another type: PWOHandleArray , How porting this?

Regards,
Chunfu.

"Marc Rohloff [TeamB]" <"on request"> wrote in message
news:z1yoe6v3...@marcrohloff.com...

Marc Rohloff [TeamB]

unread,
Oct 19, 2005, 10:18:59 PM10/19/05
to
On Thu, 20 Oct 2005 08:47:27 +0800, Software_EDMI wrote:

> Where can I find all the porting Delphi7 to Delphi 2005 .Net information?

Here is a good start.

> I encountered another type: PWOHandleArray , How porting this?

I have never heard of this. Is it a Delphi class?

Software_EDMI

unread,
Oct 20, 2005, 4:00:15 AM10/20/05
to
It is defined in Windows unit.
TWOHandleArray = array[0..MAXIMUM_WAIT_OBJECTS - 1] of THandle;
PWOHandleArray = ^TWOHandleArray;
I choose copy this to my own unit.

Actually what I want is to porting a lot of existing Delphi 7 code to
Compact Framework in Delphi 2005.
My first step is porting it to VCL.Net. After comments a lot of code, I can
compile it in VCL.Net now.
Now I try to porting it to CF.Net. I find there are even not Windows,
System, SysUtils etc "System" units i can use
in CF.Net. The existing code replys extensively on these units, what should
i do now? Need to use pure CF.Net only
in Delphi 2005? If so maybe stratch with C# in VisualStudio is better.

I also post this in dotnetPreview group. I am just feels very frustrated
when doing this, so forgive this double-posting.

Thanks.

"Marc Rohloff [TeamB]" <"on request"> wrote in message

news:iiw3yvc2...@marcrohloff.com...

Marc Rohloff [TeamB]

unread,
Oct 20, 2005, 7:23:08 PM10/20/05
to
On Thu, 20 Oct 2005 16:00:15 +0800, Software_EDMI wrote:

> I also post this in dotnetPreview group. I am just feels very frustrated
> when doing this, so forgive this double-posting.

As much as I understand your frustration please don't cross-post it si
against the newsgroup regulations.

danny heijl

unread,
Oct 23, 2005, 6:33:10 AM10/23/05
to
Software_EDMI schreef:


> Actually what I want is to porting a lot of existing Delphi 7 code to
> Compact Framework in Delphi 2005.
> My first step is porting it to VCL.Net. After comments a lot of code, I can
> compile it in VCL.Net now.
> Now I try to porting it to CF.Net. I find there are even not Windows,
> System, SysUtils etc "System" units i can use
> in CF.Net. The existing code replys extensively on these units, what should
> i do now? Need to use pure CF.Net only
> in Delphi 2005? If so maybe stratch with C# in VisualStudio is better.

You will also discover that a lot of the .Net framework classes lack key
properties and methods in the Compact Framework, or that the .Net
framework classes simply lack the feature that you need even inn the
full framework.

An example: the .Net Event class can not create Named Events, so you
have to implement a descendent of WaitHandle that implements a named
event if you need that functionality.

Then when you port to the CF you discover that the CF WaitHandle
implementation lacks key properties/methods that prevent your NamedEvent
class form compiling etc...

Have a look at OpenNetCf.org for more info
(http://www.opennetcf.org/CategoryView.aspx?category=Home).

Note that I am talking of my experience with C# in VS.Net here, not Delphi.

Danny
---

0 new messages