Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

Stinebaugh

@Stinebaugh
About
Posts
10
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • System.AccessViolationException Closing Windows Form Contianing An ActiveX Control
    S Stinebaugh

    FYI to anyone who may come across this issue. I was able to find a workaround to this issue by using a timer that closed the form after the disconnect event had finished. Here is a link to the solution: http://www.codeproject.com/Messages/3622059/Run-Code-Fire-Event-After-First-Event-Finishes.aspx[^]

    Visual Basic help com performance

  • Run Code/Fire Event After First Event Finishes
    S Stinebaugh

    The Timer method worked great. Thanks for helping me find a work around on this.

    Windows Forms help com

  • Run Code/Fire Event After First Event Finishes
    S Stinebaugh

    Guess I forgot to name the type of OCX control. This is an OCX for Remote Desktop/Terminal Services, so the disconnect event if fired whenever they log off, and unfortunetly, I can't capture anything prior to that. I actually do call the disconnect event from the form close, assuming its still connected, and that works. We just prefer to have people log off of there session rather than leaving a disconnected session though.

    Windows Forms help com

  • Run Code/Fire Event After First Event Finishes
    S Stinebaugh

    I have a form with an ActiveX control on it. When the disconnect event of the OCX runs, I want to close the form. The problem is, if I call the close command from within the disconnect event, I get an access violation as the form/control is disposed of when the OCX event finishes up.

    OCX Disconnect Event
    {
    Custom EventHandler for OCX Disconnect Event
    {
    Clean up all connections and close form
    {
    Form Close Event
    {
    Form is closed and all controls are disposed of
    {
    }
    }
    }
    }
    Exception thrown as the parent form no longer exists
    }

    I just need to make the Clean up all connections and close form function run after OCX Disconnect Event, but I don't know how or if its possible. Any help or work arounds would be appreciated. Currently, my only work around is basically to leave the parent form open and have the user close it.

    Windows Forms help com

  • System.AccessViolationException Closing Windows Form Contianing An ActiveX Control
    S Stinebaugh

    OK, I figured out the reason for the exception. I was closing/disposing of the form within an eventhandler for a control on that form. So basically, I killed the form and then the event tried to finish running and threw the exception. This leads me to another question though. How do I close this form outside of this event? The event in question is OnDisconnected event of the AxMsRdpClient4 class. I want to close the form after disconnecting, but it seems like any attempt I make to close the form within that event will result in the exception.

    Visual Basic help com performance

  • System.AccessViolationException Closing Windows Form Contianing An ActiveX Control
    S Stinebaugh

    I'm kinda stumped on this one. I've been reading for a few hours now and still can't seem to figure out what the problem is. I'm working on a remote desktop tool that consists of a parent mdi form and child forms that contain an AxMSTSCLib control. Everything works great on my machine (Win 7), but when I attempt to run this on a Windows 2003 or XP box, the app crashes when it tries to close the form. At first I thought it was due to me trying to dispose the control, but even removing the dispose step makes no difference. I've included the error message along with some info from the immediate window and a dump analysisy showing the function call causing the access violation. I'm not sure what I have to do to keep this from throwing the error and crashing the app. An unhandled exception of type 'System.AccessViolationException' occurred in System.Windows.Forms.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


    Step into: Stepping over non-user code 'System.Windows.Forms.Form.Close' First-chance exception at 0x59366b49 in RDPConnectionManager.exe: 0xC0000005: Access violation reading location 0x00000000.


    mstscax!CMsTscAx::OnCoreApiDisconnected+87 mstscax!CTSWin32CoreApiNotifySink::OnCoreApiDisconnectedUiThreadWorker+19 mstscax!CTSWin32CoreApiNotifySink::OnCoreApiDisconnectedUiThreadWorkerAsyncCallback::Invoke+16 mstscax!CTSMsg::Invoke+44 mstscax!CTSThread::RunQueueEvent+73 mstscax!CTSThread::RunAllQueueEvents+57 mstscax!CTSThread::OnNotifyThreadEventQueue+7 mstscax!CTSThread::OnNotifyThreadMessage+24 mstscax!PAL_System_Win32_ThreadWndProc+1b user32!InternalCallWinProc+28 user32!UserCallWinProcCheckWow+150 user32!DispatchMessageWorker+306 user32!DispatchMessageW+f


    Let me know if you need any additional information on this problem and I appreciate any input on this.

    Visual Basic help com performance

  • Running New Processes on a Remote Computer with Output
    S Stinebaugh

    I don't have any problems with getting files there as I have a network share that is accessible from all machines. I need a way to actually run the file or process on the remote machine though and capture the output of that file/process.

    Visual Basic sysadmin help question career

  • getting complete name of account NT server
    S Stinebaugh

    I don't have a copy of VB6 to test this with, but this VBScript code should translate pretty closely. You just need to do a WMI query against the Win32_UserAccount class. Name is the User ID and FullName should be the formatted name.

    strUserID = InputBox("Please enter the User ID you wish to find")

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    Set objAccountColl = objWMIService.ExecQuery("Select * from Win32_UserAccount where Name = '" & strUserID & "'")

    For Each objAccount in ObjAccountColl

    strValue = "AccountType: " & objAccount.AccountType & vbCrLf & _
    "Caption: " & objAccount.Caption & vbCrLf & _
    "Description: " & objAccount.Description & vbCrLf & _
    "Disabled: " & objAccount.Disabled & vbCrLf & _
    "Domain: " & objAccount.Domain & vbCrLf & _
    "FullName: " & objAccount.FullName & vbCrLf & _
    "InstallDate: " & objAccount.InstallDate & vbCrLf & _
    "LocalAccount: " & objAccount.LocalAccount & vbCrLf & _
    "Lockout: " & objAccount.Lockout & vbCrLf & _
    "Name: " & objAccount.Name & vbCrLf & _
    "PasswordChangeable: " & objAccount.PasswordChangeable & vbCrLf & _
    "PasswordExpires: " & objAccount.PasswordExpires & vbCrLf & _
    "PasswordRequired: " & objAccount.PasswordRequired & vbCrLf & _
    "SID: " & objAccount.SID & vbCrLf & _
    "SIDType: " & objAccount.SIDType & vbCrLf & _
    "Status: " & objAccount.Status
    MsgBox strValue
    Exit For
    Next

    Visual Basic sysadmin question

  • getting complete name of account NT server
    S Stinebaugh

    What do you mean by complete name? Like My_Domain_name\OU458778 or just the user's name like John Smith?

    Visual Basic sysadmin question

  • Running New Processes on a Remote Computer with Output
    S Stinebaugh

    I have a little tool that I use in my job for running scripts on remote machines and gathering information. Currently I'm doing this through the process class and plink/SSH which works ok. My company is looking at doing away with the SSH server on the boxes which leaves me looking for another method. I know there is psexec which might work although by default most ports are blocked by the firewall, so not positive. Is there any way I can do it programatically without the need to involve an additional application? Any method I use I need to be able to capture the output as the majority of scripts are for gathering information without logging into the server. Any help would be appreciated.

    Visual Basic sysadmin help question career
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups