|
Yes, the easy access on screen keyboard. If you like I can try others but I think they will all work with the dos program to.
Thank you for taking the time to consider my question Mr. Andrew
|
|
|
|
|
I tried sending sendkeys to the dos process I set focus to. The focus worked and brought the dos program to the forefront but no luck on the senkeys. I substituted the dos program name with notepad and it worked fine. Upon researching the problem most people were of the option sendkeys would not work with dos programs.
|
|
|
|
|
I just tried an experimental program where I sent keystrokes to an open command window, and it worked.
Are you able to send keystrokes to any other command prompt windows (i.e. running a different DOS program?)
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Yes just tried to send to command prompt, worked great. Why cant I send it to the dos program.
This is the vary basic code I am testing with (Proof of concept)
Private Sub BtnSetFocus_Click(sender As System.Object, e As System.EventArgs) Handles BtnSetFocus.Click
Dim App As Process() = Process.GetProcessesByName(DosTitle.Text)
Label1.Text = "Program Not Found"
If App.Length > 0 Then
Label1.Text = "Program Found"
AppActivate(App(0).Id)
Thread.Sleep(1000)
SendKeys.Send("7 " + vbCr)
End If
End Sub
|
|
|
|
|
I notice that you're sending a carriage return after the character.
According to this page, [^] you should send "{ENTER}" if you wish to have the effect of pressing the ENTER key.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I tried it using
Sendkey"7" + "{chr(13)}"
I tried it using
Sendkey"7"
I tried it using
Sendkey"7" + "{ENTER}"
I tried it using
Sendkey"7"
Sendkey"{ENTER}"
if anything I am persistent
Thank you for your time Mr Andrew
|
|
|
|
|
This is a different function to test SSL connectivity to a Web Service.
I keep getting timout on using Stream_writer. I'm thinking that I can't ask for a request until I send data to the website, or it just can't be done using streamwriter. I'm not sure, I don't do much stuff like this, but it works fine on port 80.
And the URL is like https://domain.com/webservice.asmx"
Dim request_str As String = "/ HTTP/1.1" & vbLf & "Host: " & pHost & "?wsdl"
Dim response_str As String = Nothing
Dim encoder As ASCIIEncoding = New ASCIIEncoding
Dim bytes() As Byte = encoder.GetBytes(request_str)
Dim request As HttpWebRequest = HttpWebRequest.Create(pUrl & "?wsdl")
request.Credentials = CredentialCache.DefaultCredentials
request.Method = "POST"
request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"
request.ContentType = "application/x-www-form-urlencoded"
request.KeepAlive = False
request.UserAgent = "SMTP Messenger 2015/" & My.Application.Info.Version.ToString
request.Referer = ""
request.ContentLength = bytes.Length
request.Timeout = 15
Try
ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf AcceptAllCertifications)
Using stream_writer As StreamWriter = New StreamWriter(request.GetRequestStream)
stream_writer.Write(request_str)
End Using
Using response As HttpWebResponse = request.GetResponse()
Using stream_response As StreamReader = New StreamReader(response.GetResponseStream())
response_str = stream_response.ReadToEnd()
stream_response.Close()
If (response_str IsNot Nothing) Then
If response_str.Contains("<?xml version") Then
global_variables.gOnline = True
pValue = True
End If
End If
End Using
End Using
Catch ex As WebException
|
|
|
|
|
Well I banged my head against the wall for hours on this. So I broke out fiddler.
I finally realized that I just needed to send a GET request, but kept getting that error, Verb GET cannot perform this function. hmm?
Finally I realized that I don't need to to use streamwriter to send anything, and that I just needed to use HttpWeResponse to send HttpWebRequest and read the result.
I don't have a lot of experience with using HttpWebRequest and Response, but I'm getting better at now. As as side note, I didn't know that you can attach the ServerCertificateCallback to HttpWebRequest.
So I had many issues here.
How to handle SSL,
and how to write a GET request.
Many threads on other sites simply said just change get to post.
Perhaps I should of just searched for how to request a web page.
Dim request_str As String = "/ HTTP/1.1" & vbLf & "Host: " & pHost
Dim response_str As String = Nothing
Dim request As HttpWebRequest = HttpWebRequest.Create(pUrl)
request.Credentials = CredentialCache.DefaultCredentials
request.ClientCertificates.Add(New X509Certificate)
request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"
request.CookieContainer = New CookieContainer()
request.ContentType = "application/x-www-form-urlencoded"
request.KeepAlive = True
request.Method = "GET"
request.Timeout = 10000
request.UserAgent = My.Application.Info.Title & "/" & My.Application.Info.Version.ToString
request.ServerCertificateValidationCallback = New _ System.Net.Security.RemoteCertificateValidationCallback(AddressOf AcceptAllCertifications)
Try
Using response As HttpWebResponse = request.GetResponse()
Using stream_response As StreamReader = New StreamReader(response.GetResponseStream())
response_str = stream_response.ReadToEnd()
stream_response.Close()
If (response_str IsNot Nothing) Then
If response_str.ToLower.Contains("<html") Then
global_variables.gOnline = True
pValue = True
End If
End If
End Using
End Using
Catch ex As WebException
global_variables.gOnline = True
pValue = True
End Try
|
|
|
|
|
I have a test program that will test the connection to an email server that I wrote using a socket, in which I send text command like EHLO.
It's just a fun program to play around with. But I'd like to play around with StartTLS for socket connections on port 587.
Can't find much on the subject. I can issue a StartTLS to the mail server but I'm not sure what to do next. Do I need to generate a certificate, or send my key to the mail server, stuff like that.
I found tech support for compiled programs, and that was about it. Any help would be appreciated!
|
|
|
|
|
|
Hello !
I have an application on vb.net 2013.
Is there any way , or some library that I can use to read from Barcode Readers (USB) ?
Thank you !
|
|
|
|
|
It depends on the information provided by the barcode reader. Check the documentation for the device, and see if the manufacturer provides a programming API.
|
|
|
|
|
If you have a barcode-scanner with an USB-connector, it will have keyboard-emulation. Meaning, it will send key-press-events to your application as if you entered something via keyboard. You can verify that by opening just any word-processing application and scanning a barcode. It should appear as if entered via keyboard.
So all you would have to do is to ensure that some text-input-control has the input-focus before attempting to scan something and then process it like any text-input.
Theoretically there are ways to directly read it from the barcode-scanner so that you don't have to have that text-input-control but that would be way more advanced. If you want to take a look at that anyway, I can serve you only with an article that does this with C#:
Using Raw Input from C# to handle multiple keyboards[^]
Edit: Some manufacturers also provide APIs for their barcode scanners which would provide a third way to do this. I haven't dabbled with any of those yet because it would mean to restrict the range of barcode scanners my application would be able to work with.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Good day friends! I have been wondering on how I can create my own installer from scratch in vb6.0 without using deployment wizard or any third party app. Any suggestion is welcome.
|
|
|
|
|
Thought it's possible, I highly recommend you don't.
First, in order for the VB6 "installer app" to work, you have to make sure the VB6 runtimes are installed. VB6 code will not run at all without them.
Seriously, use an installation creation tool like InnoSetup or Advanced Installer or whatever. Don't try to "roll your own", even more so considering you even asked this question to begin with. It tells us that you have no idea what you're doing or how complicated this is going to be.
Lastly, why are you even using VB6? It's been dead for quite a long time now. VB.NET is free for the Express or Community editions. The Community edition can be found here[^].
|
|
|
|
|
Use Install Sheild 2010. It is best. But leave vb6.0 and move to vb.net or c#.
|
|
|
|
|
<pre lang="VB.NET">Try
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection _
("provider=Microsoft.Jet.OLEDB.4.0;" _
" Data Source = 'c:\testfile.xls'; " _
"Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter _
("select * from [Sheet1$]", MyConnection)
MyCommand.TableMappings.Add("Table", "TestTable")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
DataGridView1.DataSource = DtSet.Tables(0)
MyConnection.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try</pre>
|
|
|
|
|
You can't split the string with the _ characters like that. If you want to spread that over several lines then introduce a variable e.g.
Dim ConnectionString As String = "provider=Microsoft.Jet.OLEDB.4.0;"
ConnectionString += " Data Source = 'c:\testfile.xls'; "
ConnectionString += "Extended Properties=Excel 8.0;"
MyConnection = New System.Data.OleDb.OleDbConnection(ConnectionString)
|
|
|
|
|
HELLO net programers, i have problem to display marker Point on Digital Maps (format shapefile). Can you help me guys ?
i hope so
Thanks,
|
|
|
|
|
What have you tried? Where are you stuck?
|
|
|
|
|
I am developing a sample project in Visual basic 6 and MS Access 2003.
1. I wish to print Invoice in Continuous statonery (Roll Paper ) width of paper 5.5 inches
I am printing CRYSTAL Report 8.5 report in Roll paper (Continuous Stationery)
My problem , after printing one bill printer skips and giving lot of space between two bills. My aim printer must stop printing after completing one bill. ( no gaps required ) and user tear off that bill and continue to print next bill.
I am printing invoice in DOT MATRIX PRINTER (USB )
My code is
BILLPRINT.DiscardSavedData
BILLPRINT.Database.SetDataSource rs
crviewerbill.ReportSource = BILLPRINT
crviewerbill.Zoom (100)
BILLPRINT.ReportTitle = "BILL"
BILLPRINT.txtdue.SetText "" & custdue & ""
BILLPRINT.PrintOut False
|
|
|
|
|
Crystal Reports doesn't support printing on continuous paper.
|
|
|
|
|
I am developing a sample project in Visual basic 6 and MS Access 2003.
1. I wish to print Invoice in Continuous statonery (Roll Paper ) width of paper 5.5 inches
I am using printer.print Code using (x,y) co-ordinates
My problem , after printing one bill printer skips and giving lot of space between two bills. My aim printer must stop printing after completing one bill. ( no gaps required ) and user tear off that bill and continue to print next bill.
I am printing invoice in DOT MATRIX PRINTER (USB )
My code is
Dim cy As Long
Dim cx As Long
Dim cx1 As Long
Dim tmpval As Double
Set rs = New ADODB.Recordset
sql = "select * from del_head where tran=" & Trim(txtcustno.Text) & ""
rs.Open sql, CN, adOpenStatic, adLockPessimistic
If rs.RecordCount > 0 Then
cno = rs(2)
custname = rs(3)
ctown = rs(8)
Set rs3 = New ADODB.Recordset
rs3.Open "select sum(amountdue)-sum(amountrec) from receipt_d where cid = " & cno & "", CN, adOpenStatic, adLockPessimistic
custdue = rs3(0)
rs3.Close
Printer.Font = "Arial"
Printer.FontBold = True
Printer.FontSize = 12
Printer.CurrentX = 3400
Printer.CurrentY = 50
Printer.Print " XXXXXXXXXXXXXXXX "
Printer.Font = "Arial"
Printer.FontBold = False
Printer.FontSize = 10
Printer.CurrentX = 3400
Printer.CurrentY = 350
Printer.Print " XXXXXXXXXXXXXXXXXXXXX "
Printer.Font = "Arial"
Printer.FontBold = False
Printer.FontSize = 11
Printer.CurrentX = 2600
Printer.CurrentY = 650
Printer.Print " XXXXXXXXXXXXXXXXXXXX "
Printer.Font = "Arial"
Printer.FontBold = False
Printer.FontSize = 11
Printer.CurrentX = 3300
Printer.CurrentY = 950
Printer.Print " XXXXXXXXXXXXXXXXXXXX "
Printer.Font = "Arial"
Printer.FontBold = False
Printer.FontSize = 9
Printer.CurrentX = 6400
Printer.CurrentY = 50
Printer.Print " XXXXXXXXXXXXXXXX "
Printer.Font = "Arial"
Printer.FontBold = False
Printer.FontSize = 9
Printer.CurrentX = 6400
Printer.CurrentY = 200
Printer.Print " : XXXXXXXXXXXXXXXX "
Printer.Font = "Arial"
Printer.FontBold = False
Printer.FontSize = 9
Printer.CurrentX = 6350
Printer.CurrentY = 550
Printer.Print " XXXXXXXXXXXXXXXX"
Printer.CurrentX = 1000
Printer.CurrentY = 1150
Printer.FontSize = 9
Printer.Print " Bill No : " & rs(1)
Printer.CurrentX = 3600
Printer.CurrentY = 1150
Printer.FontSize = 8
Printer.Print " INVOICE "
Printer.CurrentX = 6150
Printer.CurrentY = 1150
Printer.FontSize = 9
Printer.Print " Date : " & rs(4)
Printer.Line (1000, 1400)-(7800, 1400) '-h line
'Printer.Line (20, 10)-(20, 18800) 's1
'Printer.Line (11520, 10)-(11520, 18800) 's2
'Printer.Line (10, 18800)-(11500, 18800) 'bl
Printer.Font = "DCI + Tml + Ismail"
Printer.CurrentX = 100
Printer.CurrentY = 1550
Printer.Print " tpguk; fp tpiy bjhif"
Printer.Line (1000, 1800)-(7800, 1800) '-h line
cy = 2000
cx = 6500
Set rs1 = New ADODB.Recordset
sql = "select * from del_det where transno=" & Trim(txtcustno.Text) & ""
rs1.Open sql, CN, adOpenStatic, adLockPessimistic
Do While Not rs1.EOF
Printer.Font = "DCI + Tml + Ismail"
Printer.CurrentX = 1100
Printer.CurrentY = cy
Printer.Print rs1(3)
Printer.Font = "Arial"
Printer.FontSize = 10
Printer.CurrentX = 3500
Printer.CurrentY = cy
Printer.FontSize = 9
Printer.Print rs1(4)
Printer.CurrentX = 4700 - TextWidth(rs1(5))
Printer.CurrentY = cy
Printer.Print Format(rs1(5), "00.00")
Printer.CurrentX = cx - TextWidth(rs1(6))
Printer.CurrentY = cy
Printer.Print Format(rs1(6), "00.00")
'Format$(123,"@@@@@@")
rs1.MoveNext
cy = cy + 250
Loop
Printer.Line (6000, cy)-(7800, cy) '-h line
Printer.Font = "DCI + Tml + Ismail"
Printer.CurrentX = 4500
Printer.CurrentY = cy + 100
Printer.FontSize = 10
Printer.Print " bkhj;jk; "
Printer.Font = "Arial"
Printer.CurrentX = cx - TextWidth(rs(7))
Printer.CurrentY = cy + 100
Printer.FontSize = 10
Printer.Print Format(rs(7), "00.00")
cy = cy + 300
Printer.Line (6000, cy)-(7800, cy) '-h line
Printer.Font = "DCI + Tml + Ismail"
Printer.CurrentX = 4500
Printer.CurrentY = cy + 300
Printer.FontSize = 10
Printer.Print " bkhj;j ghf;fp "
Printer.Font = "Arial"
Printer.CurrentX = cx - TextWidth(custdue)
Printer.CurrentY = cy + 300
Printer.FontSize = 10
Printer.Print Format(custdue, "00.00")
cy = cy + 600
Printer.Line (6000, cy)-(7800, cy) '-h line
Printer.EndDoc
End If
|
|
|
|
|
imagetvr wrote: I am developing a sample project in Visual basic 6 and MS Access 2003.
Why are you using VB6? It's been dead for quite a long time now.
In the .NET world, there is the PosPrinter class in the Microsoft POS for .NET library that will do what you want. No, you can't use it in your VB6 code.
The code you've written will not work because you're "printing" to a paper size. This size is required by the Printer object and cannot be infinitely long or of an undetermined size before you start printing. You have to "print" directly to the printer itself without using the Printer object. That also means you do not get to specify fonts and sizes like you have. You have to specify these things, if possible at all, by using the control characters and commands specific to the printer. See the printers documentation on how to do this.
|
|
|
|
|
I made a program, that contains two forms, one is the controls form and the other is the screen which the actions appear on it.
I use screen splitting and HDMI cable.
I make the screen 'Duplicate' option
I connect the PC with a TV, I share Form2(screen) to the tv and Form1(controls) on my PC's screen.
HERE IS MY PROBLEM!!!!
all sounds from both screens get out to the tv
but I want to split sounds or decide which sounds go to which screen either TV or PC
I have buttons that produce different types of sounds.
|
|
|
|