|
BackgroundWorker is the best thread class, I've found. It can send progress information back to your main thread, and calls back into the main thread when it's done. If your program should stop taking input during the process, have a progress dialog go modal, and call the thread, and not offer any way to close until the thread is done. You can also cancel a thread using the BackgroundWorker.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thankx a lot...
it helps me much ...
regards,
koolprasad2003
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
Hi VB freaks!!
I am creating a report in word using tables in VB6.
One of the cells contains a surname and then two forenames for married
partners. I need to have the surname in bold and the forenames as
normal.
When I do this I can make the whole cell bold or normal. help!
Regards
ips
|
|
|
|
|
Hi,
I have a problem with an error.
I try to use thread in my program:
Dim t As New Thread(AddressOf conv_str)<br />
t.SetApartmentState(ApartmentState.MTA)<br />
where conv_str is the function where I need a thread
and the error is:
"Overload resolution failed because no accessible 'New' can be called with these arguments:
'Public Sub New(start As System.Threading.ParameterizedThreadStart)': Method 'Private Function conv_str(str As String, provider As String) As String' does not have the same signature as delegate 'Delegate Sub ParameterizedThreadStart(obj As Object)'.
'Public Sub New(start As System.Threading.ThreadStart)': Method 'Private Function conv_str(str As String, provider As String) As String' does not have the same signature as delegate 'Delegate Sub ThreadStart()'
If you have an ideea please help.
thanks
|
|
|
|
|
Well, the error is exactly what it says. The only threads you can start are ones with no parameters, or take an object. So, create a struct to hold the values you want to pass, and pass them through that, so conv_str takes an object, not two strings.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i think u need to change the function signature(from function to sub)
|
|
|
|
|
Hi,
How can we display the image which is in packedDIB format, in a picture box in VB6.
note: packedDIB contains a single pointer which points to a memory block containing a BITMAPINFO structure which is followed by the image data.
Basically I will get the image in packedDIB format(its a 6 or 8 digit number iam getting. i think, this is the memory address.). I need to dispay the image in picture box using this packedDIB.
Please anybody give me the solution. Its very urgent for me.
Thanks in Advance,
AR Reddy
|
|
|
|
|
|
Is there anybody could tell me how to read/write data from/to USB Serial by Visual Basic
|
|
|
|
|
You don't read/write data to the port, you do it to the device attached to the port. How you do this depends on the device itself and what methods it exposes.
Since you mentioned Serial, I assume the device exposes itself as being attached to a COM port, in which case, you'd be looking for examples on Serial Communication.
|
|
|
|
|
Oh,I see!
I guessed I can not read/write data to the port,too!
But my friend need to do it,and she tell me nothing about the device.
Thanks a lot!
Let me try another way to do it,
or if somebody has another good idea,tell me,please!
|
|
|
|
|
Billypon wrote: But my friend need to do it,
Like I said, you don't talk to the USB interface directly. You MUST have some API to talk to the device itself. Without knowing anything about the device, there's nothing you can do that will work.
|
|
|
|
|
This is not like a serial or parallel port where you can talk to any device plugged into it just by talking to the port.
USB is a BUS, not a port. You have to address devices to talk to them. This is something that is left up to the driver of the device. Like I've said before, you need to know about the device and the API exposed by either the driver or some SDK for the device.
|
|
|
|
|
|
"MSComm" control is not use for USB Port
|
|
|
|
|
Hi all,
I'm trying to create a database application that is getting data from access database.
I want to show a list of data in combobox. What i need to do is to have the ability to add and delete from my form. What is the best way to do it? I want the combobox to update every time I added or deleted an item.
Thanks in advance
|
|
|
|
|
hi,
use following code
private sub fillCombo()
sql = "select name from table"
mydataadaptor = New OleDb.OleDbDataAdapter(sql, con)'where con is connection object
mydataset = New DataSet
mydataadaptor.Fill(mydataset)
combo1.datasource=mydataset.table(0)
combo1..DisplayMember = "name"
end sub
one more thing after each insertion or deletion use following statement
combo1.datasource=nothing
call fillCombo
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
it depends how complex you want to go but what if someone else has already edited a name in the table - how do you stop it overwriting the previous change?
Martin
|
|
|
|
|
You don't. Last write always wins.
There are, of course, exceptions to this. But they involve writing a fairly complex data layer that implements "checking out" records for a single client, kind of like checking out books from a library. The client that checks out the records get to modify them. Anyone else gets a readonly copy of the records. This scheme has to be implemented in your data layer. It cannot be implemented soley by the database.
|
|
|
|
|
and therein lies the problem with using all of Net's lovely dataset toys without programming.
I think:
you cant just overwrite business data - you need some kind of -
"This data has changed since you last read it" structure to your data handling.
In the past I have coded this and its a pain - I was hoping that net had come up with an almost drag n drop solution to this issue
thanks (with sincerity to you dave and with sarcasim to microsoft - sigh)
Martin
|
|
|
|
|
It still did not refresh the combobox right.
I thought if we do deletion to the data in the database and call the fillCombo, it will refresh get the new set of data from the database.
All I need to do is just clear the combobox and recall the fillcombo rite?
It didn't work.
|
|
|
|
|
hi,
i dont know what is the mistake. i already check the code . there r no problem.
Please send your code and please write down steps which you follow.
i think there r some minor error in understanding.
Hope u resolve the problem.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
I follow your code exactly.
The strange thing is, if I run it step by step, it will work. The Combobox will refresh correctly. However, when I run it the usual way (F5). It won't refreh correctly. Is there anything to do with the setting of the combobox? I'm using vs.net 2005.
This thing work when I used 2003. But now with 2005, it doesn't work. Is there anything I'm missing?
Thank you
|
|
|
|
|
respected Gurus
i m making a windows application in vb.net.
here i m trying to bind a combobox from dataset.
but whenever i m trying to set the datasource property of my combobox,it jumps to the selectedindexchanged event for the combo box.
my code is as follows:-----------------
code to populate the combobox:---------------
Public Sub populateWebtype()
Try
cnSQL = New SqlConnection(ConnectionString)
Dim strSQL As String = "select webcode,webdesc from webmast"
cnSQL.Open()
cmSQL = New SqlCommand(strSQL, cnSQL)
cmSQL.CommandType = CommandType.Text
adpSQL = New SqlDataAdapter(cmSQL)
ds = New DataSet
adpSQL.Fill(ds)
Dim dr As DataRow
dr = ds.Tables(0).NewRow
'dr(valuemember) = ""
dr("webdesc") = "--Select--"
ds.Tables(0).Rows.InsertAt(dr, 0)
Me.cmbWebType.DataSource = ds.Tables(0).DefaultView 'AFTER THIS LINEJUMPS TO THE SELECTEDINDEXCHANGED
Me.cmbWebType.DisplayMember = "webdesc"
Me.cmbWebType.ValueMember = "webcode"
Me.cmbWebType.SelectedIndex = 0
cnSQL.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
selectedindexchangedevent of combobox:-----------
Private Sub cmbWebType_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbWebType.SelectedIndexChanged
Try
Dim webcode As Integer
webcode = cmbWebType.SelectedValue
strSQL = "select rmdesc as RawMaterial,Micron,Density,Gsm,Quantity as Norm from webnorm,webmast,rmmast where delete_flag <> 'Y' and webnorm.webcode = webmast.webcode and webnorm.rmcode = rmmast.rmcode And webnorm.webcode = " & webcode
cnSQL = New SqlConnection(ConnectionString)
cnSQL.Open()
cmSQL = New SqlCommand(strSQL, cnSQL)
cmSQL.CommandType = CommandType.Text
adpSQL = New SqlDataAdapter(cmSQL)
ds = New DataSet
adpSQL.Fill(ds)
DataGrid1.DataSource = ds.Tables(0).DefaultView
strSQL = "select distinct total_micron,total_gsm,total_quantity,sqmperkg from webnorm where delete_flag <> 'Y'And webnorm.webcode = " & webcode
cmSQL = New SqlCommand(strSQL, cnSQL)
Dim readSQL As SqlDataReader
readSQL = cmSQL.ExecuteReader
While readSQL.Read
If Not IsDBNull(readSQL("total_micron")) Then
txtTotalMicron.Text = readSQL("total_micron")
End If
If Not IsDBNull(readSQL("total_gsm")) Then
txtTotalGsm.Text = readSQL("total_gsm")
End If
If Not IsDBNull(readSQL("total_quantity")) Then
txtTotalQuantity.Text = readSQL("total_quantity")
End If
If Not IsDBNull(readSQL("sqmperkg")) Then
txtSqmPerKg.Text = readSQL("sqmperkg")
End If
End While
cnSQL.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
|
|
|
|
|
Setting the datasource DOES cause an index to become selected. If you don't want that, set a flag and check it in the event.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|