IRealTimeLog.LogFile - How to get reference?

512
2
12-22-2013 12:26 PM
KeithSandell1
New Contributor II
I have to use VBA, on 9.2, to get the Log File Location for the GPS Toolbar "Log Setup" dialog.

I have the following code that programmatically fires off the "Log Setup" dialog.

Once closed I need to get the Log File. The IRealTimeLog Interface contains the property I need to access, "LogFile." The property is an implementation of IFeatureClass.

However, any way I have tried to access IRealTimeLog.LogFile raises "Object variable or With block variable not set" or other various errors.

The result of getting the Log File, either in an IFeatureClass implementation or location on disk, will be fed into existing code that adds the shapefile to the TOC and sets the symbology.

I just need help getting a reference to the "Log File".

Private Sub UIButtonControl1_Click()
    Dim pCommandBarItem As ICommandItem
    Set pCommandBarItem = Application.Document.CommandBars.Find(ArcID.GPS_LogfileProperties)
    pCommandBarItem.Execute
    
    'What do I need to do below to get the reference?
    Dim pRealTimeFeatureClass As IFeatureClass
    Dim pRealTimeLog As IRealTimeLog
    Set pRealTimeFeatureClass = pRealTimeLog.LogFile
    
End Sub


Thanks
0 Kudos
2 Replies
RichardWatson
Frequent Contributor
I have never used this interface but I am willing to try to help.

I looked up the interface in Carto here:

http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#/IRealTimeLog_Interface/...

At the bottom of the help article it states that the RealtimeFeedManager is one (actually the only) "CoClasses that implement IRealTimeLog":

http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/0012/001200000s86000000.htm

So what you need is a way to get an instance of the RealtimeFeedManager.  Maybe try new?

I Googled on "realtimefeedmanager create" and got the following link:

http://resources.esri.com/help/9.3/arcgisdesktop/dotnet/1e6fd533-2b08-4cd3-99cb-58f220d99819.htm

It is an example in C# but it appears to simply use new.  Suggest that you look at this code and emulate this behavior in VBA.
0 Kudos
KeithSandell1
New Contributor II
Thanks.

I've probably looked at every version of the Reference docs except for that one...

I did create a New RealTimeFeedManager previously, just didn't seem intuitive on how to derive the IRealTimeLog from it.

The vb example you reference helps frame that.
0 Kudos