|
Sorry for the C++ answer....
Are you using VB.NET or VB6 ? VB.NET has an excellent class library, including classes for text files, which allow you to read line by line ( so you can keep line 4 ). VB6 kind of sucks, I don't know what you'd do there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am using vb.net? what statement can i make??
|
|
|
|
|
Given your comments below, your solution is fragile. What you should do is build a hashtable of names to full address details, so when the user clicks on a name, you look it up in the hashtable. What if someone changes the file while your exe is open ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In VB6 use
fnum = FreeFile
Open strfile for Input As #1
strfile = Input$(LOF(fnum, #1)
search from the net.
|
|
|
|
|
hello, i am using vb.net and i am making an address book. i want to search a specific line from the textfile. Example if i want to see Adrian's details i can go to Adrian from a listbox and click a button on to it. it then appears another form with all the details of Adrian. Adrian is in the 4rth line of the textfile and i want to bring out Adrians details onto the form. How can i make this in vb.net??
|
|
|
|
|
Hi all,
I am using the following line to print a file in my VB .NET app.
Shell("Notepad.exe /p " & lsFile, AppWinStyle.Hide)
This way I don't have to worry about drawing out a PrintDocument and wordwrap is handled for me by Notepad.
I was wondering if there is a way of invoking the Print Dialog for Notepad through a command line argument? Or someway of passing the printer name to the Notepad command line argument /pt filename printer ?
Any suggestions? Thanks
|
|
|
|
|
I think the command lines for Notepad looks like this so:
/P <filename> print filename
/PT <filename> <printername> <driverdll> <port>
somthing like this:
Shell("Notepad.exe /PT " & lsFile & " <printername> <driverdll> <port>", AppWinStyle.Hide)
MSDN: Pathname
Required. String. Name of the program to execute, together with any required arguments and command-line switches. Pathname can also include the drive and the directory path or folder.
Http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctshell.asp
|
|
|
|
|
I'm still looking around for an answer, but do you know if the driverdll and port are required as a command line argument?
Also, is there some way to get that information from the PrintDialog control in VB.NET?
All I could find in the properties is: PrintDialog1.PrinterSettings.PrinterName
But that doesn't pass to the command line properly...or perhaps I am doing something wrong?
|
|
|
|
|
The printer name is exactly how it is shown in the printers and faxes control panel under properties for the printer settings.
example: mine is "EPSON Stylus Photo 785EPX"
Run this from the command line in a dos window and it will give you the rest of the info you need:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xg /n "<put your printer name here>"
|
|
|
|
|
Ok, Anonymous I think I got it now,
to use the /pt switch everthing must be in quotes(") past the switch.
Here's how i got it to work:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lsFile As String = "NotePad.exe /pt " & """c:\results.txt""" & """Okidata ML 320 Turbo/D (IBM)""" & """LPT1:"""
Debug.WriteLine(lsFile)
Shell(lsFile, AppWinStyle.NormalFocus)
End Sub
|
|
|
|
|
Thanks progload! It's working great
|
|
|
|
|
My application works fine on my computer, but when I try to run it on someone else computer I get the following error.
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in system.windows.forms.dll
Additional information: Class not registered
This error occurs at a line within the Windows Form Generated Code. My form contains an Adobe Control for ActiveX 1.3.
CType(Me.PDFViewer, System.ComponentModel.ISupportInitialize).EndInit()
Can someone point out how to fix this COMException? Or point me in the right direction to trouble shoot this error?
|
|
|
|
|
It looks like the COM Component is not registered (Your Adobe ActiveX Control)
You'll need to register it from a command line like: regsvr32 <ControlName>
|
|
|
|
|
Thanks...I just figured it out on my own
|
|
|
|
|
How to make a variable active in 2 forms within the same project?? how can i use a variable called intNumber in two forms? answer me pls!
|
|
|
|
|
You can't put a variable in two classes. You can share it via a third class, or pass it between the two. If you use a third class, you need to pass an instance of that class, or make it static.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Hello, I am doing an address book and i want to read the first word of every line in a textfile. How can i loop in every line throgh vb
Adrian De Battista
|
|
|
|
|
|
Thanks Very Much My Friend!!!
|
|
|
|
|
How can I write code in Visual Basic to send data using SNMP over the network to a network manager
|
|
|
|
|
I haven't seen any pure vb snmp trap code.
Most folks use a commercial snmp activex control.
But, here's some places to start if you realy want to build your own.
Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment (eg. routers), computer equipment and even devices like UPSs. Net-SNMP is a suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.
http://net-snmp.sourceforge.net/
http://sourceforge.net/project/showfiles.php?group_id=12694
SNMP Packet Library
The SNMP Packet Library is a C++ library for encoding and decoding SNMP packets. Extremely easy to use. Create those useful SNMP applications without worrying about the underlying protocol details. Includes classes to support UDP tranmission and a Poller class with asynchronous callbacks
http://www.ncomtech.com/download.htm
http://www.ncomtech.com/software/PktLib/Nt/pl295.zip
http://www.ncomtech.com/software/PktLib/pktlibmanual.pdf
Jul 23, 2002 - Creating an SNMP Component
Ben Garcia sheds some light on the Simple Network Management Protocol (SNMP). First he provides a history of SNMP, then he dives right into its architecture. Finally, he shows how to build a COM component that communicates with SNMP-enabled devices.
http://www.15seconds.com/issue/020723.htm
Sep 4, 2002 - Creating an SNMP Component - Part 2
In part two of this intriguing article series, Ben Garcia shows how to build an updated and improved SNMP component in VC++ AND VB, and he briefly explains why limitations in VB make VC++ a better language for developing this type of application.
http://www.15seconds.com/issue/020904.htm
How to develop a SNMP extension agent DLL
By T.YogaRamanan
http://www.codeproject.com/internet/SNMP_Agent_DLL__Part1_.asp
How to install SNMP extension agent DLL
By T.YogaRamanan
http://www.codeproject.com/internet/SNMP_Agent_DLL__Part2_.asp
and
http://www.wtcs.org/snmp4tpc/links.htm
hope this helps you out.
|
|
|
|
|
Sorry Forgot one...
CSocketMaster & CSocketPlus Web Page
CSocketMaster class is a Winsock control substitute for Visual Basic that attempts to mimic it's behavior and interface to make it easy to implement. With CSocketPlus you can accomplish the same things CSocketMaster does plus you can create sockets at runtime.
http://www.geocities.com/anshoku/
|
|
|
|
|
I hope someone can help me with this strange error.
I created an install with a reference to the Excel 11 Object Library. Then I installed it on a test pc that has Excel 10 (2000) and the Excel 9 Object Library installed.
Now when I try to create a new instance of the object the error 'Error in loading Dll' is returned.
I have tried referencing the Excel 9, 10, and 11 Object Libraries to no avail. However when I do late binding it works fine.
Dim xlApp as Excel.Application<br />
<br />
set xlApp = New Excel.Application ' Error here
Dim xlApp as Object<br />
<br />
set xlApp = CreateObject("Excel.Application") ' Works
Yes, I am using an old VB6 project.
Any Ideas on this will be helpful. I have tried reinstalling Excel also.
Thanks,
Steve
|
|
|
|
|
I did something similar with Word and VB6.
If you want to early bind it, you have to bind to the earliest version possible i.e., Excel 9 Object.
Don't forget to copy and register the Excel 9 Dll to the user's PC (I don't quite remember which file it is).
|
|
|
|