Please assist creating & using a basic DLL to pass data to/from MS

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ocnuybear
Pro Scripter
Posts: 100
Joined: Sun Jul 15, 2018 5:14 pm

Please assist creating & using a basic DLL to pass data to/from MS

Post by ocnuybear » Thu Jul 26, 2018 9:56 am

I would like to start creating my own DLL in C# or VB.net.

Using example code in Visual Studio:

Code: Select all

Module Module1
    Function Test(a As Integer) As Integer
        Test = a * 10
    End Function
End Module
To be compiled into a DLL, called by MS sending an integer to it and getting the answer integer back into MS.

Can you assist please?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Please assist creating & using a basic DLL to pass data to/from MS

Post by Marcus Tettmar » Thu Jul 26, 2018 5:23 pm

Macro Scheduler requires a Win32 native DLL using the stdcall calling convention.

As far as I was aware C# and VB.Net are managed and therefore not capable of creating native unmanaged DLLs.

However, you might be able to create a COM object which you can instantiate via VBScript code within your macro.

But you'll be better placed asking for help compiling your C# project in a C# forum. C#/VB.Net is way beyond our remit here. We are not going to be able to help you with your C#/VB.Net code here.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

ocnuybear
Pro Scripter
Posts: 100
Joined: Sun Jul 15, 2018 5:14 pm

Re: Please assist creating & using a basic DLL to pass data to/from MS

Post by ocnuybear » Thu Jul 26, 2018 6:19 pm

I'm still new to programming, and is learning about the differences between managed & unmanaged DLL's.

What other program languages do you perhaps know of which except Python can also create native unmanaged DLL's?

Thank you Marcus

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Please assist creating & using a basic DLL to pass data to/from MS

Post by Marcus Tettmar » Thu Jul 26, 2018 6:48 pm

C, C++, Delphi
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts