Click here to Skip to main content
15,890,438 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: linklabel Pin
jzonthemtn22-Oct-08 1:22
jzonthemtn22-Oct-08 1:22 
QuestionUnhandled Exception Pin
Tauseef A21-Oct-08 16:58
Tauseef A21-Oct-08 16:58 
AnswerRe: Unhandled Exception Pin
Colin Angus Mackay21-Oct-08 22:51
Colin Angus Mackay21-Oct-08 22:51 
QuestionText Boxes Print Preview Pin
jagdishg21-Oct-08 9:11
jagdishg21-Oct-08 9:11 
AnswerRe: Text Boxes Print Preview Pin
Dave Kreskowiak21-Oct-08 10:32
mveDave Kreskowiak21-Oct-08 10:32 
GeneralRe: Text Boxes Print Preview Pin
jagdishg21-Oct-08 12:22
jagdishg21-Oct-08 12:22 
GeneralRe: Text Boxes Print Preview Pin
Dave Kreskowiak22-Oct-08 4:49
mveDave Kreskowiak22-Oct-08 4:49 
QuestionNeed advice with WshNetwork PLEASE Pin
Trey549821-Oct-08 8:54
Trey549821-Oct-08 8:54 
I could really use some help with this. I have tested it and refined it a bit and it doesn't work and I need some help. It is in a BG worker. Here is the complete code. Need to try to get this done ASAP.


