This is a migrated thread and some comments may be shown as answers.

COM / Delphi Project

10 Answers 88 Views
General discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Guest
Top achievements
Rank 1
Guest asked on 02 May 2013, 01:05 PM
Hi I have anaged to start a COM/Delphi (JWSTestDelphi) and having a few problems. I have the delphi project connecting and reporting back to Dashboard. Problem is only some information is being brought back. There are no signs of exceptions and log messages with attachment. I'm thinking it's probably syntactical or info based. Also can you tell me the diffeence between "usage" "daily usage" and "max usage" on the main screen. Thanks JimS

10 Answers, 1 is accepted

Sort by
0
Guest
Top achievements
Rank 1
answered on 02 May 2013, 01:05 PM
Over-enthusiastic with the submit button. I can give samples of code (Delphi) - simple test app (if required) What I really could do with is knowing where to look on my PC to see if things are not being sent, There's not much in the way of documentation/examples of COM/Delphi implementation. Cheers JimS
0
Guest
Top achievements
Rank 1
answered on 02 May 2013, 01:05 PM
Hi Jim Thanks for providing feedback, keep it coming. I'll try to touch on all your questions below. My initial guess would also be an issue with calling via the COM/Delphi interaction, especially for the exception and log messages that hava a bit more syntactical "weight" than the other calls. You should be able to see the specific calls outlined here: http://api.eqatec.com/analytics/com/ Let me know how you are able to get things working. In order to understand what is sent on the wire to our service, take a look at this article, specifically on capturing the network traffic: http://support.eqatec.com/entries/20953498-Troubleshooting On the main screen (and in general in our application) a usage is equivalent to a user starting the application. The "usage" refers to the total number of usages in the selected period, the "daily usage" is the average number of daily usages and the max usages show the maximum single day usage (again, within the select period) You can contact me directly on sej@eqatec.com if you want to send some sample, I'll be happy to take a look at them and give the feedback I can. Hope this helps Soren EQATEC Team
0
Guest
Top achievements
Rank 1
answered on 02 May 2013, 01:05 PM
Hi Soren Here's the code for the two areas I am having issues with 1. Exceptions -------------------------------------------------------------------------------------------------------------------------------------------- procedure TForm1.MyHandler(Sender: TObject; E : Exception); var errType : widestring; errReason : WideString; errStackTrace : WideString; errContextMsg : WideString; begin errType := e.ClassName; errReason := e.Message; errStackTrace := 'stack'; errContextMsg := 'this was raised by JWS'; monitor.TrackExceptionRawMessage(errType, errReason, errStackTrace, errContextMsg); ShowProgress('Error occured and sent to EQATEC: '+e.Message,true); end; -------------------------------------------------------------------------------------------------------------------------------------------- I am assuming it doesn't matter what is entered for the 4 strig parameters. 2. Logging with attachment -------------------------------------------------------------------------------------------------------------------------------------------- procedure TForm1.btnLogWithAttachementClick(Sender: TObject); var MyFileHandle : integer; MyFileSize: integer; iBytesRead : integer; MyRGSA_bound : array[0..0] of TSafeArrayBound; // needed for the SafeCall MyPtr : pointer; pSafeBlob : PSafeArray; // needed for the SafeCall to the DLL MyFileToRead : Widestring; begin MyFileToRead := 'E:\AnalyticalTools\EQATEC\AnalyticsMonitorCOM\ReadMe.txt'; MyFileHandle := FileOpen(MyFileToRead, fmOpenRead); MyFileSize := FileSeek(MyFileHandle,0,2); FileSeek(MyFileHandle,0,0); MyRGSA_bound[0].lLbound := 0; // - - - - - - - - - MyRGSA_bound[0].cElements := MyFileSize; // This is tricky ! pSafeBlob := SafeArrayCreate(VT_I1,1, MyRGSA_bound); // - - - - - - - - - SafeArrayAccessData(pSafeBlob,MyPtr); iBytesRead := FileRead(MyFileHandle, MyPtr^, MyFileSize); FileClose(MyFileHandle); SafeArrayUnAccessData(pSafeBlob); monitor.SendLog_2('Log message test @ '+FormatDateTime('dd-mmm-yyyy hh:mm:ss',now),pSafeBlob,'text/XML'); ShowProgress('Log message test - complete', true); SafeArrayDestroy(pSafeBlob); end; -------------------------------------------------------------------------------------------------------------------------------------------- I am certainly reaching these pieces of code as and when I should but no data is getting back to the Dashboard The safearray stuff I have picnhed from samples online. I am also having issues with the Initialisation (can't use the "settings" option) code used to setup monitor as follows settings := TAnalyticsMonitorSettingsCOM.Create(nil); //settings := IAnalyticsMonitorSettingsCOM.Create; settings.SetProductId(ProductDetails.ProductID); settings.SetSynchronizeAutomatically(true); settings.SetCurrentVersion(ProductDetails.ProductVersion); monitor := TAnalyticsMonitorCOM.Create(nil); //monitor.InitializeMonitorWithSettingsObj(settings); monitor.InitializeMonitor(ProductDetails.ProductID, ProductDetails.ProductVersion, ''); monitor.SetInstallationInfo('SO_JIMSSSSS'); monitor.Start; There seems to be some anomolies in the documatation (i.e. no SendLog_2 method Any help appreciated. Cheers JimS
0
Guest
Top achievements
Rank 1
answered on 02 May 2013, 01:05 PM
Hi Soren Bit of perseverence and some digging into use of SafeArrays and I've managed to get the Log messages with attachment working. Exceptions now coming through now (most likely timing by the looks of it) Thanks JimS
0
Guest
Top achievements
Rank 1
answered on 02 May 2013, 01:05 PM
Hi Jim Really glad you were able to push through the COM issues. COM is notoriously tricky to understand and Delphi support is certainly not our expertise so good job on getting it working by your self. If you have any code sample you are willing to share in terms of Delphi integration and improvement of our support, we'd been glad to receive them for future reference. We'll be sure to remove any trace of your application of course. Did you succeed with initialization using the settings object or is that still something you are working on? Thanks Soren EQATEC Team
0
Guest
Top achievements
Rank 1
answered on 02 May 2013, 01:05 PM
Hi Soren Code a bit shoddy to be sharing at the moment but once I get round to tidying up - no problem. Gave up on the "settings" initialization for now - trying to get all the features working first. Cheers JimS
0
Guest
Top achievements
Rank 1
answered on 02 May 2013, 01:05 PM
Hi I'm still having difficulties with implementing the SetIntallationInfoAndProperties. Have updated to 3.1.69 which surfaces the Method but the 2nd parameter is causing me some issues (see attached file). Cheers Jim Steele
0
Guest
Top achievements
Rank 1
answered on 02 May 2013, 01:05 PM
Hi Jim Sorry for not getting back to you on Friday, we are on European time so I was off for the weekend on your last reply. The second parameter to the call is an object that is essentially a string,string dictionary. You should be able to create the InstallationProperties object using the same creation mechanisms that instantiated the Monitor instance, just using the name "EQATEC.Analytics.Monitor.InstallationProperties". The resulting object exposes a few methods that you can call to add items to the dictionary, which should all be available in the documentation as well (in your screenshot, it can be seen on the left hand side menu). Once you've added the needed entries to the object, you should be able to pass the object as the second parameter. Hope this helps, let me know if everything is coming together.... Cheers Soren EQATEC Team
0
Guest
Top achievements
Rank 1
answered on 02 May 2013, 01:05 PM
Morning Soren Apologies didn't update my doc properly - when I create the TInstallationProperties I expect as you say to get the methods as per documentation (i.e. Add) but they do not appear (see attached doc)
0
Guest
Top achievements
Rank 1
answered on 02 May 2013, 01:05 PM
This is now fixed
Tags
General discussion
Asked by
Guest
Top achievements
Rank 1
Answers by
Guest
Top achievements
Rank 1
Share this question
or