Jump to content

using vb code in autoit


bafh
 Share

Recommended Posts

is there any way to use vb code in autoit script? because i made a program in autoit and just need a little vb code and thus it would be a lot easier.

<{POST_SNAPBACK}>

Perhaps you'd like to give a little more detail about what you are trying to do. You can run an external program from AutoIt as I believe you have already discovered. You can use AutoItX to execute many AutoIt functions from a language like VB. You can use the new Beta build available from the Programmers forum to access the ObjCreate (CreateObject in VB) fundtion to instantiate an external application API.

The way you are asking the question doesn't make much sense to me... it is like "Can I run some COBOL in my MS-DOS .bat file?"

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Well,

first of all thanks for answering,

and here my question again, more detailed:

its possible with autoitx to include autoit code within vb or many other languages. but is it possible to include vb code within an autoit program?

the reason why i want to do that is that i have a whole program in autoit and only need a few lines of vb script for some stuff i cant do in autoit.

So far i solved the problem by compiling both and running the in vb written program from the autoit one - but that doesnt seem to be a very good solution.

Of cause it would be alot more professional to write everything in vb and what you cant do in vb (or what is easier in autoit) you write in autoit, but since i dont know alot about vb and i dont have much time to learn it, it would be alot faster the way i want to do it.

i was just reading that .dll files are like compiled code from any language, but not a executable program. so if i compile my vb code into a dll file and run (or use it) from my autoit program it would solve the problem (at least i dont need 2 executables) ((-->is that a word??)).

Because, my problem with the 2 executables (if thats a word) was that the vb program needs runtimefiles and on some computers i had to install them first, which is a pain. Would it using dlls solve that problem or do they still need stuff like that?!?!(runtime files or something or need to be registered so i need to install the program)

Thanks alot

Link to comment
Share on other sites

Well,

first of all thanks for answering,

and here my question again, more detailed:

....

Thanks alot

<{POST_SNAPBACK}>

Hello bafh,

First of all: You mentioned both VB script and VB. Those are two different languages.

Secondly: Are you sure you want to use AutoItX? Because AutoItX implies that you already run a different programming language (VB, VBscript, C++, ..).

I have only a 'VBScript' solution for you. This piece of script requires the beta version of AutoIt (not AutoItX) with COM support:

; AutoItCOM 3.1.0
;
; Test File
;
; Wscript.shell example

; Returns file information of AutoIt.exe

$objShell = ObjCreate("WScript.Shell")
$objFS  = ObjCreate("Scripting.FileSystemObject")

$strPath = @AutoItExe

$objFile = $objFS.GetFile($strPath)

WITH $objFile

Msgbox(0, $strpath ,  _
 @AutoITexe          & " "  & @CRLF & _
 "File Version: "      & $objFS.GetFileVersion($strpath) & @CRLF & _
 "File Size: "        & Round((.Size/1024),2) & " KB" & @CRLF & _
 "Date Created: "      & .DateCreated & @CRLF & _
 "Date Last Modified: " & .DateLastModified  )

ENDWITH

Is this the kind of stuff you ask for ?

Regards,

-Sven

Link to comment
Share on other sites

Well there is a solution - you can wrap up your code into a DHTML script and use WebPage.dll to fire it up in a autoit3 gui...

DHTML, or Dynamic HTML, Javascript and VB Script can be used to really bring your web pages to life and more than that act on events etc.. DHTML allows computer code to be executed on the machine, a technique frequently used to provide dynamic pop-up menus, roll-over images and other such features or in your case to activate a VB subscripts...

I suggest that you use the WebPage string option to do this kind of action and the control could be off site still working...

A real hybrid solution - it's fun...

Kåre :)

Edited by kjactive
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...