|
Hi all.
Can anyone tell me that is it possible to record output sound through VB.Net programming (VS2005)??
I am creating a project in which I want to record output sound.
So if you have any idea then suggest me.
Thanks.
Gagan
|
|
|
|
|
Hi all,
I would like to convert my existing c/c++ .net project into vb.net.
Could anyone guide me?
Is there any reference/ step-by-step tutorial or guide I could follow?
Please do help me.
Thanks.
|
|
|
|
|
There is no easy way to do this. You should understand C++ and VB syntax and start writing each functionality of the C++ application in VB. However, if you have a DLL created in C++, you can reuse it without rewriting. Take a look at P/Invoke[^].
|
|
|
|
|
|
I'm developing a POS solution and my problem is:
I have a Keyboard Wedge Ibutton reader that is connected to the ps/2 port.
It handles login and logoff for the users.
it sends 6 chars to a textbox when plugged in and 6 when plugged out.
It works fine with a textbox when it has focus.
But when i want to capture these strings without a textbox with the keydown, ProcessCmdKey event
i only get the codes that the reader sends extra.
MenuLMenuRightUpClearMenuLMenuHomeClearMenuLMenuEndClear
MenuLMenuInsertMenuLMenuLeftUpClearMenuLMenuClearEnterLButton
I have tried the GetAsyncKeyState API ( as a test application )
sample below
Private sr As New StringBuilder
<DllImport("user32.dll")> _
Public Shared Function GetAsyncKeyState(ByVal vKey As Int32) As Short
End Function
Private WithEvents timer1 As New Timer
Sub New()
Me.KeyPreview = True
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
Private Sub timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles timer1.Tick
For Each i As System.Int32 In [Enum].GetValues(GetType(Keys))
Dim x As Integer = GetAsyncKeyState(i)
If x = 1 Or x = -32767 Then
sr.Append([Enum].GetName(GetType(Keys), i))
End If
Next
If Not sr.ToString.Length = 0 Then
Textbox1.Text = sr.ToString
End If
End Sub
after the ibutton is inserted in the textbox1 appears:
MenuLMenuRightUpClearMenuLMenuHomeClearMenuLMenuEndClear
MenuLMenuInsertMenuLMenuLeftUpClearMenuLMenuClearEnterLButton
No security code.
What am i missing here?
|
|
|
|
|
What's with the Timer? You shouldn't be using a Timer for this at all...
Enable the Forms KeyPreview property. The handle the Forms KeyDown event. You can check for the sequence that starts a keycode, and if you see it, start collecting keystrokes for the ID, along with checking for the ending code. Once you see the ending code, you've got the entire IDcode. Put that in your TextBox, or whatever you need to do with it...
|
|
|
|
|
Dave,
Thanks for your replay,
When I capture all the keys in de keydown event it gives me the same result.
example:
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)Handles Me.KeyDown
value += e.KeyData.ToString
End Sub
output:
Menu ALTRight ALTMenu ALTClear ALTMenu ALTClear ALTEnd Home Up LMenu Clear Menu Left Up Insert LMenu Enter
No ID.
How does the texbox capture the id? like (D93207)
It looks like the code is not send throuch the keydown event.
Thanks in advance.
|
|
|
|
|
If your still using the GetAsyncKeyState stuff, you don't need it and it's probably why you're not seeing the keystrokes.
You get the key information in the KeyDown event args.
|
|
|
|
|
Dave,
I used the GetAsyncKeyState API because I couldn't get the ID from the keydown event.
The keydown event gives me the same result.
No id but all the extra codes
I think the ibutton id is not captured by the keydown event.
Is that possible?
Thanks in advance.
|
|
|
|
|
************************Solved**************************
Dave,
I found the solution to my problem.
The keydown event gives the identification code that it is the ibutton reader.
I can capture the ibutten code in the keypress event.
private m_Sb as new stringbuilder
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Return) Then
login()
Else
m_Sb.append(e.KeyChar.ToString)
End If
End Sub
Thanks for the support.
modified on Thursday, October 1, 2009 9:31 AM
|
|
|
|
|
Why don't you use programmable Keyboard
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
SOFTDEV,
It is a full Touch Solution.
No keyboards pressent.
Thanks in advance.
|
|
|
|
|
I have to write an inheritance hierarchy for class Quadrilateral,square and rectangle. Use Quadrilateral as base class of the hierarchy.
so for i had this
Public MustInherit Class Quadrilateral
Public Function getName() As String
Return "Shape"
End Function
Public Function Area() As Double
Return 0
End Function
End Class
Public MustInherit Class Twodimensional
Inherits Quadrilateral
Private Mx As Integer
Private y As Integer
Public Sub New(ByVal xValue As Integer, ByVal yValue As Integer)
Mx = xValue
y = yValue
End Sub
Public Property xpoint() As Integer
Get
Return Mx
End Get
Set(ByVal value As Integer)
Mx = value
End Set
End Property
Public Property Ypoint() As Integer
Get
Return y
End Get
Set(ByVal value As Integer)
y = value
End Set
End Property
End Class
Public Class Square
Inherits Twodimensional
Public sd As Double
Public Sub New()
MyBase.New(0, 0)
Side = 0
End Sub
Public Sub New(ByVal xValue As Integer, ByVal yValue As Integer, ByVal side As Double)
MyBase.New(xValue, yValue)
sd = side
End Sub
Public Property Side() As Double
Get
Return sd
End Get
Set(ByVal Value As Double)
If Value <= 0 Then
sd = 0
Else
sd = Value
End If
End Set
End Property
Public Overloads Function Area() As Double
Return sd * sd
End Function
Public Overloads Function getName() As String
Return "Square"
End Function
End Class
Public Class Rectangle
Inherits Twodimensional
Public height As Double
Public wdith As Double
Public Sub New()
MyBase.New(0, 0)
height = 0
wdith = 0
End Sub
Public Sub New(ByVal xValue As Integer, ByVal yValue As Integer, ByVal height As Double, ByVal wdith As Double)
MyBase.New(xValue, yValue)
height = height
wdith = wdith
End Sub
Public Property h() As Double
Get
Return height
End Get
Set(ByVal Value As Double)
If Value <= 0 Then
height = 0
Else
height = Value
End If
End Set
End Property
Public Property W() As Double
Get
Return wdith
End Get
Set(ByVal Value As Double)
If Value <= 0 Then
wdith = 0
Else
wdith = Value
End If
End Set
End Property
Public Overloads Function Area() As Double
Return 2 * (height * wdith)
End Function
Public Overloads Function getName() As String
Return "Rec"
End Function
End Class
Module Module1
Sub main()
Dim i As Integer
Dim shapes(1) As Quadrilateral
shapes(0) = New Square(0, 0, 5)
shapes(1) = New Rectangle(1, 1, 2, 10)
For i = 0 To shapes.GetUpperBound(0)
If TypeOf shapes(i) Is Twodimensional Then
Dim shape As Twodimensional = _
CType(shapes(i), Twodimensional)
Console.WriteLine("Two:" & vbCrLf & "Name: " & vbTab & _
"{0}" & vbCrLf & "Values: " & vbTab & _
"{1}" & vbCrLf & "Area: " & vbTab & _
"{2}" & vbCrLf, shape.getName(), shape.Area())
Else
Console.WriteLine("No such shape")
End If
Next
End Sub
End Module
I am getting a runtime error like this
Unhandled Exception: System.FormatException: Index (zero based) must be greater
than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String fo
rmat, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] arg
s)
at System.IO.TextWriter.WriteLine(String format, Object arg0, Object arg1)
Press any key to continue . . .
|
|
|
|
|
I wouldn't have exactly done it this way myself, but, hey, it's your code.
The reason you're getting this error is (you don't say on which line it happens) probably because you're telling Console.Writeline that you're going to supply three arguments, {0}, {1} and {2}, to fill in spaces in the output string, but you only supply two of them, shape.getName() and shape.Area().
|
|
|
|
|
now I am getting output as
Two:
Name: Shape
Area: 0
Two:
Name: Shape
Area: 0
Press any key to continue . .
|
|
|
|
|
What happens when you set a breakpoint and step into the code ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Even better, break that monolithic Console.WriteLine into 4 seperate WriteLine statements.
|
|
|
|
|
You seem to be confusing overload with override . Since you did not have virtual methods and overriding, the compile-time type of the variable was used which returned "Shape" instead of the name from the derived class. You should check your book (this kind of codes suggests you are either working examples out of a book or taking a class) or the internet for the syntax.
P.S. - I'm all for using breakpoints as C.G. suggested to see the where the code is going, I just thought you could use a nudge in the right direction on this one.
|
|
|
|
|
ok, here is what i am looking to do;
I have a project where i am making a Html Editor using VB.NET Win Forms. I am looking to allow the user to select page header graphics, overlay other images, gradients, glare images, ect ... and when they export the web page the program to take those pieces and export them out as a single image.
I have not done much at in the way of GDI/GDI+ programming.
Does any one have any ideas has how i can do this? or a link or two to a few articles that explain this?
Thanks for any help.
|
|
|
|
|
Easy enough. Create a Bitmap object the size of the resulting image that you need, then create a Graphics object from that Bitmap and call its DrawImage method to draw those images onto the new Bitmap where you need them.
|
|
|
|
|
I need to be able to read an XML file into a database table that has been exported from another system where the schema may be different to my database table.
Is there a way to dynamically parse a schema to map fields and add them to a database table?
|
|
|
|
|
There's no autoamtic way to do it. You'd have to write the code that takes the data from each column and puts it into the correct column in the dataset/datatable.
|
|
|
|
|
Hi,
I am new to VB (using VB 2008 Express) and am trying to write a program to access my ADSL router and download the traffic statistics. The normal way to access the router is to open IE or Firefox and enter a URL. This calls the router which initiates a new "Authentication" window prompting for a username and password.
I have successfully created s simple form and can manipulate the buttons and textboxes. I can also output some text to a file. I am completely stumped though when it comes to the webbrowser box. If I implement a webbrowser1.navigate("192.168.1.1) command the router initiates an IE "authentication" window. My program stops until an entry is made into this external window. I am also not experienced enough to know if this could also be triggered from HTML or java code. Is it possible to gain control of this window from inside the webbrowser commands ?
I would greatly appreciatte some clues as to how to solve this issue. I am not asking for code as I really want to solve this myself rather than just copy and paste. That teaches nothing.
Thanks in anticipation
Regards
John
|
|
|
|
|
Hi,
We have a Windows Service, written in VB.NET. This service is set to start Automatically on machine start. Authentication/log on parameters are included while setting the Service.
However, we now notice that the service does not start on reboot, returning a Service Failed to log on error. Starting the service manually works without problem.
Server: Win 2003, .NET 2.0
Any help towards a solution would be most appreciated.
Regards,
RB
|
|
|
|
|
Write any errors that may occur during startup of the service to the eventlog. Maybe a network connection isn't ready or something similar.
Tosch
|
|
|
|