Announcement

Collapse
No announcement yet.

VB6 Plugin with latest RRExtension & RRSDK Question

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • VB6 Plugin with latest RRExtension & RRSDK Question

    I'm having some trouble pulling data from RR with the new RRExtension and RRSDK classes in place. I'm sure this is mostly due to me not really knowing what i'm doing which is why I figured i'd ask.

    Ok, so i'd like to pull the GPS lat and lon from RR which i know i can do by querying the RRSDK via GetInfo, however i'd like to query the SDK from within the form in my plugin. The RRExtension class already declares an instance of RRSDK, but I can't figure out how to use it from within my form.

    Any help would be greatly appreciated.

    Thanks!
    98' Honda CR-V
    http://www.superbluecrv.com

    *OBDMPG, the RR OBD Plugin*

  • #2
    RRSDK.GetInfo("blabla")

    real example...

    RRPath = RRSDK.GetInfo("=$rrpath$")

    gets the user var path
    -Thanks
    Mitch
    www.rush2112.net

    "Did you test it in carwings??"

    Sun, Come shine my way
    May healing waters bury all my pain
    Wind, Carry me home
    The fabric of reality is tearing apart
    The piece of me that died
    Will return To live again

    Comment


    • #3
      That works fine from the RRExtension class where RRSDK is declared but just placing RRSDK.GetInfo("GPSLAT") in the form produces a Run-time error '424': Object required.

      I'm having issues getting the form to be aware of the RRSDK object, just not sure how to do it.
      98' Honda CR-V
      http://www.superbluecrv.com

      *OBDMPG, the RR OBD Plugin*

      Comment


      • #4
        cant you just reference the class? Like RRExtension.rrsdk.getinfo(). Thats how its done in .net.. been awhile since i messed with vb6
        mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
        Follow Me on Twitter or Facebook
        Live mp3Car Facebook Chat

        Comment


        • #5
          I tried that. I ended up getting a Run-time error stating "Type mismatch".

          Anybody have any more ideas? Can it even be done?
          98' Honda CR-V
          http://www.superbluecrv.com

          *OBDMPG, the RR OBD Plugin*

          Comment


          • #6
            i just went into some old movietimes code and it looks like i had the set a seperate object for the form to communicate with the .sdk

            below is code from my timer form.

            Code:
            Dim RunOnce As Boolean        ' set to prevent a double execution of code
            Public RREInstance As New RRExtension
            Public formRRSDK
            If RunOnce = False Then ' only want to do once
                    RunOnce = True
                    Set formRRSDK = CreateObject("RoadRunner.SDK")
                    'Code here is executed when loading the Extension plugin
                    ' set RRSDK (this is the sub class)
                    'Set formRRSDK = New RRSDK
                    
                    ' run any one time code here
                    FirstN = True
                End If
            mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
            Follow Me on Twitter or Facebook
            Live mp3Car Facebook Chat

            Comment


            • #7
              I'll give that a try Sonic. I just wasn't sure if it was considered bad practice to create two separate objects inside the same plugin to talk to the same thing.
              98' Honda CR-V
              http://www.superbluecrv.com

              *OBDMPG, the RR OBD Plugin*

              Comment


              • #8
                it might be bad practice.. but its the only way i know how
                mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
                Follow Me on Twitter or Facebook
                Live mp3Car Facebook Chat

                Comment


                • #9
                  You should make a Module (.bas file) and declare RRSDK there as a public object. Then have it created in the module ONCE for the whole application to use. (you can create it just like the faq explains or just like the code in the RRExtension class creates it). Once you make a public RRSDK object, you can remove the RRSDK object from within the RRExtension (if you want -- but it would be redundant to have it re-declared there).
                  Ride Runner RR's Myspace

                  "Being happy is not about having what you want, it's about wanting what you have."
                  "The best things in life are always free - but that doesn't mean money can't buy you good things."

                  Comment


                  • #10
                    Thanks for the reply Guino, what you said makes sense I'm just having some trouble trying to implement it.

                    I currently have the standard RRExtension.cls and RRSDK.cls files in my project. If I remove the object declaration from RRSDK.cls and move it into a new module, SDK.bas like so:
                    Code:
                    Public RRSDK As Object
                    
                    Public Sub Class_Initialize()
                    
                        Set RRSDK = CreateObject("RideRunner.SDK")
                        
                    End Sub
                    All I get are Run-time errors, both from the plugin and RR. I've also tried leaving the object declaration in the RRSDK.cls file and moving a new declaration into the SDK.bas like:
                    Code:
                    Public RRSDK As RRSDK
                    
                    Public Sub Class_Initialize()
                    
                        Set RRSDK = New RRSDK
                    
                    End Sub
                    I just get the same Run-time errors, "Object variable or With block variable not set" from the plugin and "Automation error" from RR.

                    Any help is appreciated.
                    98' Honda CR-V
                    http://www.superbluecrv.com

                    *OBDMPG, the RR OBD Plugin*

                    Comment


                    • #11
                      Nevermind, I got it to work.
                      98' Honda CR-V
                      http://www.superbluecrv.com

                      *OBDMPG, the RR OBD Plugin*

                      Comment

                      Working...
                      X