Welcome, Guest. Please Login
vTask Homepage
 
 
Home Help Search Login


Page Index Toggle Pages: 1
Send Topic Print
Please help with calling vTask DLL from C# (Read 664 times)
ocnuybear
New Member
*
Offline



Posts: 3
Windhoek, Namibia
Please help with calling vTask DLL from C#
Sep 29th, 2016 at 10:27pm
 
Hi, I have succesfully loaded my vTask DLL from VB.net using:


Option Explicit
Declare Function RunScript Lib "Example.dll" (ByVal a As Integer, ByVal b As String) As Integer

Sub Main()
        Dim Result As Integer
        Result = RunScript(1, "Hello")
        MsgBox "The result was: " & Result
End Sub


But I need to do this in C# - the CPP example in the Help file is not working as I'm only a beginner in C#.
Back to top
 
 
IP Logged
 
ocnuybear
New Member
*
Offline



Posts: 3
Windhoek, Namibia
Re: Please help with calling vTask DLL from C#
Reply #1 - Oct 6th, 2016 at 6:52am
 
Can anyone help me please ?
Back to top
 
 
IP Logged
 
vTask Support
Moderator
*
Offline



Posts: 3747
Tucson, AZ
Re: Please help with calling vTask DLL from C#
Reply #2 - Oct 6th, 2016 at 8:53am
 
I don't know anything about C#, so I can't help with that language. vTask does export DLL functions correctly, as you noted with success in the VB and C++ environments. But unfortunately I am not sure of how C# handles exported library functions.

The official Users Guide entry is here (which you seem to already know about):
How to Access a DLL created by vTask


I did a forum search and found this which mentions C#: http://www.vtaskstudio.com/forum/YaBB.pl?num=1213172210/12#12

maybe that will help. Otherwise, this is a C# programming question that vTask automation users will have limited knowledge of.

Obviously, you're probably going to have to start googling "how to import DLL functions in C#" or "declare DLL prototypes in C#" or something. I did a brief search, and it looks like numerous results will show you how to do it. Did you try that yourself?

Side note: Why is this post in "Sample vTask Scripts (Advanced)"?  moving to "Open Issues and Questions"
Back to top
 

Thank you for using vTask Studio!
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print