|
Hi! I'm not sure about that. But I'm using it in VB6
Thanks
Don't Quit
|
|
|
|
|
Hi all I just have a question about the report progress on my background worker. Can anyone tell me what I am doing wrong with this code.
The problem I am having is the result window textbox2.text from my Sub BackgroundWorker3_ProgressChanged only shows some of the stream the last part of the stream is not displayed so I am guessing I am missing something to display the rest of the stream?
<code>
'Start NSLOOKUP
Private Sub NSLookupToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NSLookupToolStripMenuItem.Click
With Me.BackgroundWorker3
ToolStripStatusLabel1.Visible = True
ToolStripProgressBar1.Visible = True
ToolStripProgressBar1.Style = ProgressBarStyle.Marquee
Me.Cursor = Cursors.WaitCursor
.WorkerReportsProgress = True
.RunWorkerAsync()
End With
End Sub
'Start Do Work process
Private Sub BackgroundWorker3_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker3.DoWork
Dim lookup As Process
lookup = New Process
With lookup
.StartInfo.FileName = "nslookup"
.StartInfo.Arguments = TextBox1.Text
.StartInfo.UseShellExecute = False
.StartInfo.CreateNoWindow = True
.StartInfo.RedirectStandardOutput = True
lookup.Start()
Dim outputReader As StreamReader = .StandardOutput
outputReader.ReadToEnd()
Do While Not outputReader.EndOfStream
Loop
BackgroundWorker3.ReportProgress(1, outputReader.ReadLine)
End With
End Sub
'Start Progess of Process/Stream Output
Private Sub BackgroundWorker3_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker3.ProgressChanged
TextBox2.Text = e.UserState.ToString
End Sub
'End BGW
Private Sub BackgroundWorker3_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker3.RunWorkerCompleted
Me.Cursor = Cursors.Default
ToolStripStatusLabel1.Visible = False
ToolStripProgressBar1.Visible = False
MsgBox("NSLookup Complete")
End Sub
|
|
|
|
|
krazyazkid wrote: outputReader.ReadToEnd()
Do While Not outputReader.EndOfStream
Loop
BackgroundWorker3.ReportProgress(1, outputReader.ReadLine)
This is nonsense. ReadToEnd() reads everything, and returns it as a string, which you ignore.
Then you loop for the end, which you already reached. Then you read a line, which isn't there.
I suggest:
1. you read the documentation on StreamReader class
2. clean up your code
3. when problems exist, publish your code using the "code block" button (i.e. PRE tags) so it is formatted and readable.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks for the tips this is my first project using vb 2008 express I apologize in advance for not understanding the whole process yet, I will do some more reading on the stream reader.
|
|
|
|
|
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
any one here has any idea of how we can implement paging scheme in windows application for data grids?
Or any one can tell,how can we show limited number of rows in datagrids
is urgent thanks!
|
|
|
|
|
parkash_C wrote: is urgent thanks
If it really is urgent, why didn't you google for an answer? There are several hits sitting there waiting for you?
If something is really urgent, I wouldn't post here where I would be waiting for someone to find the time/interest to give me an answer.
I would only post here after I'd searched the interweb and found nothing, and I'd say that in the post so that people would know I was serious.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
How can you say a person is not looking at other places....
i didn't ask you for the answer..
|
|
|
|
|
Good Day parkash_C
Easy dont Fight. In this Forum you are not allowed to use words like Urgent. Because the people here they are not getting paid to help you you have to be patient and wait for them to answer you , and there more politely you ask the faster they asnwer you. It is encouraged that people should first make their own research before the post a question.
I went to google and i found plenty of examples like this
http://support.microsoft.com/kb/305271[^]
http://support.microsoft.com/kb/320626[^]
DataGrid Paging - C# Windows Forms[^]
Thank you
Vuyiswa Maseko
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
thanks for the help,
i ll keep your instructions in mind.
i tried finding it , i learned about web application
but couldn't find for windows....
|
|
|
|
|
But you did ask. You asked every CP member.
If you had said that you had googled and found nothing, that would be a different story, but as others have pointed out there are loads of suitable answers on the web.
If you had tried to use one of those solutions and got stuck whilst doing so, you would have almost certainly got lots of help.
On the other hand, if it appears that someone is not capable of doing basic research first, they should not expect help.
I really do hope that you find one of the links suggested by others useful, and solve your problem.
But google is your best friend in situations like this.
Good luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
i am a starter dear ,it takes me time to understand
i never search code, i look for proper function
they enhance your logic
i was looking for a datagrid property or function,like in web forms
which i dont thing exist, if there is do tell me
|
|
|
|
|
AFAIK there is no property or function in the datagrid control to allow paging (by the way is it a DataGrid or a DataGridView ? It makes no difference in this case, but it probably will if you have othter problems).
There are lots of different ways to do it, so have a look at the links given by others to see if there is something that can help you, or at least give you some ideas to implement your own solution.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
when press button in flash talk to vb to show certain form
|
|
|
|
|
AFAIK, Flash has no methods of communication to notify its host of anything happening.
In other words, there's no way for your code to know a button has been clicked in a Flash window.
|
|
|
|
|
This is not a question. Try posting something that is, and that includes what you did to try to solve your issue.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Flash has support programming.so You Can use Script on Flash for Running Application.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
please help i need a visual basic 6 conversion or equivalence of the below code
i tried several codes but i am getting different results
urgently in need of help
/*************************************************************************
Function: 16 bit CRC-CCITT calculation
--------------------------------------------------------------------------
Call: calc_crc(unsigned short crc_buff, unsigned char input)
--------------------------------------------------------------------------
Response: Newly calculated 16 bit CRC checksum
--------------------------------------------------------------------------
Description: Calculates the checksum for 'input' in accordance with the CRC polynomial x^16 + x^12 + x^5 + 1. 'crc_buff' is the previously calculated checksum. This must be set to 0xFFFF at the beginning of a test sequence.
*************************************************************************/
unsigned short calc_crc(unsigned short crc_buff, unsigned char input)
{
unsigned char i;
unsigned short x16; // we’ll use this to hold the XOR mask
for (i=0; i<8; i++)
{
// XOR current D0 and next input bit to determine x16 value
if( (crc_buff & 0x0001) ^ (input & 0x01) )
x16 = 0x8408;
else
x16 = 0x0000;
// shift crc buffer
crc_buff = crc_buff >> 1;
// XOR in the x16 value
crc_buff ^= x16;
// shift input for next iteration
input = input >> 1;
}
return(crc_buff);
}
File: UMB-Protokoll 1_0 Version 1_5_e.doc,
Version 1.5,
Status 14.12.2007
37
// ******************* MAIN ************************************
void main(void)
{
// example: CRC for 8 Bytes
unsigned char values[8] =
{0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37};
// initialise startvalue FFFFh
unsigned short crc = 0xFFFF;
// calculation
for(int n = 0; n < 8; n++)
{
crc = calc_crc(crc, values[n]);
}
// output
printf("\ndata: 30h, 31h, 32h, 33h, 34h, 35h, 36h, 37h");
printf("\nCRC: %04Xh\n", crc);
}
|
|
|
|
|
Can you post your attempts at converting this and explain what is going wrong? It is unlikely that someone will just do it for you, unless you pay them of course!
|
|
|
|
|
the following is VBA (VB6 is dead on my system)
Private Sub CommandButton1_Click()
Dim crc As Long
Dim n As Integer
Dim values(8) As Byte
crc = &HFFFF&
For n = 0 To 7
values(n) = &H30 + n
Next n
For n = 0 To 7
crc = calc_crc(crc, values(n))
Next n
MsgBox ("Crc " & crc)
End Sub
Private Function calc_crc(ByVal crc_buff As Long, ByVal inp As Byte) As Long
Dim i As Byte
Dim x16 As Long
For i = 0 To 7
If ((crc_buff And 1) Xor (inp And 1)) = 1 Then
x16 = &H8408&
Else
x16 = 0
End If
crc_buff = crc_buff \ 2
crc_buff = crc_buff Xor x16
inp = inp \ 2
Next i
calc_crc = crc_buff
End Function
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
please be blessed i have seen some light with your code. i will come back to you in due course let me try to implement it it looks it will do the magic
|
|
|
|
|
That code might not work correctly. Doesn't VB6 implicitly pass all parameters by reference?
|
|
|
|
|
Computafreak wrote: Doesn't VB6 implicitly pass all parameters by reference?
Unless you specify, as I did, ByVal .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Doesn't the calc_crc method try to alter the parameters in the for-loop?
|
|
|
|
|
Nope, none of the two versions, of course.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|