-1

need to acces manually functional DLL (C++) with PINVOKE method, i don't how to access to signatures, this functional DLL is make for extern developers. exists another pinvoke method to return all values?

Visual Fox Pro 9.0 bug:

This problem is the VFP application isn't accessing the external libraries, libserialport-0.dll and TransbankWrap.dll, from TransbankPosSDK.dll.

enter image description here

Example C#

public delegate void MyCallback(); 
[DllImport("MYDLL.DLL")] 
public static extern void MyFunction(MyCallback callback);

is this similar method?, you have another method to access with pinvoke?

Ignacio_aa
  • 318
  • 2
  • 8
  • Your question is not clear and it doesn't look like a VFP error. It is saying it is not a valid .Net dll. Are you sure it is not a win32 DLL? And are you trying to use it from VFP or .Net? If from .Net then have a look at https://www.pinvoke.net – Cetin Basoz Aug 14 '19 at 22:25
  • i need know calling manually functional DLL from COM DLL, example: public delegate void MyCallback(); [DllImport("MYFUNCTIONALDLL.DLL")] public static extern void MyFunction(MyCallback callback); – Ignacio_aa Aug 14 '19 at 22:45
  • OK, then have a look at PInvoke.net as I already said. – Cetin Basoz Aug 15 '19 at 08:33
  • i looked pinvoke.net – Ignacio_aa Aug 16 '19 at 13:29
  • You are saying COM DLL??? I am afraid it is not clear what you are trying to do. All the images were in Spanish. If you mean you want to use a COM DLL in .Net then did you register it in the first place? Next, did you use Tlbimp to import type info into .Net (you can add COM DLL to your project, VS would use Tlbimp for you). - And your project must target 32 bits (platform x86). – Cetin Basoz Aug 16 '19 at 14:03
  • @cetinbasoz im trying comunicate with functional DLL from COM DLL with pinvoke method, i need return any parameter from functional DLL – Ignacio_aa Aug 16 '19 at 14:05
  • OK I don't understand what you are saying. Maybe someone can. – Cetin Basoz Aug 16 '19 at 14:06
  • it's is OLD Technolgy, im sorry for the confusion coleagues – Ignacio_aa Aug 17 '19 at 16:43
  • There is not a problem in the technology, the problem is in your implementation (it doesn't have anything to do with PInvoke ). I can easily use VFP based COM DLL in C#. – Cetin Basoz Aug 17 '19 at 17:52

1 Answers1

0

PINVOKE.NET

Platform Invoke Tutorial Platform Invocation Services (PInvoke) allows managed code to call unmanaged functions that are implemented in a DLL.

This tutorial shows you what you need to do to be able to call unmanaged DLL functions from C#. The attributes discussed in the tutorial allow you to call these functions and have data types be marshaled correctly...

Link: https://msdn.microsoft.com/en-us/ie/aa288468(v=vs.94)

Link2: https://msdn.microsoft.com/en-us/ie/system.runtime.interopservices.dllimportattribute(v=vs.94)

Link3: http://pinvoke.net

Community
  • 1
  • 1
Ignacio_aa
  • 318
  • 2
  • 8