ptrex

.NET Common Language Runtime (CLR) Framework

56 posts in this topic

#21 ·  Posted

This two following lines:
#RequireAdmin
#AutoIt3Wrapper_UseX64=n

 

not solving this problem

 

Result for:
".NET CLR RuntimeInfo - GetAssemblies.au3" 
 

Quote

>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "L:\CLRv1\.NET CLR RuntimeInfo - GetAssemblies.au3"    
--> Press Ctrl+F11 to Restart or Ctrl+Break -or- F11 to Stop
$oDomain: 1

$sFullName = System.Reflection, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

$iDim = 1

$iLBound = 0
$iUBound = 1
$fFeatures = 0x00000240

$vt = 0x0000000D

$sGUID = {00000000-0000-0000-C000-000000000046}

$pAssembly = 0x03A9FFD0

IsObj( $oAssembly ) = 1

$sFullName = mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

+>15:04:42 AutoIt3.exe ended.rc:0
+>15:04:42 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.065
 

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites



#22 ·  Posted

Share this post


Link to post
Share on other sites

#23 ·  Posted

so I just try an get this:
 

Quote

>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\CLRv1\.NET GUI XPTABLE Assembly.au3"    
--> Press Ctrl+F11 to Restart or Ctrl+Break -or- F11 to Stop
.NET GUI XPTABLE Assembly.au3 (464) : ==> COM Error intercepted !
    err.number is:         0x00000003
    err.windescription:    NULL Pointer assignment
    err.description is:     
    err.source is:         
 

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#24 ·  Posted

Share this post


Link to post
Share on other sites

#25 ·  Posted

Sure, there is no hurry up.

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#26 ·  Posted

So, I will be the first to admit a fair amount of ignorance in this area, although I have been reading through the previous thread to acquaint myself. Is your intent that this would allow access to the entire framework through AutoIt, or just specific tasks? For example, I have been working on connectivity through AutoIt for VMware tasks. If I create a small .Net app and point it to the VMware.Vim namespace, I can then connect to vSphere and do other tasks that most folks would do through PowerCLI. Something like so (pseudo):

using vmware.vim;
using System.Collections.Specialized;

namespace vcenter_inventory {

...form code

vimClient = new vimClientImpl();

}

Is the intent to be able to access CLR through AutoIt and mix-and-match code as desired? Or am I missing the point entirely?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#27 ·  Posted (edited)

@JLogan3o13                   

I guess in theory this would be possible .... but keep in mind that this is still work in progress...

See Example : ".NET Access Custom Assembly.au3" Line 113.

This will give you an idea on how to access a Custom built Assembly.

 

Edited by ptrex

Share this post


Link to post
Share on other sites

#28 ·  Posted

The intent is to go to mars but lately we have not been on the moon but since 2001 for $20mio dollar you can reach space but lets start with some sky being the limit

  • Access to the entire framework through AutoIt --> examples are seen for powerbasic, foxpro, c++, HP UFT so seems doable
  • @JLogan3o13 PowerCLI seems more logical when you deal with VM stuff but thats up to each others own requirements and personal preferences
    In theory you can write below (be aware on details upper and lowercase)
    Func Example_VIM()
      Local $oAssembly = _CLR_LoadLibrary( "vmware.vim" )
      Local $oVimClient = _CLR_CreateObject( $oAssembly, "vmware.vim.vimClientImpl" )
      ConsoleWrite( "IsObj( $oVimClient ) = " & IsObj( $oVimClient) & @CRLF & @CRLF)
    EndFunc

     

  • For sure we can easily expose non COM registered .NET classes by their CLSID to AutoIt.

It helps if we now get input on all examples and feedback on what works and what not.

Share this post


Link to post
Share on other sites

#29 ·  Posted

Many thanks, gentlemen, for the clarification. Regarding the $20mil, I have $1.49 to get us started, just let me know where to send it :)

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#30 ·  Posted

argumentum, Is the ".NET GUI XPTABLE Assembly.au3" working for you? It seems that mLipok has the same problems as you had here.

It seems to be line 444 in CLR.au3 that fails:

$oAssemblyType.InvokeMember_3("LoadFrom", 0x158, 0, 0, $pSafeArray, $pObject)

