interop - Calling a dll created in VB6 from F# -


i trying call dll file created in vb6 f#. have written following dll.

public function addtwonumbers(byval integer, byval b integer)     addtwonumbers = + b end function 

now want call in f# program, wrote code

open system.runtime.interopservices  module interopwithnative =    [<dllimport(@"c:\add", callingconvention = callingconvention.cdecl)>]      void addtwonumbers(int, int)  interopwithnative.addtwonumbers(3,4)  let result = addtwonumbers_ 2.0 3.0 

it gives me errors , doesn't recognize function.

a working interop example entrypoint

open system.runtime.interopservices // dllimport  module kernelinterop =      [<dllimport("kernel32.dll", entrypoint="beep")>]     extern void beep( int frequency, int duration )  kernelinterop.beep  // val beep : int * int -> unit kernelinterop.beep(440, 1000) 

Comments

Popular posts from this blog

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

php - Using grpc in Laravel, "Class 'Grpc\ChannelCredentials' not found." -

scikit learn - python sklearn KDTree with haversine distance -