Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling C# dll from VFP
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Calling C# dll from VFP
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01643829
Message ID:
01643829
Views:
79
Hi everybody,

I made a simple dll library project targeting NET 4.5.2 at the moment.

It is just a simple public class with 2 public methods with several parameters including few passed by reference and one last parameter with default value (the methods are the same, that's why I added last parameter with default value, that value is not going to be passed from VFP).

In my solution I also added test project and tested both methods and also a timeout situation.

Ok, so far so good.

Now, I want to be able to call these two methods as functions from VFP code.

We have following example of usage of another project:
if file(addbs(justpath(.cProgramPath)) + "Name1.Name2.dll")
				try
					declare integer InitializeConnection in "Name1.Name2.Netlink x86.dll" string, string
					lnInitializeCode = InitializeConnection(.cODBC_DSN, .cDatabase)
That particular solution is very complex and consists of many projects including a few C++.

It also uses DllExport.cs class (attribute) and decorates the methods calls with that attribute. Also, that class in another project is static and uses static methods while mine is not. And also the other project doesn't pass parameters by reference.

So, I am trying to figure out my course of action and what I am supposed to do. My colleague who is working on the VFP piece of it will be expecting using the functions similar to what I posted above. Although it is probably not 100% requirement and we can try to use it through

object = createobject('') approach if it's somewhat easier.

I used that and wwNetBridge in another VFP project. I would not want to add that dependency in this VFP project as well.

Thanks a lot in advance for suggestions.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform