Hi,
for some of my Scripts i need a function to change some file properties. I have downloaded a .dll file from Microsoft with the function i need. Now my problem: It is a COM function.
How can i call it without the need, to register the dll? Is it possible?
I tried to translate some VB code (only working with registered DLL):
Now my Script:
If i run the script above, i get the error code: 800401F3
This semms to be "Object not found" or something similar.
Maybe i can call the function out of the DLL with dllcall, but how?
I used DLL Export Viewer to get the following information (not all functions in this dll file):
Function names:
_OleDocumentProperties::Close
_OleDocumentProperties::CLSID
_OleDocumentProperties::IsOleFile
_OleDocumentProperties::Open
_OleDocumentProperties::Save
CustomProperties::Add
CustomProperty::Remove
SummaryProperties::Comments
I´m not very familiar with dllcall and com objects, so maybe someone knows how to do it?
for some of my Scripts i need a function to change some file properties. I have downloaded a .dll file from Microsoft with the function i need. Now my problem: It is a COM function.
How can i call it without the need, to register the dll? Is it possible?
I tried to translate some VB code (only working with registered DLL):
Set oFile = CreateObject("DSOFile.OleDocumentProperties") oFile.Open("c:\tmp\test.txt") oFile.SummaryProperties.Comments = "Test Comment" oFile.Save oFile.Close
Now my Script:
[ autoit ]
$dll = DllOpen("dsofile.dll") $oFile = ObjCreate("DSOFile.OleDocumentProperties") If Not @error Then MsgBox(4096, "ObjCreate Test", "ObjCreate() of a DSO File Object successful !") Else MsgBox(4096, "ObjCreate Test", "Failed to create Object. Error code: " & Hex(@error, 8)) EndIf DllClose($dll) Exit
If i run the script above, i get the error code: 800401F3
This semms to be "Object not found" or something similar.
Maybe i can call the function out of the DLL with dllcall, but how?
I used DLL Export Viewer to get the following information (not all functions in this dll file):
Function names:
_OleDocumentProperties::Close
_OleDocumentProperties::CLSID
_OleDocumentProperties::IsOleFile
_OleDocumentProperties::Open
_OleDocumentProperties::Save
CustomProperties::Add
CustomProperty::Remove
SummaryProperties::Comments
I´m not very familiar with dllcall and com objects, so maybe someone knows how to do it?