CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2000
    Location
    Florida
    Posts
    9

    ACTIVE X PROBLEM

    I think the error was Active X Error Something about GetObject.
    My program doesn't work when shelling out another program. For example.
    Result = shell(c:\winnt\system32\evntvwr.exe) & "\\" & txtcomputername.text

    It works in my project and on the computer I have written this app on. However any other computer gets an Active X error. Please email me with a hopeful answer...

    [email protected]

    Juan Torres


  2. #2
    Join Date
    Feb 2000
    Location
    Indiana
    Posts
    308

    Re: ACTIVE X PROBLEM

    Is this the exact code you're using? You're indicating that Result should contain a string consisting of the result of shell(c:\winnt\system32\evntvwr.exe) (this would fail because you didn't use quotes around your path) followed by "\\" and the text that's in txtcomputername. If this isn't the actual code you're using, please copy and paste your code.


  3. #3
    Join Date
    Feb 2000
    Location
    Florida
    Posts
    9

    Re: ACTIVE X PROBLEM

    I dont know if you got my reply.
    Public Function Eventviewer()
    Dim FileSystem As Object
    Dim exists As Boolean
    Dim eventview As Double
    Dim Eventviewer1 As String

    Eventviewer1 = "c:\winnt\system32\Eventvwr.exe"
    Set FileSystem = CreateObject("scripting.filesystemobject")
    exists = FileSystem.fileexists(Eventviewer1)
    If exists Then
    If frmping.txtcomputername = "" Then
    MsgBox "Please enter a computer name..."
    Else
    frmping.lbltitle.Caption = "Event Viewer is Open on " & frmping.txtcomputername
    eventview = Shell(Eventviewer1 & " \\" & frmping.txtcomputername, vbNormalFocus)
    End If
    Else
    MsgBox "Please make make sure the eventvwr.exe is in the c:\winnt\system32 directory"
    End If
    End Function

    Sorry if you did already

    Juan Torres
    Blue Cross Blue Shield of Florida
    Configuration Management & Distribution Solutions
    "Procastinating may be a bad habit, but a good tool for learning many different outcomes in life."

  4. #4
    Join Date
    Feb 2000
    Location
    Indiana
    Posts
    308

    Re: ACTIVE X PROBLEM

    I'd say that the chances that the error message youreceived was a result of your CreateObject("Scripting.FileSystemObject") call. Try installing the scripting runtime on the target computer. Another option for you would be to set a reference to the scripting runtime in your project and declare FileSystem as Scripting.FileSystemObject instead of Object. Then you can create an install program that will include the scripting library. If you don't declare the variable as Scripting.FileSystemObject, then your app doesn't know it needs the scripting runtime until it has already failed.


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

Featured