Re: Make a DLL in C# for FoxPro
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Jan 2008 13:25:31 -0500
Andrus,
See inline:
"Andrus" <kobruleht2@xxxxxx> wrote in message
news:%238RTi6pYIHA.1168@xxxxxxxxxxxxxxxxxxxxxxx
VFP can not consume .NET components directly. You have to use a
bridging technology such as COM interop, as both .NET and VFP support the
creation/consumption of COM components (in this case, all that is needed
is for .NET to support the creation of COM components and for VFP to
support the consumption of them).
COM disadventages:
1. Forgot single click installation. Forgot zero footprint. Forgot running
from quest account -
It requires dll registration on every customer computer.
Wrong on all counts. You can use reg-free COM to use COM components
without registering them. Also, there is nothing that prevents the use of
COM objects from a guest account. Com objects are not limited by user
accounts (unless they are hosted in COM+, which one can specify
authorization to components).
Even still, registering the components is NOT that big of a deal. Also,
going the route in the blog entry that you pointed out ^still^ uses COM
interop, it just gets around the registration aspect of it. To be quite
frank, it's a ton of work for minimal gain.
2. .NET is not usable
Most .NET components do not expose COM interface. Almost every .NET
component requires to create wrapper dll.
Again, not true. Most of the types in the framework have the ComVisible
attribute attached to them. You will have to create your specific types so
that they are visible in COM, but most of the framework types are already
visible.
So COM is dead end.
Not by a longshot. The links you provided here both have workarounds
which eventally drop down to C++ to use it as a shim (and in some cases, COM
interop anyways), which is really MUCH more work than correctly implementing
a .NET component as a COM component.
If ^anyone^ is going to go through that much work just to get around
using COM, then they deserve the headaches that come from such a roundabout
solution.
Also, COM has been around for the past 15 years, it's deeply integrated
into Windows, and isn't going anywhere soon. Yes, it does require one to be
diligent in regards to versioning and registration, but they really aren't
such big issues. If they were, the technology wouldn't have matured to the
point where it has (where many other technologies and applications are built
on top of it).
It just requires a little understanding of it. Not reams of C++ code
and shims which produce minimal gains for maximal effort.
COM is not "dreaded" and it's not hard to understand or use. You just
have to be willing to understand it.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
Your links don't support the idea that VPF can support consuming .NET
components directly. The first is a link to an ASP.NET-like environment
which is implemented on top of FoxPro.
From first link you can reach to the link
http://www.west-wind.com/wconnect/weblog/ShowEntry.blog?id=631
Which offers a way to Host the CLR directly. It shows wrapper dll source
code and allows to download samples.
The second link shows how to consume VFP functions in .NET (VB.NET
specifically) and it is through COM interop.
From second link you can reach to the link
http://blogs.msdn.com/calvin_hsia/archive/2006/08/07/691467.aspx
which contains C++ code to host the CLR as sample.
So both links provide ways to use .NET without dreaded COM interop from
VFP.
Andrus.
.
- Follow-Ups:
- Re: Make a DLL in C# for FoxPro
- From: Andrus
- Re: Make a DLL in C# for FoxPro
- From: Andrus
- Re: Make a DLL in C# for FoxPro
- References:
- Make a DLL in C# for FoxPro
- From: CSLCO
- Re: Make a DLL in C# for FoxPro
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Make a DLL in C# for FoxPro
- From: Andrus
- Re: Make a DLL in C# for FoxPro
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Make a DLL in C# for FoxPro
- From: Andrus
- Make a DLL in C# for FoxPro
- Prev by Date: Re: static keyword
- Next by Date: Re: Dis-arrayed arrays
- Previous by thread: Re: Make a DLL in C# for FoxPro
- Next by thread: Re: Make a DLL in C# for FoxPro
- Index(es):
Relevant Pages
|