This is InvokeMember_3 method of the _Type interface. However, the InvokeMember_2 method takes an additional input parameter about culture info. Maybe we need that parameter?

mLipok (and argumentum if the example also fails for you) will you replace line 444 with these two lines:

Local $hResult = $oAssemblyType.InvokeMember_3("LoadFrom", 0x158, 0, 0, $pSafeArray, $pObject)
ConsoleWrite( "$hResult = " & $hResult & @CRLF )

And then report back the error code.

Share this post


Link to post
Share on other sites

#31 ·  Posted

Sure will try ASAP


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#32 ·  Posted

Result:

Quote

$hResult = -2146232828
.NET GUI XPTABLE Assembly.au3 (467) : ==> COM Error intercepted !
    err.number is:         0x00000003
    err.windescription:    NULL Pointer assignment
    err.description is:     
 

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#33 ·  Posted

Could someone give me an example of how I might use this to connect to a SQL Server via ADO.NET?

Share this post


Link to post
Share on other sites

#34 ·  Posted

55 minutes ago, BJP said:

Could someone give me an example of how I might use this to connect to a SQL Server via ADO.NET?

I do not know, but want to ask you:   Why you do not use ADO.au3 UDF ?

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#35 ·  Posted

mLipok, The XPTable.dll issue.

$hResult = -2146232828 = 0x80131604
COR_E_TARGETINVOCATION: Uncaught exception thrown by method called through Reflection.

If you google COR_E_TARGETINVOCATION and LoadFrom, it seems that the error is mainly because LoadFrom cannot find the assembly, the dll-file.

For some reason, LoadFrom does not find the dll file on your PC. I have no idea why. I do not think it has anything to do with missing culture info.

I've tried renaming XPTable.dll to XPTable-a.dll on my PC, and I get exactly the same error: $hResult = -2146232828.

Then I've tried (still with the renamed dll) to investigate the output from the Assembly Binding Log Viewer: fuslogvw.exe (delivered with Windows SDK). From the log file, I can see that if it does not find the dll file, it searches for it in the folder where the running executable is located. That is, in the folder where AutoIt3.exe is located.

Please try the following:

Copy XPTable.dll to the folder where AutoIt is installed and where AutoIt3.exe is located.

Use this line in top of ".NET GUI XPTABLE Assembly.au3" to load the assembly:

Local $oXPTable = _CLR_LoadLibrary("XPTable")

No path, no extension.

This method works on my PC.

Share this post


Link to post
Share on other sites

#36 ·  Posted (edited)

So I see progress.
I use this testing script:

Local $sXPTable_file = "c:\1\XPTable.dll"
;~  Local $sXPTable_file = "L:\CLRv1\XPTable.dll"
    FileCopy($sXPTable_file, 'C:\Program Files (x86)\AutoIt3\', $FC_OVERWRITE)
    ConsoleWrite("! " & FileExists($sXPTable_file) & @CRLF)
    Local $oXPTable = _CLR_LoadLibrary($sXPTable_file)
;~  Local $oXPTable = _CLR_LoadLibrary("XPTable")
    ConsoleWrite("+Object: " & IsObj($oXPTable) & @CRLF)

    Exit
Quote

>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "L:\CLRv1\.NET GUI XPTABLE Assembly.au3"    
--> Press Ctrl+F11 to Restart or Ctrl+Break -or- F11 to Stop
! 1
$hResult = -2146232828
.NET GUI XPTABLE Assembly.au3 (467) : ==> COM Error intercepted !
    err.number is:         0x00000003
    err.windescription:    NULL Pointer assignment
    err.description is:     
    err.source is:         
    err.helpfile is:     
    err.helpcontext is:     
    err.lastdllerror is:     0
    err.scriptline is:     467
    err.retcode is:     0x00000000

+Object: 0
+>20:38:31 AutoIt3.exe ended.rc:0
+>20:38:31 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.106
 


Next I try to swap this two lines:

;~  Local $oXPTable = _CLR_LoadLibrary($sXPTable_file)
    Local $oXPTable = _CLR_LoadLibrary("XPTable")
Quote

>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "L:\CLRv1\.NET GUI XPTABLE Assembly.au3"    
--> Press Ctrl+F11 to Restart or Ctrl+Break -or- F11 to Stop
! 1
$hResult = -2146232828
+Object: 1

+>20:40:09 AutoIt3.exe ended.rc:0
+>20:40:09 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 0.9936
 

And this new result fits to your findings:

1 hour ago, LarsJ said:

From the log file, I can see that if it does not find the dll file, it searches for it in the folder where the running executable is located. That is, in the folder where AutoIt3.exe is located.

When I comment my Exit line then I get:
 

Quote

>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "L:\CLRv1\.NET GUI XPTABLE Assembly.au3"    
--> Press Ctrl+F11 to Restart or Ctrl+Break -or- F11 to Stop
! 1
$hResult = -2146232828
+Object: 1
IsObj( $oTable ) = 1
IsObj( $oColumnModel ) = 1
IsObj( $oTableModel ) = 1
IsObj( $oColumn0 ) = 1
IsObj( $oColumn1 ) = 1
IsObj( $oColumn2 ) = 1
VisibleColumnCount = 3
IsObj( $oRow ) = 1
Rows = 1
IsObj( $oCell0 ) = 1
IsObj( $oCell1 ) = 1
IsObj( $oCell2 ) = 1
Cells = 3
+>20:41:31 AutoIt3.exe ended.rc:0
+>20:41:31 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 13.82
 

:)

 

