Click here to Skip to main content
15,924,452 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Getting the length of the Double Datatype Pin
Richard_Wolf18-Oct-05 6:36
Richard_Wolf18-Oct-05 6:36 
QuestionQuestion about text box. Pin
Isobar17-Oct-05 23:51
Isobar17-Oct-05 23:51 
QuestionHow to write a win32 console application with vb6.0? Pin
steven_wong17-Oct-05 23:17
steven_wong17-Oct-05 23:17 
AnswerRe: How to write a win32 console application with vb6.0? Pin
Richard_Wolf18-Oct-05 4:56
Richard_Wolf18-Oct-05 4:56 
Questionprint form(without going to Microsoft word) Pin
himanshu_softin17-Oct-05 22:39
himanshu_softin17-Oct-05 22:39 
AnswerRe: print form(without going to Microsoft word) Pin
maxiachun18-Oct-05 14:19
maxiachun18-Oct-05 14:19 
QuestionPreserving rich textbox format Pin
baankhi17-Oct-05 22:37
baankhi17-Oct-05 22:37 
QuestionRAW Print (Try this code;when i do,i got error) Pin
Greeky17-Oct-05 22:28
Greeky17-Oct-05 22:28 
i wanna kill. what a stupid work , working with raw data. At the end i learnt, how to print raw data print via LPT1 Port . But when i send data , Printer gives error. I'm sure my printer is connected from LPT1 port.

Could Anyone try this code,

Imports System.IO <br />
Imports System.Runtime.InteropServices <br />
<br />
Public Class Form1 <br />
Inherits System.Windows.Forms.Form <br />
Public Const GENERIC_WRITE = &H40000000 <br />
Public Const OPEN_EXISTING = 3 <br />
Public Const FILE_SHARE_WRITE = &H2 <br />
<br />
Dim LPTPORT As String <br />
Dim hPort As Integer <br />
<br />
Public Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" ( _ <br />
ByVal lpFileName As String, ByVal dwDesiredAccess As Integer, _ <br />
ByVal dwShareMode As Integer, _ <br />
ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, _ <br />
ByVal dwCreationDisposition As Integer, ByVal dwFlagsAndAttributes As Integer, _ <br />
ByVal hTemplateFile As Integer) As Integer <br />
<br />
Public Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Integer) As Integer <br />
Dim retval As Integer <br />
<br />
Public Structure SECURITY_ATTRIBUTES <br />
Private nLength As Integer <br />
Private lpSecurityDescriptor As Integer <br />
Private bInheritHandle As Integer <br />
End Structure <br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click <br />
Dim Texxxt As String <br />
Dim SA As SECURITY_ATTRIBUTES <br />
Dim outFile As FileStream, hPortP As IntPtr <br />
<br />
LPTPORT = "LPT1" <br />
Texxxt = Me.RichTextBox1.Text <br />
hPort = CreateFile(LPTPORT, GENERIC_WRITE, FILE_SHARE_WRITE, SA, OPEN_EXISTING, 0, 0) <br />
<br />
hPortP = New IntPtr(hPort) 'convert Integer to IntPtr <br />
outFile = New FileStream(hPortP, FileAccess.Write, False) 'Create FileStream using Handle <br />
<br />
Dim fileWriter As New StreamWriter(outFile) <br />
'MessageBox.Show(RichTextBox1.Text )  <br />
' fileWriter.AutoFlush = False <br />
fileWriter.WriteLine(RichTextBox1.Text) <br />
fileWriter.WriteLine("Hello World2") <br />
fileWriter.WriteLine("Hello World1") <br />
fileWriter.WriteLine("Hello World2") <br />
fileWriter.Write(Chr(12)) '12 <br />
fileWriter.Flush() <br />
fileWriter.Close() <br />
outFile.Close() <br />
<br />
retval = CloseHandle(hPort) <br />
End Sub <br />
End Class 

AnswerRe: RAW Print (Try this code;when i do,i got error) Pin
Duncan Edwards Jones17-Oct-05 22:56
professionalDuncan Edwards Jones17-Oct-05 22:56 
GeneralRe: RAW Print (Try this code;when i do,i got error) Pin
Greeky17-Oct-05 23:48
Greeky17-Oct-05 23:48 
GeneralRe: RAW Print (Try this code;when i do,i got error) Pin
Duncan Edwards Jones18-Oct-05 1:26
professionalDuncan Edwards Jones18-Oct-05 1:26 
GeneralRe: RAW Print (Try this code;when i do,i got error) Pin
Greeky18-Oct-05 2:57
Greeky18-Oct-05 2:57 
GeneralRe: RAW Print (Try this code;when i do,i got error) Pin
Dave Kreskowiak18-Oct-05 7:12
mveDave Kreskowiak18-Oct-05 7:12 
GeneralRe: RAW Print (Try this code;when i do,i got error) Pin
Greeky19-Oct-05 0:51
Greeky19-Oct-05 0:51 
QuestionException in datagrid when bound to related view Pin
thebread17-Oct-05 20:36
thebread17-Oct-05 20:36 
QuestionIntellisense (I think) malfunction? Pin
Brett Peirce17-Oct-05 19:49
Brett Peirce17-Oct-05 19:49 
AnswerRe: Intellisense (I think) malfunction? Pin
medicenpringles18-Oct-05 5:24
medicenpringles18-Oct-05 5:24 
GeneralRe: Intellisense (I think) malfunction? Pin
Brett Peirce19-Oct-05 17:53
Brett Peirce19-Oct-05 17:53 
Questionabt vbscript Pin
tirucapricorn17-Oct-05 19:40
tirucapricorn17-Oct-05 19:40 
QuestionHelp! Pin
maxiachun17-Oct-05 19:13
maxiachun17-Oct-05 19:13 
AnswerRe: Help! Pin
Briga17-Oct-05 22:54
Briga17-Oct-05 22:54 
QuestionLinking an Access Database to a DataGrid. Pin
Jeri17-Oct-05 16:28
Jeri17-Oct-05 16:28 
AnswerRe: Linking an Access Database to a DataGrid. Pin
maxiachun17-Oct-05 19:15
maxiachun17-Oct-05 19:15 
Questionvb .net and ms word 2003 find and replace Pin
ALGPROG17-Oct-05 16:16
ALGPROG17-Oct-05 16:16 
QuestionVS03 and VS05 registry editing Pin
medicenpringles17-Oct-05 15:04
medicenpringles17-Oct-05 15:04 

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.