Results 1 to 7 of 7

Thread: [RESOLVED] Conversation Error

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2009
    Posts
    3

    Resolved [RESOLVED] Conversation Error

    Code:
    Public Class Form1
    
    
        Private Sub Btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn1.Click
    
            Dim strCode As String
            Dim myobj As Object, program
    
            myobj = CreateObject("wscript.shell")
            myobj = myobj.exec("cmd /c c:\myDosProgram.exe")  'your shell command
            Do
                With myobj
                    With .StdOut
                        If Not .AtEndOfStream Then
                            strCode = .readall()
                        End If
                    End With
                End With
                'DoEvents()
            Loop While myobj.Status = "WshRunning"
            myobj = Nothing
    
        End Sub
    End Class

    Conversion from string "WshRunning" to type 'Double' is not valid.

    anyone got any idea what i should do to my codes to make it works ?

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Conversation Error

    Are you trying to convert to .Net or VB6?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2009
    Posts
    3

    Re: Conversation Error

    nope. im using microsoft visual studio 2005

  4. #4
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: Conversation Error

    The Status property returns a value from an enumerated type.
    WshRunning ( = 0) : The job is still running.
    WshFinished ( = 1): The job has completed.
    Declare: Const WshRunning = 0
    then replace "WshRunning" with WshRunning

    or replace "WshRunning" with 0

    Loop While myobj.Status = 0
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

  5. #5
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Conversation Error

    Welcome to the VBForums.
    If you have questions on VB.NET (which Visiual Studio 2005 is) you'd better post such questions in the Forum "Visual Basic .Net".
    I believe you copied that code/ or parts of it somewhere. You missid to copy the declaration of WSHRunnig. Something like:
    Code:
    Const WshRunning = 0
    WshFinished = 1
    WshFailed = 2
    With this declaration you can use WSHRunning without the ""!

    Damm it, somebody was faster.
    Last edited by opus; Apr 20th, 2009 at 02:36 AM. Reason: A Head Hunter passed in the middle of writing.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2009
    Posts
    3

    Re: Conversation Error

    ok thx. i did copied the codes. and sry abt psoting at the wrong forum. didnt know visual studio 2005 is vb.net

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Conversation Error

    Thread moved from 'VB6 and Earlier' forum to 'VB.Net' (VB2002 and later) forum

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