🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.vcl.components.using.dotnet
3 messages
3 total messages Started by A Nonymous Fri, 06 Apr 2007 16:55
How to use a .NET DLL from Win32?
#233
Author: A Nonymous
Date: Fri, 06 Apr 2007 16:55
35 lines
2379 bytes
The company I work produces a couple of Win32 applications.  Lately there 
has been a lot of interest in porting some of our apps to smart phones and 
Win CE devices. Basically the .NET Compact Framework.

It looks to me like the only viable development environment for .NET CF is 
C#.  I tried the Delphi CF helper thing and it is interesting but IMHO not 
quite ready for "prime time".

Anyhow, rewriting any of our major apps in C# is out of the question.  The 
visual components are quite sparse and make me feel like I've set the way 
back machine for 20 years ago.  On the other hand it doesn't look too bad 
for some of the low level, non visual objects.  I think I can convert most 
of our core objects that encapsulate the majority of our business rules 
without too much trouble.

I did a test and was able to create a .NET DLL and a test app that used the 
DLL in C# for my smart phone.  Actually it was pretty easy, and I did it 
before I realized that .NET CF would be a problem for some of the larger 
apps.

For the smart phone I am going o have to use C# and .NET CF, but this will 
also be a limited subset of our main app.  I just don't want to maintain 2 
code bases for the core objects, so, I got the idea that perhaps I could 
put the core objects (non visual) in a .NET CF DLL, and use the same DLL 
for the PC app and the smart phone app.

So far my attempts have been unsuccessful, but I am hoping someone here can 
point me to some information or an example of how to use a .NET DLL from a 
Win32 application.

Sorry for the LONG explanation, but I wanted to show my thought process 
just incase someone had an alternate suggestion.

Thanks in advance,
A.
Re: How to use a .NET DLL from Win32?
#234
Author: Vertuas
Date: Sun, 01 Jul 2007 11:10
72 lines
3889 bytes
Hello,

I was recently in a similiat situation to yourself.  We outsourced some work 
and got a .NET dll back!

We mainly use Delphi 7 for developement, mainly because it cost us a fortune 
and haven't needed .net, so didn't upgrade.  We have been forced to upgraded 
and purchase a licence for delphi 2005.

In delphi 2005, it took me a little while to figure out how to impost the 
.NET dll, but once i did i was amazed how easy it was.

Note : your project needs to be a .NET based project!

Place the requuired DLL in your project folder.  Next go to project menu and 
choose Import.  When the fileopen dialog appears, navigate to you project 
fold and change the file filter to .dll.

Click open.

Delphi will import the .NET dll into you project.

Even though your project is a Delphi .NET project, you can still use all of 
the win32 API units, so you should be able to use you old code aswell.  The 
annoting thing is that you cannot import .NET DLLs into windows 32 based 
projects!

Hope this helps you

Vertuas



"A Nonymous" <anonymous@hotmail.com> wrote in message 
news:Xns990A6F30B747Danonymoushotmailcom@207.105.83.66...
> The company I work produces a couple of Win32 applications.  Lately there
> has been a lot of interest in porting some of our apps to smart phones and
> Win CE devices. Basically the .NET Compact Framework.
>
> It looks to me like the only viable development environment for .NET CF is
> C#.  I tried the Delphi CF helper thing and it is interesting but IMHO not
> quite ready for "prime time".
>
> Anyhow, rewriting any of our major apps in C# is out of the question.  The
> visual components are quite sparse and make me feel like I've set the way
> back machine for 20 years ago.  On the other hand it doesn't look too bad
> for some of the low level, non visual objects.  I think I can convert most
> of our core objects that encapsulate the majority of our business rules
> without too much trouble.
>
> I did a test and was able to create a .NET DLL and a test app that used 
> the
> DLL in C# for my smart phone.  Actually it was pretty easy, and I did it
> before I realized that .NET CF would be a problem for some of the larger
> apps.
>
> For the smart phone I am going o have to use C# and .NET CF, but this will
> also be a limited subset of our main app.  I just don't want to maintain 2
> code bases for the core objects, so, I got the idea that perhaps I could
> put the core objects (non visual) in a .NET CF DLL, and use the same DLL
> for the PC app and the smart phone app.
>
> So far my attempts have been unsuccessful, but I am hoping someone here 
> can
> point me to some information or an example of how to use a .NET DLL from a
> Win32 application.
>
> Sorry for the LONG explanation, but I wanted to show my thought process
> just incase someone had an alternate suggestion.
>
> Thanks in advance,
> A. 
Re: How to use a .NET DLL from Win32?
#235
Author: OD
Date: Tue, 17 Jul 2007 13:35
5 lines
2354 bytes
Using a .NET dll in a win32 app is called CLR Hosting. Just search this 
on google on you'll find a lot of papers and samples.

-- 
OD
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads