|
For each line that you read in use split(',') on the string. The returned value will be an array of strings, each representing one field.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
|
I have broken appart the file by using the split function but now have an issue with the carriage returns. The values from the last field of the line is put with the first field of the next line?
|
|
|
|
|
ccandler wrote:
I have broken appart the file by using the split function but now have an issue with the carriage returns. The values from the last field of the line is put with the first field of the next line?
Now I'm confused.
You mean that each line of the file doesn't represent a full record, and that a record can overlap lines of the file?
Maybe you could provide some sample data and information about the file format? A straight CSV would be readable the way suggested.
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
I use IcmpSendEcho func (from Lib "icmp.dll") to check 2^16 IP addresses for pinging, it takes too much time. Has anybody other decision? The program has to be written in VB. I tried to decrease PING_TIMEOUT parameter of this function(from 500 ms to 100 ms), but it doesn't decrease the programm runtime.
Thanks in advance
|
|
|
|
|
If your pinging all 65K address one at a time on a single thread, then yes, it'll take a long time to get through them. A faster method would be to write a multithreaded solution and launch, say, 100 pingers at a time.
If your using VB6, free threading is NOT a trivial task.
If your using VB.NET, free threading is MUCH MUCH (Hint! ) easier!
RageInTheMachine9532
|
|
|
|
|
can u send me the code
Thanks
|
|
|
|
|
Hello and hi
i want that on clicking a browse button
on a certain form , a word file is selected (usiing common dialog box)and then contents of word file will be displaced on
any of the object like (ole db etc.)
and using a save button i can store contents of that word file in to another file anywhere on the disk
tell me which object is more comfortable to use to show the contents of a Word Document and how ?
example required
ali baba
|
|
|
|
|
I declare a brush... Dim lBrush as SolidBrush
Then I use it lots of times in a function for different things like gradient fills. So I might do...
lBrush = new GradientBrush...
Then again...
lBrush = new GradientBrush...
You get the idea. Should I call lBrush.Dispose before I say lBrush=New brush....
If I don't, do I get a memory leak?
Sounds like a waste of time, unless you have an object that is going to be in scope for a long time using transient resources that should be released quickly.
Thanks 4 ur help guys.
Nursey
|
|
|
|
|
The general rule is yes, of course.
Objects that expose the IDisposable interface do so because they contain resources that a limited in some way. The destructor/finaliser of these objects will call Dispose anyway, but is it better to call Dispose when you know you don't need the object any more. Why? Because you don't know when the garbage collector will clean up after you, which could mean that you run out of the resource and are then left wondering why your program failed.
So... If its got an IDisposable interface then use it.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
I was pretty disappointed when I first looked over the RichTextbox component and seen that they didn't include UTF-8 as one of the Format Options (since it is available in V 3 of the control). What I'd like to do is extend the loadfile/save file function by creating a class or module that contructs the RichEdit's EditCallback function so that I can then use SendMessage to Streamin and Streamout the data. I've done this before in VB6 -- but I can't seem to get the code to work in vb.net because I don't understand how to generate the EDITSTREAM structure. I'd like to pass a filestream handle into the Callback, but I can't figure out how to create the EDITSTREAM structure so that dwCookie will allow the handler and then how to use that handler in the Callback. I'm wonder if anyone here has done something like this (or maybe has C# or C++ code that they wouldn't mind sharing -- or better yet, coverting) or maybe knows of another way that I could load UTF8 data into a RichTextbox.
Thanks
|
|
|
|
|
Does anyone have an example of how they implemented the singleton design pattern in Visual Basic 6.0.
|
|
|
|
|
For anyone who cares...I found an old article from Visual Basic Programmers Journal that will help with the Singleton issue.
VBPJ article[^]
Good luck.
|
|
|
|
|
Does VB 6.0 static the same as C++ static?
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I need to find out the printable area on a page, vb.net either give me the paper size or the size after margin, which is set by the user.
I used the API to find that in VB6, does vb.net expose that property or do we have to go back to API?
Thanks,
Tao
|
|
|
|
|
If it does, it's very well hidden! Best bet looks like API again.
RageInTheMachine9532
|
|
|
|
|
I'm trying to set a property in the following class:
<system.runtime.interopservices.guidattribute("3050f558-98b5-11cf-bb82-00aa00bdce0b"), system.runtime.interopservices.coclassattribute(mshtml.ceventobjclass)="">
Public Class CEventObj
Member of mshtml
The property is:
<system.runtime.interopservices.dispidattribute(1007)>
Public Property returnValue As Object
Member of mshtml.CEventObj
When I try:
Dim objevent As New mshtml.CEventObjClass() OR
Dim objevent As New mshtml.CEventObj() OR
Dim objevent As New CEventObjClass() OR
Dim objevent As New CEventObj()
I get the following error, also the CSLID from the Object Browser of 3050F558-98B5-11CF-BB82-00AA00BDCE0B is different from the COMException error message
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Test Form .exe Additional information: COM object with CLSID {3050F48A-98B5-11CF-BB82-00AA00BDCE0B} is either not valid or not registered.
The Registry states the CSLID 3050F48A-98B5-11CF-BB82-00AA00BDCE0B from COMError message is the following:
HKEY_CLASSES_ROOT\CLSID\{3050F48A-98B5-11CF-BB82-00AA00BDCE0B}...
default(not set)
HKEY_CLASSES_ROOT\CLSID\{3050F48A-98B5-11CF-BB82-00AA00BDCE0B}\InprocServer32...
Assembly(Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
Class(mshtml.CEventObjClass)
Runtime version(v1.0.3705)
The Registry states the CSLID 3050F558-98B5-11CF-BB82-00AA00BDCE0B from the Object Browser view is the following:
HKEY_CLASSES_ROOT\Interface\{3050F558-98B5-11CF-BB82-00AA00BDCE0B}
default(DispCEventObj)
HKEY_CLASSES_ROOT\Interface\{3050F558-98B5-11CF-BB82-00AA00BDCE0B}\ProxyStubClsid...
default(00020420-0000-0000-C000-000000000046)
HKEY_CLASSES_ROOT\Interface\{3050F558-98B5-11CF-BB82-00AA00BDCE0B}\ProxyStubClsid32...
default(00020420-0000-0000-C000-000000000046)
HKEY_CLASSES_ROOT\Interface\{3050F558-98B5-11CF-BB82-00AA00BDCE0B}
TypeLib(3050F1C5-98B5-11CF-BB82-00AA00BDCE0B)
Just to be sure I ran regsvr32 mshtml.dll sucessfully
What is going on? the CSLId from the COMException InprocServer32 points to Class(mshtml.CEventObjClass). H E L P!
Thanks, GregC
|
|
|
|
|
I have a number which is in microseconds and need to convert it into a time and date.
CHighTime class (written in C++) was used to make this number by another vendor and now I am trying to convert it back using VB.net any help would be appreciated.
The number is a 64 bit value (in microseconds), and is the number of 1 microsecond intervals since January 1, 1601.
Another way of asking this question is how do you use the chightime class within a VB.net project?
|
|
|
|
|
You can't use the code directly. You'd have to either rewrite it in VB.NET or compile it directly into a .DLL and use it that way.
The other option is to look for other high resolution timer controls such as the CCRP High Performance Timer Object, which can be found here[^].
RageInTheMachine9532
|
|
|
|
|
Hello,
I'm trying to set up a report so that it will have several different columns for the same set of fields (like creating columns in word) that my data will be displayed in. For example... I have about 100 records to display on each page of the data report... The way it is right now, if I want to print out a report of those records it prints off several pages with just one column of the set of fields. I want to set up multiple columns for the same fields so that they will all fit on one page.
Instead of having
Field1 Field2 Field3 on a page, I will have
Field1 Field2 Field3 : Field1 Field2 Field3 : Field1 Field2 Field3 on a page
I hope that made sense. Thanks so much for your anticipated help.
TimDasa
|
|
|
|
|
How are you generating the report? Using Crystal Reports? Or are you using code you wrote to send data to the printer?
How are you tracking your data? Using a RecordSet object? Or using an Array?
Need just couple more details here!
RageInTheMachine9532
|
|
|
|
|
Thanx for your response.
I have the data in a microsoft access database. I designed the report using vb 6 data report which gets it data from a data environment. I then used an SQL statement to filter the records.
If you have a better way of extracting the data from the tables pls let me have it.
Thanx.
|
|
|
|
|
OK. In that case, you should be using a RecordSet object to track the data in your app.
Next, you didn't mention how you were generating your report, so I'll assume your writing the code for it yourself.
Now, you'd have to print the data out, something like this (assuming 50 rows per column):
Rec(0).Field1 Rec(0).Field2 Rec(0).Field3 : Rec(50).Field1 Rec(50).Field2 Rec(50).Field3
Rec(1).Field1 Rec(1).Field2 Rec(1).Field3 : Rec(51).Field1 Rec(51).Field2 Rec(51).Field3
A simplified view of the code might look something like this (not actual code):
Dim Index as Integer
Dim rsData as RecordSet (Your data is in here)
Dim strOutput as String
'Output your headers here
'
For Index = 0 to rsData.Count - 1
strOutput = rsData(Index).Fields(1).ToString & " " & _
rsData(Index).Fields(2).ToString & " " & _
rsData(Index).Fields(3).ToString
Try
strOutput = strOutput & " : " & _
rsData(Index + 50).Fields(1).ToString & " " & _
rsData(Index + 50).Fields(2).ToString & " " & _
rsData(Index + 50).Fields(3).ToString
Catch
End Try
Print strOuput
Next
Again, this is a greatly simplified example and will NOT compile! But it should be enough to give you an idea of what is going on.
RageInTheMachine9532
|
|
|
|
|
please tell me difference in detail between com component and .net component
tbhattacharjee
|
|
|
|
|
say suppose there is lots of parent and child nodes in treeview and checkbox is attached with all the nodes and i want to show the name of node which checked.please help me with sample code.
tbhattacharjee
|
|
|
|