Jump to content

Using UDFs in .NET


Recommended Posts

Hello,

Thank you for taking the time to help.

I have tested AutoIt functions using SciTE, and I have come up with a series of commands that I would like to implement in C#. Unfortunately, I can only figure out how to use the built-in AutoIt functions. Since _GUICtrlListView_ClickItem is in GuiListView.au3, I am not sure how to proceed.

Can someone tell me how to "reference" these user-defined functions from Visual Studio? Do I need to open up the au3 and recreate it using standard functions?

Thanks again.

redblacktree

Link to comment
Share on other sites

Hello, redblacktree. Just a suggestion:

Open up GuiListView.au3 and observe the call tree, especially when those calls resolve to WinAPI functions. Then, download the VS plugin entitled PInkove from www.pinvoke.net. This will provide the Interop signatures to utilize the WinAPI calls in C#.

- OR -

Save yourself a lot of time and heartache. Download ManagedWindowsAPI from http://mwinapi.sourceforge.net. You can utilize these low-level API calls using a great, free framework that exposes the functions you need to interact with those - and all other windows-native - controls.

Zach...

Edited by zfisherdrums
Link to comment
Share on other sites

Thank you for your reply; also, thank you for the tip re: ManagedWindowsAPI. I have used PInvoke in the past; this is a nice alternative.

I was hoping to find something a bit simpler. I am using C# mostly for the ease of creating the UI. Also, I'm most comfortable there. If I'll be reinventing the wheel by converting these user-defined functions from the library, then I think I might be better off using the scripting language to create my GUI.

Thanks again for your reply. Can anyone else confirm that this is my only option for using UDFs/"includes" in .Net code?

redblacktree

Link to comment
Share on other sites

It appears I posted this in the wrong forum. I thought I would post a follow-up here, however, for future forum searchers.

My research has shown that User Defined Functions must be recreated if you want to use them in C#. zfisherdrums' tips above are good for anyone looking to do this.

If you have problems doing this or want to talk about it, the appropriate place is the AutoItX forum.

Thanks for the help!

redblacktree

Link to comment
Share on other sites

UDFs are scripts. You'll always have to translate them.

Also, why would you need an external library for platform invocation? You can call native functions from C# very easily. You just have to not be stupid about it.

Thank you for your input?

I'm not sure if you're calling me or zfisherdrums stupid. But I'm not finding anything useful here. Surely you weren't just tooting your own horn by bashing the newbie.

redblacktree

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...