Results 1 to 4 of 4

Thread: Using OLE Automation For The First Time

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Antrim
    Posts
    80

    Angry

    Hi,

    I recently purchased a piece of third party software (Symantec pcAnywhere) specifically because I needed a piece of remote access software which I could automate.

    Although the automation is unsupported by Symantec they do proved an online manual. I quote: "Visual Basic Examples Should Run As Is". I cut and pasted the following code into my app:

    Dim objRemoteDataManager As Object
    Dim objRemoteData As Object
    Dim strDirectory As String

    objRemoteDataManager = CreateObject(Winawsvr.REMOTEDATAMANAGER)

    strDirectory = objRemoteDataManager.CurrentDirectory

    MsgBox strDirectory

    When I run the app I get the error "Variable Not Defined" on Winawsvr.

    I contacted Symantec for some informal advice, they refuse to help in any way shape or form.

    I've only ever used automation with Access before.

    I've looked in my references and there is no pcAnywhere 9.2 object library to reference.

    Symantec's documentation says that information regarding the automation server (Winawsvr.exe) is stored in the registry and that the code should run as is.

    This example code was probably written using VB6, I only have VB5. Do I have to add something to my code to make VB recognize the automation objects?

    Any suggestions would be greatly appreciated.

    Best regards,

    Rob Brown.

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Hi Rob,

    CreateObject will work fine with VB5. The function expects a class parameter of the format "appname.objecttype". Since it is expecting a string, you cannot omit the double quotes.

    My advice is:

    a) put double quotes around winawsvr.REMOTEDATAMANAGER
    b) moan like buggery to Symantec
    c) don't ever buy Symantec products, they treat their customers like **** - been there.

    Hope it works,

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Antrim
    Posts
    80
    OK, I've tried this and it seems to have moved things on a bit. I'm now getting an object or with block variable not set error on the same line.

    Any more suggestions?

  4. #4
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    You need to use "Set", i.e.

    Code:
    Set objRemoteDataManager = CreateObject(Winawsvr.REMOTEDATAMANAGER)
    Whoever wrote that manual was crap, and didn't test his code. Wonder if it was me.

    Cheers,

    Paul
    Not nearly so tired now...

    Haven't been around much so be gentle...

Posting Permissions

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



Click Here to Expand Forum to Full Width