Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create a .NET DLL for VFP use
Message
From
07/11/2013 10:05:20
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01587470
Message ID:
01587489
Views:
60
Thank you Viv,

It worked... :)


>>Hi All,
>>We need a .NET dll, it should work with VFP. Our developer generates .NET DLL but VFP cannot see that DLL. That doesn't matter .COM .DLL or not. Just work with VFP enough for us... What he should do when generates DLL for VFP?
>
>Should be straightforward. Create a .NET class library. e.g:
namespace ClassLibrary1
>{
>    [ClassInterface(ClassInterfaceType.AutoDual)]
>    [ProgId("Class1Library.Class1")]
>    public class Class1
>    {
>        [ComVisible(true)]
>        public string Doit()
>        {
>            return "Hello World";
>        }
>    }
>}
In the project 'Properties/Application' page click 'Assembly Information' button and make sure 'Make assembly COM visible' is checked. Build the application. If all is well then Class1Library.Class1 should appear in the registry.
>
>In VFP:
object = CREATEOBJECT("Class1Library.Class1")
>? object.Doit()
Note I deliberately made this a bit more complicated than ness. in that I've defined a ProgId that is different to the Class namespace.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform