Sign in to follow this  
Followers 0
redblacktree

Using UDFs in .NET

9 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

A definitive answer here would really help me. I don't want to start writing my GUI in AutoIt script until I know for sure that I can't use includes in C#.

If anyone can help, I would very much appreciate it.

redblacktree

Share this post


Link to post
Share on other sites

Is there another place I can ask this kind of question?

Thanks for any assistance.

redblacktree

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I didn't call anyone stupid. I said the process is doable as long as the person performing the process isn't stupid.

Share this post


Link to post
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
Sign in to follow this  
Followers 0