but Why I still get:
$hResult = -2146232828

?

 

Edited by mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#37 ·  Posted

Local $pObject = 0
;$oAssemblyType.InvokeMember_3("LoadFrom", 0x158, 0, 0, $pSafeArray, $pObject)
Local $hResult = $oAssemblyType.InvokeMember_3("LoadFrom", 0x158, 0, 0, $pSafeArray, $pObject) ; <<<< Fails
ConsoleWrite( "$hResult = " & $hResult & @CRLF )

If Not Ptr($pObject) Then
  ; args := ComObjArray(0xC, 1),  args[0] := "System"
  Local $tSafeArrayBound = DllStructCreate($tagSAFEARRAYBOUND)
  Local $pSafeArray, $pSafeArrayData
  DllStructSetData($tSafeArrayBound, "cElements", 1)
  DllStructSetData($tSafeArrayBound, "lLbound", 0)
  $pSafeArray = SafeArrayCreate($VT_VARIANT, 1, $tSafeArrayBound)
  SafeArrayAccessData($pSafeArray, $pSafeArrayData)
  DllStructSetData(DllStructCreate("word", $pSafeArrayData), 1, $VT_BSTR)
  DllStructSetData(DllStructCreate("ptr", $pSafeArrayData + 8), 1, SysAllocString($sAssemblyName))
  SafeArrayUnaccessData($pSafeArray)

  $oAssemblyType.InvokeMember_3("LoadWithPartialName", 0x158, 0, 0, $pSafeArray, $pObject) ; <<<< This line loads the assembly
  ; 0x158 = $BindingFlags_Static + $BindingFlags_Public + $BindingFlags_FlattenHierarchy + $BindingFlags_InvokeMethod
EndIf

 

Share this post


Link to post
Share on other sites

#38 ·  Posted

@LarsJ any comment to this snippet ?


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#40 ·  Posted

In this line you must specify the extension:

Local $hResult = $oAssemblyType.InvokeMember_3("LoadFrom", 0x158, 0, 0, $pSafeArray, $pObject)

But since this line does not work for mLipok anyway, we do not care about the extension in his case. And because the line failed $pObject = 0.


In this line extension should not be specified:

$oAssemblyType.InvokeMember_3("LoadWithPartialName", 0x158, 0, 0, $pSafeArray, $pObject)

LoadWithPartialName searches the assembly in the folder where the running executable, AutoIt3.exe, is located. The AutoIt installation folder. If we copy XPTable.dll to this folder LoadWithPartialName can find the assembly.