Public Class prnProcessing 
    Dim WshNetwork = CreateObject("WScript.Network") 
 
    Public arrInstalled As New ArrayList() 
    Dim WithEvents ToDoWork As New System.ComponentModel.BackgroundWorker 
 
 
    Public Sub prnProcessing_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
 
        If prnSelection.arrToInstall.Count > 0 Then 
            'added 10-2-08 
            prnProgress.Style = ProgressBarStyle.Continuous 
            'prnProgress.Dock = DockStyle.Bottom 
            prnProgress.Visible = False 
            prnProgress.Minimum = 1 
            prnProgress.Maximum = prnSelection.arrToInstall.Count 
            'end add 10-2-08 
 
            ToDoWork.WorkerReportsProgress = True 
            ToDoWork.WorkerSupportsCancellation = True 
            ToDoWork.RunWorkerAsync(prnSelection.arrToInstall) 
            Me.CenterToScreen() 
        Else 
            MsgBox("There are no printers to install.  Please choose the printers you wish to install.") 
            prnSelection.Show() 
            Me.Close() 
        End If 
 
    End Sub 
 
    Public Sub ToDoWork_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles ToDoWork.DoWork 
 
        Dim worker As System.ComponentModel.BackgroundWorker = CType(sender, System.ComponentModel.BackgroundWorker) 
        If e.Argument IsNot Nothing AndAlso TypeOf (e.Argument) Is ArrayList Then 
            Dim arrToInstall As ArrayList = e.Argument 
            If arrToInstall.Count > 0 Then 
                Dim i As Integer = 1 
                For Each printer As String In arrToInstall 
                    CallByName(Me, printer, CallType.Method) 
                    worker.ReportProgress(i) 
                    i += 1 
                    System.Threading.Thread.Sleep(200) 
                Next 
            End If 
        End If 
    End Sub 
 
    Public Sub ToDoWork_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles ToDoWork.ProgressChanged 
        prnProgress.Visible = True 
        prnProgress.Value = e.ProgressPercentage 
    End Sub 
 
    Public Sub PrinterProgress(ByVal i As Integer, ByVal worker As System.ComponentModel.BackgroundWorker, ByVal e As System.ComponentModel.DoWorkEventArgs) 
        worker.ReportProgress(i) 
    End Sub 
    Public Sub ToDoWork_EndProgress() Handles ToDoWork.RunWorkerCompleted 
        ToDoWork.Dispose() 
        prnWrapup.Show() 
        Me.Close() 
    End Sub 
 
    Public Sub CSE211CLQ() 
        MsgBox("Does it start??", vbOK) 
        'arrInstalled.Add("CSE-211-CLQ") 
  
        WshNetwork.AddWindowsPrinterConnection("LPR", "\\at-cetus.ad.ufl.edu\CSE-211-CLQ", "True") 
        MsgBox("Did it install??", vbOK) 
 
        Shell("net stop spooler") 
        Shell("net start spooler") 
 
        Shell("rundll32 printui.dll, PrintUIEntry /if /b ""test_1/"" /f ""C:\7760.inf\"" /q /r ""at-cetus.ad.ufl.edu:CSE-211-CLQ/"" /m ""Xerox Phaser 7760GX PS"" /z /u") 
 
        MsgBox("Did it install??", vbOK) 
 
 
    End Sub 
End Class 



I have added two msg boxes before and after and when it gets to the WshNetwork line it just conks out and quits the bg workers and goes to the next form without showing the next msgbox or doing anyother thing. How do I get this to work.
AnswerRe: Need advice with WshNetwork PLEASE Pin
Dave Kreskowiak21-Oct-08 10:24
mveDave Kreskowiak21-Oct-08 10:24 
GeneralRe: Need advice with WshNetwork PLEASE Pin
Trey549822-Oct-08 2:04
Trey549822-Oct-08 2:04 
GeneralRe: Need advice with WshNetwork PLEASE Pin
Dave Kreskowiak22-Oct-08 4:34
mveDave Kreskowiak22-Oct-08 4:34 
GeneralRe: Need advice with WshNetwork PLEASE Pin
Trey549822-Oct-08 5:05
Trey549822-Oct-08 5:05 
GeneralRe: Need advice with WshNetwork PLEASE Pin
Dave Kreskowiak22-Oct-08 6:37
mveDave Kreskowiak22-Oct-08 6:37 
QuestionNeed Help on Custom Action Installer Pin
Saseendran Kombath21-Oct-08 8:19
Saseendran Kombath21-Oct-08 8:19 
AnswerRe: Need Help on Custom Action Installer Pin
Dave Kreskowiak21-Oct-08 8:29
mveDave Kreskowiak21-Oct-08 8:29 
GeneralRe: Need Help on Custom Action Installer Pin
Saseendran Kombath21-Oct-08 23:34
Saseendran Kombath21-Oct-08 23:34 
GeneralRe: Need Help on Custom Action Installer Pin
Dave Kreskowiak22-Oct-08 4:22
mveDave Kreskowiak22-Oct-08 4:22 
GeneralRe: Need Help on Custom Action Installer Pin
Saseendran Kombath23-Oct-08 4:15
Saseendran Kombath23-Oct-08 4:15 
QuestionHow do remove unwanted coulmns from a data grid? Pin
Arun Philip R21-Oct-08 8:09
Arun Philip R21-Oct-08 8:09 
AnswerRe: How do remove unwanted coulmns from a data grid? Pin
Wendelius21-Oct-08 8:28
mentorWendelius21-Oct-08 8:28 
QuestionRe: How do remove unwanted coulmns from a data grid? Pin
Arun Philip R21-Oct-08 8:41
Arun Philip R21-Oct-08 8:41 
AnswerRe: How do remove unwanted coulmns from a data grid? Pin
Wendelius21-Oct-08 8:50
mentorWendelius21-Oct-08 8:50 
GeneralRe: How do remove unwanted coulmns from a data grid? Pin
Arun Philip R22-Oct-08 3:22
Arun Philip R22-Oct-08 3:22 
AnswerRe: How do remove unwanted coulmns from a data grid? Pin
Arun Philip R22-Oct-08 4:00
Arun Philip R22-Oct-08 4:00 
GeneralRe: How do remove unwanted coulmns from a data grid? Pin
Wendelius22-Oct-08 7:36
mentorWendelius22-Oct-08 7:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.