Recently Browsing 0 members
No registered users viewing this page.
DLLCalls using VBScripts
Out if the box it is not possible to do DllCalls from VBScripts. But thanks to the +20 year COM Library called DynaWrap this is still possible
Anyhow the process of calling Win API functions need some basic knowledge and understanding on how to do this.
More specifically the input Data Types parameters used and Calling Formats are key here, as well as the Return Data Types
DynaWrap COM Library
Keep in mind that this COM Library is a 32Bit only library. Which means that you need to register is using the SysWOW64 regsvr32
But to overcome this annoyance I created RegFree method so you can start using it as a portable COM Library
I created a PDF documention on what I still could find on the internet on how to use the COM Library.
The second post will hold some VBScript Examples and an AutoIt Example
You will find the PDF and the ZIP File needed to run your code in a portable way.
Thanks to the @Professor_Bernd to provide the VBScript code to get the VBScript scripting directory and the Shortcut to run the 32Bit SysWOW64 VBScript host
Just drop the VBScript on the 32Bit Shortcut to get going.
Anyhow here you can find the source code of the DynaWrap 32Bit Library.
If someone has the C++ Tools to convert it to 64Bit Library that would give a new live to it...
Interesting reading :
DynaCall.zip How to use DllCalls in VBScript using DynaWrap COM Object.pdf
Good morning Forums
In these days, I am working on a project that involved me to use some Windows APIs to obtain some information about Terminal Servers.
I'm doing this using wtsapi32.dll in a VBA Project, but, the lack of knowledge about few things threated in the articles make this quite difficult to
implement and understand at the same time.
The most difficult thing I'm facing is "translating" C/C++ functions or struct in VBA when pointers are used, or pointers of pointers, and so on.
Since VBA seems to not have a pointer type, to make those functions work I need to implement other functions taken from other DLLs, and this confuses me a lot.
For example, starting from this code, I splitted all the functions and all the definitions to understand why they are there, and why I need to use them.
At the end, I've found out that the code I was going to implement starting from the functions provided in the Microsoft Docs won't be ever be able to work without some supplementary functions which are not mentioned anywhere.
So, I was wondering if someone would please point me out to a good and practical exaplanation about pointers (in general) or specifically for VBA, because I need to use them quite often in these days, and I'd like to understand what I am doing.
Thanks in advance.
Best Regards and Stay at home 🏡
The other night night i was converting a Msdn function to autoit and I stumbled across this topic
Which inspired me like crazy and I decided to take it a step further and require the user to make almost ZERO effort to export a c++ Msdn function and or a Structure to AutoIt
Shoutout to toasterking
So after 18-20 effective hours:
The GUI is really simple, all you need is a link to a MSDN page and the program does the rest, most of the options is just for user preferences.
On the inside I have spent a decent amount of work to make sure the code come out correctly, any particular event during the conversion will get fed-back to the user, so he or she will know if anything noticeable happen.
Regular DllCall example
Expand spoiler for more pictures
In the "Msdn Examples" folder you will find some examples of code i have generated, in most of them I only manually added 2-3 lines to make them work.
If you dont know where to get these functions you can browse the MSDN Library https://msdn.microsoft.com/en-us/library/ee663300(v=vs.85).aspx and look for any function refrence, or just google "somethingsomething msdn" and the first result will almost always contain the function you are looking for.
Here is some functions you can play around with
I would really appreciate any kind of feedback, improvements or requests
If you get any type of error just post the MSDN url + the error message and ID and I will troubleshoot it.
Fixed some minor issues Added highlight for a more pleasent view Fixed minor bugs Made it run faster when working with the same URL (It dosent load the page entierly) No struct search is now done when no POINTER is used in the call Added more options for the user Update 0.3
Removed _IeNavigate and fixed the template for DllCall not including function name Update 0.4
Switched method to InetGet from _Ie* H0tfix3s Update 0.5
Added more options for function-layout Removed old code Added more auto detection Now using @TmpDir instead of @ScriptDir for html files etc. Update 0.6
More Output logic added Added a detection for SAL aswell, since it seems to be inconsistent according to MSDN community and myself. Better feedback on what happend with parse Code cleanup / Removed old code /Tarre
DllCall and Struct Generator V 0.6.zip
DllCall and Struct Generator V 0.5.zip
DllCall and Struct Generator V 0.4.zip