|
Hi All,
I created a windows service and i am trying t install it.I am getting an exception as follows
Unable to create an instance of the WindowsService1.ProjectInstaller installer type.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
The inner exception System.Security.SecurityException was thrown with the following error message: Security error..
I have used both the installUtil as well as the msi file approach
I have the admin rights.I am totally baffled about this.It will be so kind from your part to help me out of this.
Thanks and regards,
Sandeep Sreekumar
|
|
|
|
|
|
I need to delay the splash screen display time. The template gives me 2 seconds. I need to display it for 8 or more secs. I am new to this but I am learning. Appreciate your help
Bassem
|
|
|
|
|
What template, what code?
Look for the delay code and increase the value from 2000 to 8000 (it is milliseconds).
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
|
I am trying to develop a utility that can Broadcast the data/Stream for multiple computers on LAN. I am new to network/socket programming. Can anybody help me???????
|
|
|
|
|
|
Hi there
I am looking for broadcasting not multicasting in DOT NET Environment
Thanks
|
|
|
|
|
Jack_Software wrote: I am looking for broadcasting not multicasting in DOT NET Environment
Why broadcasting? Multicast is the way to go - has less overhead and more efficient since only the clients who actually want the cast will receive it.
Broadcasting is like shouting at everyone in a room when you only want to attract the attention of a few.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Our requirement is to shout for everyone means populate it on every computer on the LAN so if u got anything , pls send me
thanks
|
|
|
|
|
|
Thanks for the help
But i m looking very simple scnario i m new to network programming, well what i want .. we have a simple DSL cable which is sending some stream which we receive on a server and there on server we want to broadcast it to all computers on the network. so simply just another broadcast IP and a port will work fine
|
|
|
|
|
Jack_Software wrote: i m new to network programming
You should purchase a book about networking programming vb.net at amazon.com or try to check the result[^] from google.
|
|
|
|
|
Hello,
need help with Code to have a media file (avi media) to be streamed into memory as a memory stream, then played by windows media player from the memory stream.
I am using framework 1.1.
Please help
Thanks
|
|
|
|
|
Look on CodeProject for some articles about DShowNET, this is a wrapper around some of the DirectX stuff which may be able to help you.
The Welsh will always support two teams: The Welsh, and anyone playing England
|
|
|
|
|
Thanks, but still no luck with these attempts.
Still looking as I have been hinted in google that there is a solution.
|
|
|
|
|
Hi all,
I have a problem using multithread application with vb.net .
I am opening a thread ,inside that thread i am calling third party DLL function . but that function internally opening child threads . whenever I am aborting the main thread , child thread is not aborting . is that any function to close the main as well as child thread.
Jaseem
Emirates group
email: tc02142@emirates.com
|
|
|
|
|
Not unless you are getting a handle on those internal child threads and can then call abort on them.
Seems to me that those internal threads should have been created with the background attribute set or the library should provide you with a method to call to close them down.
My Blog[^] FFRF[^]
|
|
|
|
|
Are you sure the DLL is spawning threads ? If that were the case, destroying the main thread should kill all other threads created by it.
Most likely the DLL is spawning a new process which runs independently of your main code and hence it will not terminate when your main thread terminates. In this case you'll need to manually kill the spawned processes as already described in the previous post.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
-- modified at 19:21 Tuesday 20th June, 2006
|
|
|
|
|
I was wondering if there is anyway to change just a group box line color. I want to have a group box with a transparent background but I want the boxs' border line to be orange. Someone, Anyone, please help me out with this one. Thank you in advance for your replies!!!
-Joey
|
|
|
|
|
There's no property you can change to get the GroupBox lines to draw in a different color. You'll have to create your own GroupBox control, inheriting from the normal GroupBox class, and supply your own drawing code to draw the GroupBox. Considering the effort involved, is the color of that line really worth it?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I seek an internal end of module to a program which is used to block this program during a time of use. Can somebody give some to me?
Thanks
|
|
|
|
|
This doesn't make any sense what-so-ever. You're looking for code to do what?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello,
I tried to search 'the net', but all i can find is C++ code. I don't understand C++, so you know. I need to disable my Secondairy Master/Slave (which are my DVD and CD drive). Could someone give me a hint? Or perhaps a little code, my tagret is to disable and enable my Cd-rom drives with just executing my program.
Much appreciated!
Lennard Fonteijn
You mess with the best, you die like the rest!
-- modified at 10:38 Tuesday 20th June, 2006
|
|
|
|
|
What do you mean by disable them? and why?
Do You want to "Lock the tray's from opening and closing" ?
'--- form code --- form1.vb ------------
Imports System.Runtime.InteropServices
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(32, 24)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(96, 24)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Lock"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(32, 64)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(96, 24)
Me.Button2.TabIndex = 1
Me.Button2.Text = "Unlock"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 118)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Name = "Form1"
Me.Text = "CDLock Demo"
Me.ResumeLayout(False)
End Sub
#End Region
'*********************************************************
' IO Demo Locks/Unlocks Optical Disk Drive - VB.Net
'*********************************************************
#Region " API IO Control "
Private Structure OVERLAPPED
Dim Internal As IntPtr
Dim InternalHigh As IntPtr
Dim Offset As Integer
Dim OffsetHigh As Integer
Dim EventHandle As IntPtr
End Structure
Private Structure PREVENT_MEDIA_REMOVAL
Dim PreventMediaRemoval As Boolean
End Structure
<DllImport("kernel32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function CreateFile( _
ByVal lpFileName As String, _
ByVal dwDesiredAccess As Integer, _
ByVal dwShareMode As Integer, _
ByVal lpSecurityAttributes As IntPtr, _
ByVal dwCreationDisposition As Integer, _
ByVal dwFlagsAndAttributes As Integer, _
ByVal hTemplateFile As Integer) As Integer
End Function
<DllImport("kernel32.dll", ExactSpelling:=True, SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function DeviceIoControl( _
ByVal hDevice As Integer, _
ByVal dwIoControlCode As Int32, _
ByVal lpInBuffer As IntPtr, _
ByVal nInBufferSize As Int32, _
ByVal lpOutBuffer As IntPtr, _
ByVal nOutBufferSize As Int32, _
ByRef lpBytesReturned As Int32, _
ByVal lpOverlapped As OVERLAPPED) As Boolean
End Function
Private Declare Function CloseHandle Lib "kernel32" ( _
ByVal hObject As Integer) As Integer
Private Const INVALID_HANDLE_VALUE As Integer = -1
Private Const GENERIC_READ As Integer = &H80000000
Private Const GENERIC_WRITE As Integer = &H40000000
Private Const FILE_SHARE_READ As Integer = &H1
Private Const FILE_SHARE_WRITE As Integer = &H2
Private Const OPEN_EXISTING As Integer = 3
Private Const FILE_ATTRIBUTE_NORMAL As Integer = &H80
Private Const ERROR_ACCESS_DENIED As Integer = 5
Private Const IOCTL_STORAGE_MEDIA_REMOVAL As Integer = &H2D4804
'--------------------------------------------------------------------------
'cref: uses OVERLAPPED structure as per MSDN specifications.
'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/ioctl_storage_media_removal.asp
'--------------------------------------------------------------------------
Private Sub LockOpticalDrive(ByVal sDrive As String, ByVal bLockState As Boolean)
Dim dwRetval As Integer = 0
Dim pmr As PREVENT_MEDIA_REMOVAL
Dim hDevice As Integer
Dim ol As OVERLAPPED
'Get desired lock state
pmr.PreventMediaRemoval = bLockState
'Get a handle to the drive
hDevice = CreateFile("\\.\" & sDrive & ":", GENERIC_READ, FILE_SHARE_READ Or FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, 0)
Debug.WriteLine("WIN32 CreateFile: " & "Error: " & Err.LastDllError & " Handle: " & Handle.ToInt32)
If hDevice = INVALID_HANDLE_VALUE Then
MsgBox("Unable to find optical drive")
Exit Sub
End If
' Marshal Structure
Dim inBufferSize As Integer = Marshal.SizeOf(pmr)
Debug.WriteLine("inBbufferSize: " & inBufferSize)
Dim inBuffer As IntPtr = Marshal.AllocCoTaskMem(inBufferSize)
Marshal.StructureToPtr(pmr, inBuffer, False)
'Lock the drive
If DeviceIoControl(hDevice, IOCTL_STORAGE_MEDIA_REMOVAL, inBuffer, inBufferSize, IntPtr.Zero, 0, dwRetval, ol) = False Then
Debug.WriteLine("WIN32 DeviceIoControl: " & Err.LastDllError & " dwRetval: " & dwRetval)
MsgBox("Error accessing drive")
End If
'Free the memory and close the handle.
Marshal.FreeCoTaskMem(inBuffer)
CloseHandle(hDevice)
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Lock the "E" optical drive
LockOpticalDrive("E", True)
MsgBox("Drive is locked")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Unlock the "E" optical drive
LockOpticalDrive("E", False)
MsgBox("Drive is unlocked")
End Sub
End Class
'------------------------------------
progload
|
|
|
|