If XPTable.dll is specified for LoadWithPartialName it'll search for XPTable.dll.dll. If XPTable is specified for LoadWithPartialName it'll search for XPTable.dll.

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

  • Similar Content

    • QuickWhiteWolf
      By QuickWhiteWolf
      Hi everyone,
       
      I was previously a member of this forum under the username Wombat. It's been years and multiple email accounts closed since then so I decided to start fresh and take a moment to thank you all... (Admins/Mods let me know if we need to discuss this...)
       
      I started programming with AutoIT while working as a scrap catcher for a machine that chopped scrap into pieces for easier moving, I learned styles and gained strengths from some of the best members on this forum by reverse engineering their code. I gained the confidence of our IT manager by making a boast that I could write an application to replace a p.o.s. cobalt based app we were using on the floor at that time, needless to say I was way in over my head but he saw that I had potential and I luckily had built several other apps on the side that were of equal or greater value to the company. I've been working as help-desk for the past 3 years and writing software as well to facilitate the help desk and solve recurring issues with our users. I was given an office and moved out of help-desk about a year ago, after 5 years of hard work I've actually landed the title of Jr. Developer moving into mid level title/pay this year! The company has already set out an improvement path that sees me with 4 certs and a bachelors in 4 more years making great money. Before this I had only ever worked at gas stations, fast food and manual labor jobs. If you're ever worried about your life, want something more, or just want a change you can do it. It's not easy, not at all, but it's possible and software programming is a very rewarding field if you like to make things and see how others interact with them.

      I utilized AutoIT to bring a company into the twenty-first century, away from paper trails and sticky notes improving the quality of life for the employees on the floor (where I started before learning AutoIT). I was given the go ahead to purchase visual studio and I learned VB.Net and built an awesome piece of Zebra labeling software (Utilizing ZPL code translated froma graphical editor) for our shipping department. Now I'm diving head first into C# and we have another programmer on board as we move on to MS Team Services and begin to tackle a sweet new project involving real time awareness of our product on the factory floor utilizing RFID and windows 10 tablets.

      That's a long way to come in just 4 years, and I couldn't have done it without the gigantic heart this community has and the mentorship provided for people looking to get into programming.

      So from the bottom of my heart, with immense respect.... Thank you so much AutoIT community
    • Sucre
      By Sucre
      I turned to Autoit from AHK just because it support WinForm Application so well. The problem often haunts me that all the application in my job is WinForm. And it indeed help my work so much. Great thanks in advance.
      However, I can't get the ToolTip text in the application of my company. Specifically,now I want to get the information about some data, however the information is all displayed in the tooltip on the scatter diagram which is made of those data.
      Is there any advice ? Relative topics I have searched can't get any information about the winform tooltip...
       
    • Vexhero
      By Vexhero
      Hello! I have a script in autoit which I made yesterday and Im still getting the hang of autoit
      My question is, is there anyone here who would be able to explain how the convertion would go between AutoIt and C# when it comes to these lines of code, would I need to declare an array to show the $x & $y position? Also The LC is a function I have a bit down the code

       
      While (Not($it_full)) $pixels = PixelSearch(257, 181, 276, 202,0xA19695,10) ;Check color If NOT(@error) Then LC($pixels[0],$pixels[1]) EndIf $pixels = PixelSearch(693, 479, 729, 504,0x000001,3) ;Search If NOT(@error) Then ; MsgBox(0,"Title","Found It!") $it_full = True Sleep(8000) EndIf WEnd  
    • oceanwind
      By oceanwind
      Want to call .net func _Help::ShowHelpIndex.Here is the link in msdn:https://msdn.microsoft.com/en-us//library/system.windows.forms.help.showhelpindex.
      I wrote the script below:
      $dll = DllOpen("C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll")
      $result = DllCall($dll, "none", "ShowHelpIndex","HWND", 0,"wstr","D:\Program Files\AutoIt3\AutoIt3CHS.chm")
      _check_result()
      DllClose($dll)
      Func _check_result()
              If @error Then
                      ConsoleWrite(">--|error:=" & @error & "|--<")
                      ConsoleWrite(@LF)
              Else        
                      ConsoleWrite(">--|$result:=" & $result[0] & "|--<")
                      ConsoleWrite(@LF)
              EndIf        
      EndFunc
      Can someone give some advices?
      tks in advance
    • XProCoder
      By XProCoder
      Hello everyone!
      I would like to know (with a AutoIT function/UDF) if an executable is coded in .Net or not. I know that is possible but I don't know how. May you help me?