Ward Posted August 9, 2011 Author Share Posted August 9, 2011 Is it possible to use also AutoIt function within C code?Use DLLCallBackRegister to get a pointer of the AutoIt FuncPass the pointer into C code as a parameterWrite C code that get the "function pointer" as a parameter, and it can be use in the codeExample may be in next release. 新版 _ArrayAdd 的白痴作者,不管是誰,去死一死好了。 Link to comment Share on other sites More sharing options...
Zedna Posted August 16, 2011 Share Posted August 16, 2011 Absolutely incredible as obvious Ward!! Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Beege Posted August 17, 2011 Share Posted August 17, 2011 This is beyond cool. Your awesome ward! Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
arcker Posted August 17, 2011 Share Posted August 17, 2011 I'm creating examples, but I wonder if the licence applied to headers, since I've extracted functions from windows sdk. I've created an example for sorting a listview, I'll publish if licence is ok. -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
Zedna Posted August 17, 2011 Share Posted August 17, 2011 I've created an example for sorting a listview, I'll publish if licence is ok.It can be VERY handy. Sorting listviews is very useful usage.I hope licence will be OK. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
arcker Posted August 17, 2011 Share Posted August 17, 2011 It can be VERY handy. Sorting listviews is very useful usage.I hope licence will be OK.sorting listview with guictrlregisterlistviewsort = around 10 sec for 5000 items with 3 columns.In C : 70 ms .... I hope so ... TCC doesn't like sdk headers for this code, so i've adapted it with MinGW listview function headers but still, I have to know if I can extract them. -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
Zedna Posted August 17, 2011 Share Posted August 17, 2011 (edited) I have question: in Example2.au3 ... TCC_Add_Include_Path($TCC, @ScriptDir & "\include") TCC_Add_Include_Path($TCC, @ScriptDir & "\include\winapi") TCC_Add_Library_Path($TCC, @ScriptDir & "\lib") TCC_Add_Library($TCC, "user32") ... Does it mean I need to distribute these folders with my compiled EXE? If answer is Yes then another question: Can be used these files (ideally only used ones) from resources? (add all neccessary files to resources at compile time and use them from variables at runtime) Edited August 17, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Ward Posted August 17, 2011 Author Share Posted August 17, 2011 Does it mean I need to distribute these folders with my compiled EXE?If answer is Yes then another question: Can be used these files (ideally only used ones) from resources?(add all neccessary files to resources at compile time and use them from variables at runtime)The answer is YES.I will add some example for "Binary Code Generator" later.Then the distribute version can only include the binary code. Not need entire TCC library. 新版 _ArrayAdd 的白痴作者,不管是誰,去死一死好了。 Link to comment Share on other sites More sharing options...
Zedna Posted August 17, 2011 Share Posted August 17, 2011 (edited) Another question: Can be used inline C code in some precompiled form?Once before compilation of main AU3 script in some helper AU3 script should be precompiled and saved C code into binary file.Then in main AU3 script this precompiled binary C code could be added to resources and only called (not compile at runtime).EDIT: I will add some example for "Binary Code Generator" later.We had the same idea at the same time :-) Edited August 17, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted August 17, 2011 Share Posted August 17, 2011 (edited) Another question:Is it possible to pass array as parameter from AU3 to C?_ArrayToString() is the ideal adept for such C optimizing.So my idea is to create C function ArrayToString() with parameters: Array, Delim, Start, Endand call it directly from AU3 and pass Autoit's array directly (maybe with ByRef as pointer?).For $i = $iStart To $iEnd $sResult &= $avArray[$i] & $sDelim Next Edited August 17, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted August 17, 2011 Share Posted August 17, 2011 (edited) With LibTCC, we can add some C source to speed up the time-consuming subroutines. I looked at some of my projects and I have these generally used adepts for translating from AU3 to C for speed optimize: 1) ArraySort() 2) _ArrayToString() For $i = $iStart To $iEnd $sResult &= $avArray[$i] & $sDelim Next 3) FindInArray() For $i = 1 to $avArray[0] If $avArray[$i] = $what Then Return $i Next Return 0 4) _StringRepeat() For $iCount = 1 To $iRepeatCount $sResult &= $sString Next 5) ListViewGetItemText(), ListViewGetSubItemText() 6) ListViewToText() For $i = 0 To _GUICtrlListView_GetItemCount($ListView1) - 1 $txt &= _GUICtrlListView_GetItemTextString($ListView1, $i) & $sDelim Next 7 ) _ArrayToXLS(), __XLSWriteCell() Edited August 17, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
arcker Posted August 18, 2011 Share Posted August 18, 2011 @Ward : I've some examples but I've extracted some functions from headers from MinGW. I need to know if I can post it just with headers needed (windows.h) I'll post it anyway and if there is a licence problem, then i'll remove it. -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
Ward Posted August 18, 2011 Author Share Posted August 18, 2011 @Ward :I've some examples but I've extracted some functions from headers from MinGW.I need to know if I can post it just with headers needed (windows.h)I'll post it anyway and if there is a licence problem, then i'll remove it.I think of course you can post it. MinGW is open source and anyone can download it.I don't see any licence problem here.I am waiting to see your example 新版 _ArrayAdd 的白痴作者,不管是誰,去死一死好了。 Link to comment Share on other sites More sharing options...
arcker Posted August 19, 2011 Share Posted August 19, 2011 (edited) So, after one day of rework, and a week to understand some lack in C for me, here is my example. You need to download and merger the include from MinGW ( this code doesn't work with windows.h from windows sdk, at least for me ! )The function to sort dates doesn't work for now since TCC doesn't like msdn c++ style.The code itself is inspired by an example from sysinternal accessenum, which contains a file listview.cpp, which contains all the need for a cleaner and a complete code sincewe can sort float, dates, strings, and hex.here it is Listview.cpp from accessenumthe autoit part has been disabled, but you can reactivate the function "testautoit" to see the difference.copy with other examplesExample5Lite.au3same for itListViewSortLite.c Edited August 19, 2011 by arcker -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
Ward Posted August 28, 2011 Author Share Posted August 28, 2011 Upload some binary code generated functions. Convert C source to binary code is easy now. 新版 _ArrayAdd 的白痴作者,不管是誰,去死一死好了。 Link to comment Share on other sites More sharing options...
Beege Posted September 1, 2011 Share Posted September 1, 2011 Ward, All this fun Ive been having with TCC I decided to set up a standalone IDE with Scite just for TCC. This way I can write, test, and spot out any syntax errors I might have added. Any time I have a syntax error, just like Scite for autoit does, I can click on the error in the console and Scite takes me right to the line. Also making it standalone lets me have both IDE's open with out effecting each other. I tried to make it as much like the way autoit has Scite set up as I could. Its got an api set up for Calltips, Autocomplete list pops up when a possible choice is there. F5 will run, F7 or Shift-F7 will compile an exe in the same directory as the source. To set the parameters for command line arguments like in example fib.c, go to View->Parameters or just press Shift-F8. I also added a little tool to create a AU3 string from the C code. Its in the editors right-click menu and also in the tools menu. The lexer used is a Lua LPeg lexer. A dynamic lexer I never knew existed until doing this. The color settings for this lexer are a little different than standard Scite lexers. Instead of being in a .properties file they are in a theme file located in LPEG_Lexer\Themes. The colors I have currently set up are for a dark background so im sure people will want to change them to the way they like it. SciteTCC.html Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
Andreik Posted May 25, 2023 Share Posted May 25, 2023 I know it's more than 10 years but does anyone still have LibTCC.zip somewhere on an old PC? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
paulpmeier Posted May 26, 2023 Share Posted May 26, 2023 LibTCC.zip Danyfirex, Andreik, pixelsearch and 1 other 2 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now