Page 4 of 4 FirstFirst 1234
Results 31 to 36 of 36

Thread: How to communicate with RR via COM/ActiveX?

  1. #31
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    you can always use Exec.exe to send commands to RR. And while you CAN use the Object model in C++ you'd have to add a whole bunch of code to prepare the late bound object so you can use the methods and properties available. All I'm saying is that if you're planning to do it in C++ I would truly recommend you use the SendMessage API -- which is what I have used in the past. You CAN obtain any data from RR in that fashion, using of the REQUEST command. But if you're determine to do it, here is some good reading:
    http://support.microsoft.com/kb/216686
    http://msdn2.microsoft.com/en-us/library/ms877981.aspx
    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."

  2. #32
    Variable Bitrate
    Join Date
    Nov 2006
    Posts
    265
    guino,

    Thanks.

    My only reluctance to using SendMessage has been the response processing in C++.

    I have SendMessage working to send commands from C++ but don't have the processing coded to handle messages coming into my C++ program from RR or other processes.

    I have all of this (SendMessage) working in AutoIt to send commands and get data back but the apparent need to use C++ for SAPI C&C has forced me to move in the C++ direction.

    Actually I have both the SendMessage and COM/Activex approaches working in AuotIt. The difference being when I discovered the COM approach vs the SendMessage approach.

    I will look at the pages you referenced in your post and work from there to see if I can get the COM/Activex method to work.

    However, if you or anyone has a C++ example of the setup for and processing of messages sent to my C++ app by RR or other processes using SendMessage I would appreciate seeing it. I have the part working where I use SendMessage to send a command to RR, It's just the processing of the response from a "REQUEST" that I need an example of.

    Regards,
    Jim

  3. #33
    Variable Bitrate
    Join Date
    Nov 2006
    Posts
    265
    guino,

    After reading the first item you referenced, I have managed to get GetInfo, Execute, and GetInd working. Once I saw how to get the class id of the SDK from it's name much of the rest came back to me.

    However, I have one small problem that maybe you or someone can provide some insight.

    There is a second parameter on Execute that is a boolen value inidcating whether to wait for execution of the command or not.

    I have tried various Variant types but can get none to work as all seem to get a Type Mismatch error.

    Do you have any thoughts on how to set up the VARIANT structure in C++ to sucessfully pass a boolean from C++ to the RR SDK class Execute method?

    I can let it default to FALSE, but it would be nice for completeness or just in case I need to wait for command execution.

    Regards,
    Jim

  4. #34
    Variable Bitrate
    Join Date
    Nov 2006
    Posts
    265
    I have most everything working with the SDK calls in C++ except the boolean argument for SDK.Execute.

    However, I did trip over one thing. The SDK calls can't be used from inside a Window Procedure including such a procedure in AutoIt as shown in the _GUIRegisterMsgProc(...) function in receiver.au3 shipped with the RR source.

    The error seeems to have something to do with dispatching the SDK call within a synchronous procedure or some such. I didn't spend anytime trying to track down the exact problem and simply used SendMessage in those cases.

    The work I've been doing has to do with more fully supporting nRoute as well as supporting the Treo650 via PDAReach. I've also built my own variation on Voice Commands. All of this supports some very un-artistic (some might say "plain") skins.

    Regards,
    Jim

  5. #35
    Maximum Bitrate
    Join Date
    Nov 2005
    Posts
    597
    Quote Originally Posted by guino
    -on the form_load add: Set SDK = CreateObject("RoadRunner.SDK")
    What is the correct way to unload the SDK object?
    I have a huge problem where if I exit RR, my app dies. Id like to be able to check if RR has quit, and if so.. save my apps current state and exit my app gracefully. First reason for this is so i dont have a horrible error msg pop-up and second is because Im pretty sure that the memory allocation which my app uses dont get unlocked - and then i get memory leaks. I know for a fact that I run out of virtual memory after a few instances of my app being run..crashing...run again.. crashing again.

    The next issue I have is that my app does not like hibernate. The app will work when i come back from hibernate (some of it), but i cant actually bring the window up on the screen. It just sits in the task bar as a working task, but is not responsive to being selected/maximise/etc/close/Alt+F4. It still reacts to some commands though (it reacts to stimulus, but doesnt do polling/displaying of polled data) - which is nice, but weird. I have to CTRL-ALT-DEL it to kill it and start a new instance.

    Thanks
    Ice

  6. #36
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    To UNLOAD the SDK object, all it takes is to set it to = Nothing. If you're not using the SDK very often you could initialize it, use it, then destroy it until the next time you need it. If you do use it constantly, you may find "FindWindow("RoadRunner",VbNullString)" useful to detect if RR is still running, though I'd say depending on the language, you should be able to check if the SDK object has been destroyed (= Nothing) and/or detect/prevent an error from happening.
    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."

Page 4 of 4 FirstFirst 1234

Similar Threads

  1. REQUEST: Run Multiple RR instances
    By Jarrod in forum Road Runner
    Replies: 33
    Last Post: 12-21-2008, 07:54 AM
  2. Replies: 0
    Last Post: 09-23-2006, 08:38 PM
  3. Replies: 0
    Last Post: 06-11-2006, 05:49 PM
  4. RR doesn't start Phoco on initial load..
    By DutchBurner in forum Road Runner
    Replies: 16
    Last Post: 11-04-2005, 01:17 PM
  5. status update....
    By 0l33l in forum PowerVoice
    Replies: 17
    Last Post: 05-05-2005, 12:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •