jantograaf Posted April 23, 2019 Posted April 23, 2019 Hi all, I'm trying to write a script that connects with a VBA/COM API to get the status of a connected phone. I've been looking up and down this forum for tips or other user's experiences, but I can't seem to find anything (even remotely) similar. It shouldn't be so hard to do, however. Software I'm trying to connect to I'm trying to integrate CallCenter by using their API, which is documented over here : JustRemotePhone API Reference Things I've tried I've tried using ObjCreate but I don't get any result, it always returns the same (negative) error. #Version 1 tried ObjCreate("JustRemotePhone.RemotePhoneService") #Version 2 tried ObjCreate("JustRemotePhoneCOM.RemotePhoneService") #Version 3 tried ObjCreate("JustRemotePhoneCOM.RemotePhoneService.Application") None of the three versions I tried seem to deliver any result other than a negative error value which basically says that the given class is not valid. I am starting to get the hang of AutoIt by now, but unmanaged programming languages and object-oriented stuff is still quite a grey zone for me. If anyone could help me 'talk' to this application, I'd be immensely grateful! Thanks in advance and kind regards from Belgium! Jan
Nine Posted April 23, 2019 Posted April 23, 2019 Try this : JustRemotePhone.RemotePhoneService.Application “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
water Posted April 23, 2019 Posted April 23, 2019 As described here: https://www.justremotephone.com/sdk/Help/html/T_JustRemotePhone_RemotePhoneService_Application.htm 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
jantograaf Posted April 23, 2019 Author Posted April 23, 2019 I've tried this as well already... Local $oApplication = ObjCreate("JustRemotePhone.RemotePhoneService.Application") This returns the same error: -2147221005
water Posted April 23, 2019 Posted April 23, 2019 That's the "Invalid Class String" exception. You are sure that all components of the application (including the COM interface) have been installed? Maybe they have been installed for the System (or any other admin user) user and hence are not accessible by you? 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
jantograaf Posted April 23, 2019 Author Posted April 23, 2019 Since the API is installed together with their standard software (no seperate installer) and I've just double-checked that I didn't need to check any additional options in the installer to activate this, it should be installed. I am also the admin-user on my local desktop, so I should have all rights to installed objects. Here is a screenshot from within OleView: Thanks for your replies, guys, I'm sure it'll be something very stupid and simple somewhere... Kudos!
jantograaf Posted April 23, 2019 Author Posted April 23, 2019 These files are shown in the SDK-directory of the CallCenter-app. I thought the DLL was registered, since it shows up in the OLE/COM Object Viewer, but now I see that the one referenced in OleView.exe is the one in the JustPhone-folder, not the one in the SDK subfolder. Any way to register such a COM interface/DLL myself manually? Once I get a grasp of that, I'll be on my way... I guess... #fingerscrossed
water Posted April 23, 2019 Posted April 23, 2019 Use Quote regsvr32 path of the .dll file with filename and extension 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
jantograaf Posted April 23, 2019 Author Posted April 23, 2019 Oh god. This gives me the error that the entry point to DLLRegisterServer wasn't found. I went looking for that error, but then they advised that the dll should be copied to the system path. However, copying the file to C:\Windows\System32 doesn't fix the error in AutoIt.
jantograaf Posted April 23, 2019 Author Posted April 23, 2019 I have tried to register the .dll using RegAsm. RegAsm.exe "C:\Program Files (x86)\JustPhone\CallCenter\SDK\bin\RemotePhoneService.dll" /tlb:"RemotePhoneService.xml" /verbose Result (in Dutch, sorry): Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.8922 Copyright (C) Microsoft Corporation 1998-2004. Alle rechten voorbehouden. Assembly is geëxporteerd naar C:\Program Files (x86)\JustPhone\CallCenter\SDK\bin\RemotePhoneService.xml en de typebibliotheek is geregistreerd I get no errors on registration, it says it has been exported and the type library has been registered. However, from within my AutoIt script, the same errors occur. 🙄
Earthshine Posted April 23, 2019 Posted April 23, 2019 does it work with their samples? i will install it to a vm with autoit and try any samples, including yours. My resources are limited. You must ask the right questions
jantograaf Posted April 23, 2019 Author Posted April 23, 2019 I've gotten it to work from within MS Access. However, Access uses VBA, where you have to explicitly reference the wanted class...
Earthshine Posted April 23, 2019 Posted April 23, 2019 (edited) what code would you like me to test? gimme... gimme gimme i'll grab your stuff above and give it a go, after i test the C# sample Edited April 23, 2019 by Earthshine FrancescoDiMuro 1 My resources are limited. You must ask the right questions
Earthshine Posted April 23, 2019 Posted April 23, 2019 (edited) so, i think you need to have that dll and it's xml present in your app directory. Not sure if registering it will work wither. cannot register it with Regsvr32 so.... you need to have that stuff with your autoit source. Edited April 23, 2019 by Earthshine My resources are limited. You must ask the right questions
Earthshine Posted April 23, 2019 Posted April 23, 2019 (edited) LOL, I have it! you CAN register it, but you did not do it properly! lol do this regasm RemotePhoneService.dll /tlb:RemotePhoneService.tlb so in a vm i installed the product, then ran the .csproj sample, then copied that dll and xml to my host along with the sample i compiled, ran that command above on my host (note my host does not have callcenter installed) and ran the sample, just fine. Edited April 23, 2019 by Earthshine My resources are limited. You must ask the right questions
jantograaf Posted April 23, 2019 Author Posted April 23, 2019 (edited) I can give you my code, but it's irrelevant. Basically it is only one line and the check if it produces an error. Local $oApplication = ObjCreate("JustRemotePhone.RemotePhoneService") If @error Then MsgBox(0,"Error",@Error & @CRLF & @extended) Else MsgBox(0,"Okay","Geslaagd!") EndIf I have registered the DLL again, I have tried by placing it in the same folder as my compiled AutoIt-script, all to no avail, nothing makes it work. Edited April 23, 2019 by jantograaf Typo
Earthshine Posted April 23, 2019 Posted April 23, 2019 (edited) you are right, they don't respond. let me try something. I am pretty sure you will be dealing with running .net code under autoit. I don't think ObjCreate is going to work on that DLL Edited April 23, 2019 by Earthshine My resources are limited. You must ask the right questions
jantograaf Posted April 23, 2019 Author Posted April 23, 2019 (edited) Thanks for looking into that. I don't mind 'how' to implement this, the key is that I just want it to work somehow since it would be a great opportunity to build something useful... Right now, me and my 5 colleagues pick up the office support calls by answering the phone through this piece of windows software. But since we all use a cellphone with a virtual phone 'central', which does not offer an option to see who is currently in a call, getting that status through that 'API' would allow me to design a simple status screen which shows who is available and who isn't... That's the main target. P.S.: long explanation, I know, but I always figure it's more useful to explain exactly what I'm trying to achieve so we can find a good - or even alternative, out-of-the-box - solution... Edited April 23, 2019 by jantograaf Typo Earthshine 1
Earthshine Posted April 23, 2019 Posted April 23, 2019 (edited) well, that's a .NET dll, and I can load it but running that BeginConnect method is failing in autoit. the vba sample which works uses RemotePhoneServiceCOM.tlb which is registered to your system, you saw it in OLE Viewer If I were you, I would use the VBA sample app or the C# one as a basis for this as it works properly with them Edited April 23, 2019 by Earthshine My resources are limited. You must ask the right questions
water Posted April 23, 2019 Posted April 23, 2019 I know nothing about .NET but maybe the .NET UDF is the way to solve your problem: https://www.autoitscript.com/forum/topic/188158-net-common-language-runtime-clr-framework/ 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
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