Jump to content

[solved] Au3Stripper unsolvable Func - $sCallBack?


Skysnake
 Share

Recommended Posts

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /ShowGui /prod /in "C:\AutoIt\pegasus\wings.au3"
+>08:02:43 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\x\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\x\AppData\Local\AutoIt v3\SciTE 
-> No changes made..
>Running Au3Stripper (19.102.1901.0)  from:C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper cmdline:
-### StripOnly/StripFunc Error: Found ObjEvent() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: _1p2
c:\program files (x86)\autoit3\include\ie.au3(2572,1): Warning for line:$__g_oIEErrorHandler = ObjEvent("AutoIt.Error", $__g_sIEUserErrorHandler) 

-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: _1te
c:\program files (x86)\autoit3\include\sqlite.au3(609,1): Warning for line:$iCbRval = Call($sCallBack, $aDataRow) 

-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: _1te
c:\program files (x86)\autoit3\include\sqlite.au3(625,1): Warning for line:$iCbRval = Call($sCallBack, $aDataRow)

My issue is specifically with the Call($sCallBack, xyz) part.  I declared a Global with that name and thought I had it sorted.  Previous releases appear content with that solution... Current I get this.

Question are these:

  1. Should there be a default $sCallBack define in the provided include?
  2. What exactly should the "user defined" Callback function look like? And where is it defined?

Sorry I am lost.

 

 

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

  • Developers

Au3Stripper doesn't know values of variables so is never going to be able to determine which Func you will call with the Call($sCallBack, xyz)  statement, hence the warning/error returned as this could lead to au3strpper stripping Func's from the sourcecode which are used later.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

But you can tell Au3Stripper which functions are called by Call($sCallBack, xyz) and hence should not be stripped.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

This help page should deliver all needed information: https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3.html
Have a look at #Au3Stripper_Ignore_Funcs= 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Developers

Au3stripper will still give you the Errors/Warnings and leaves it to you to be responsible for continuing.
Also remember that you need to tell AutoIt3Wrapper to use the stripped script as by default it will revert to the original script when an error is detected!

#AutoIt3Wrapper_Au3stripper_OnError=             ;(C/S/ForceUse) Continue/Stop on Errors/Continue using stripped source in Exe (Default=C)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Thank you both.

I added this to the header

#Au3Stripper_Ignore_Funcs=_1p2
#Au3Stripper_Ignore_Funcs=_SQLite*
#AutoIt3Wrapper_Au3stripper_OnError=ForceUse             ;(C/S/ForceUse) Continue/Stop on Errors/Continue using stripped source in Exe (Default=C)
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

Then I still got complaints about the unsolvable function:

>Running Au3Stripper (19.102.1901.0)  from:C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper cmdline:
-### StripOnly/StripFunc Error: Found ObjEvent() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: _1p2
c:\program files (x86)\autoit3\include\ie.au3(2572,1): Warning for line:$__g_oIEErrorHandler = ObjEvent("AutoIt.Error", $__g_sIEUserErrorHandler) 

-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: _SQLite_GetTable2d
c:\program files (x86)\autoit3\include\sqlite.au3(609,1): Warning for line:$iCbRval = Call($sCallBack, $aDataRow) 

-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: _SQLite_GetTable2d
c:\program files (x86)\autoit3\include\sqlite.au3(625,1): Warning for line:$iCbRval = Call($sCallBack, $aDataRow)

And then this :)

!>07:50:24 --------------------------------------------------------------------------------------------
!>07:50:24 Au3Stripper ended with errors but ForceUse defined, so using it anyway (your own risk!)rc:3
!>07:50:24 --------------------------------------------------------------------------------------------

 

I think the  #Au3Stripper_Ignore_Funcs=  is perhaps not specified correctly.  Except for the entry in the Help file, I could not find an example of use?

 

There is another questions here:

How would one code the $sCallback line to allow Stripper to detect it? Or will it always complain?

Is this the correct syntax? Would this be sufficient? If this works, I could simply wrap a system error function :)

Global $sCallback Func MyCallBackFunc()
    ;do something
EndFunc   ;==>Global $sCallback

Thank you. Much appreciated.

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

  • Developers
3 hours ago, Skysnake said:

Then I still got complaints about the unsolvable function:

Sigh, I thought I was pretty clear about that in my last post!

14 hours ago, Jos said:

Au3stripper will still give you the Errors/Warnings and leaves it to you to be responsible for continuing.

.. but the important thing is they remain there which is something you need to check!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Skysnake, You use function variables this way:

Global $MyFuncVar = MyFunc

$MyFuncVar( 123 )

Func MyFunc( $i )
  ConsoleWrite( $i & @CRLF )
EndFunc

This applies to both common functions and callback functions. No need to use Call().

Link to comment
Share on other sites

Skysnake, I've read the whole thread a little more carefully. Note that callback functions are used in relation to Windows API functions and in relation to the AutoIt function DllCallbackRegister. It's not something you use in normal AutoIt functions.

Look at the example for DllCallbackRegister in the help file. The example implements the Windows API function EnumWindows so that it can be used in AutoIt.

The Microsoft documentation describes that EnumWindows uses a callback function called EnumWindowsProc. To get EnumWindows to work in AutoIt, EnumWindowsProc must also be implemented in AutoIt.

EnumWindows is implemented using the DllCall function. EnumWindowsProc is implemented using the DllCallbackRegister function. The parameters for both functions are documented by Microsoft.

The callback function is called directly from the internal EnumWindows code (C/C++ code). It's not called in the AutoIt code.


The only way you can use function variables in relation to callback functions is in this way (the first lines in the example), since you are not calling the function yourself in the AutoIt code:

Global $MyFuncVar = _EnumWindowsProc

; Create callback function.
Global $hHandle = DllCallbackRegister(FuncName($MyFuncVar), "int", "hwnd;lparam")

 

Edited by LarsJ
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

×
×
  • Create New...