|
Hi Ian, thanks for your assistance. I resolved it!!!! See my reply to Luc
|
|
|
|
|
TheComputerMan wrote: This code is stupid: whatever goes wrong you choose to just ignore it; and then wonder what is going wrong and post a question here?
1. A completely erroneous assumption
No, it's not erroneous. You said you know what THE (assuming one) exception is, but you chose to capture ALL exceptions and eat them. Catch the ONE exception you know is going to come and handle it appropriately, log all the rest so you can see any other errors that show up.
TheComputerMan wrote: 3. Is it useless??? Are you sure about that. I have experience of it kicking off the garbage collector in another app which was not kicking off after a dispose was performed
The garbage collector doesn't wait for you app to pause. It'll pause your app for you and run when it needs to. Just throwing a sleep in doesn't kick off nor does it allow to run the GC. The GC runs when it wants to, regardless of what your app says. If you're doing this to "get the GC to run", you've got another problem in your code that this code just happens to work around. I really wouldn't call it a production quality fix.
|
|
|
|
|
Hi,
Is there any way to trap all the events, function/procedure calls fired and log it without modifying code for each function/event.
Regards,
Praveen
|
|
|
|
|
Nope. What are you trying to accomplish with this?
|
|
|
|
|
In my client places, a record is missing occassionally and we could not reproduce it in our systems. I would like to track the events/function calls in the client's place with event log.
|
|
|
|
|
Then you're going to have to instrument the code to log what you want. There's no real way to do it without changing the code.
|
|
|
|
|
I want something that is similar to vb code profiler which takes exe instead of .vbp and log the events.
|
|
|
|
|
Seeing as VB6 is a dead language, support for it is getting more and more sparse. Try looking through this[^] list for some options.
Good luck with that!
|
|
|
|
|
Hi,
I'm having problems adding multiple rows to a DataGridView, on the Load-event of a Windows Application Form.
Adding one record doesn't cause a problem, but when adding the second record (using the identical code), an Exception is thrown.
Here's my code so far (VB.NET 2008):
Private Sub BWMFPForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dgvRow As New DataGridViewRow
Dim dgvCell As DataGridViewCell
Dim dgvButton As DataGridViewImageColumn
Dim column As DataGridViewColumn
'Disable sorting for all Columns
For Each column In DataGridViewBrochures.Columns
column.SortMode = DataGridViewColumnSortMode.NotSortable
Next
'Add Record
'Column 1: Machine
dgvCell = New DataGridViewTextBoxCell()
dgvCell.Value = "Aficio MP 4000 / Aficio MP 5000"
dgvRow.Cells.Add(dgvCell)
'Column 2: Speed
dgvCell = New DataGridViewTextBoxCell()
dgvCell.Value = "40 PPM / 50 PPM"
dgvRow.Cells.Add(dgvCell)
'Column 3: Language
dgvCell = New DataGridViewTextBoxCell()
dgvCell.Value = "Nederlands"
dgvRow.Cells.Add(dgvCell)
'Column 4: Image Print
dgvButton = New DataGridViewImageColumn
dgvButton.Image = Drawing.Image.FromFile("D:\DEVPROJECTS\MarketingTouchScreen\TouchScreen\images\Print_Icon.jpg")
dgvButton.ReadOnly = True
dgvButton.ImageLayout = DataGridViewImageCellLayout.Normal
DataGridViewBrochures.Columns.Add(dgvButton)
'Add the Row
DataGridViewBrochures.Rows.Add(dgvRow)
'Add Record
'Column 1: Machine
dgvCell = New DataGridViewTextBoxCell()
dgvCell.Value = "Aficio MP 4000 / Aficio MP 5000"
dgvRow.Cells.Add(dgvCell)
'Column 2: Speed
dgvCell = New DataGridViewTextBoxCell()
dgvCell.Value = "40 PPM / 50 PPM"
dgvRow.Cells.Add(dgvCell)
'Column 3: Language
dgvCell = New DataGridViewTextBoxCell()
dgvCell.Value = "Nederlands"
dgvRow.Cells.Add(dgvCell)
'Column 4: Image Print
dgvButton = New DataGridViewImageColumn
dgvButton.Image = Drawing.Image.FromFile("D:\DEVPROJECTS\MarketingTouchScreen\TouchScreen\images\Print_Icon.jpg")
dgvButton.ReadOnly = True
dgvButton.ImageLayout = DataGridViewImageCellLayout.Normal
DataGridViewBrochures.Columns.Add(dgvButton)
'Add the Row
DataGridViewBrochures.Rows.Add(dgvRow)
End Sub
Anyone can help me here?
Kindly Yours
|
|
|
|
|
When adding your second record you are still using the same DataGridViewRow as for the first record. You will need to use the new keyword on dgvRow before adding cells to it.
Also, in future it is helpful if you include any error messages in your post
|
|
|
|
|
Hi Liqz,
Thanks!
That did the trick.
I'll keep in mind that next time, I'll include the error message.
Cheers.
|
|
|
|
|
You're welcome
|
|
|
|
|
For future reference, adding the text of the exception is always helpful. However from you're code I'm guessing it's something like "...row already exists in grid." ...or something like that. You're adding the same row object to the grid twice. You need a new row object the second time around. Otherwise all you are doing is updating the data in the first row you added.
Hope this helps.
|
|
|
|
|
Hi Experts,
I am trying to create an application that can Execute an C Program in VB.Net.
Can anybody please help me.
Regards,
Sheetal
|
|
|
|
|
paya1pa wrote: I am trying to create an application that can Execute an C Program in VB.Net.
If that means that you are trying to execute a compiled C Program, then look at the documentation for the Process class.
If not, then you need to explain your question more clearly.
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.”
|
|
|
|
|
hi expert i revieced your message
firstly thanks to your reply and i can try explain my question.
i want to make one project and project is c prgramme ran in vb.net 2005
ex. suppose i write one addtion programme of two number so vb,net complile this programe and show error in textbox or messagebox.just like a c language software. but everythisk is run in vb.net 2005
please give me a reply
|
|
|
|
|
paya1pa wrote: i want to make one project and project is c prgramme ran in vb.net 2005
Rather obviously, VB.Net cannot compile 'C' code.
paya1pa wrote: ex. suppose i write one addtion programme of two number so vb,net complile this programe and show error in textbox or messagebox.just like a c language software. but everythisk is run in vb.net 2005
If you want to write a simple program to add two numbers, then I would suggest that you either buy a beginners book and work through the examples, or search with Google or Bing for vb.net beginners ebook and you might find a suitable free tutorial.
Other than that I am unable to help.
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.”
|
|
|
|
|
So do you want to write your own C compiler or use a third party command line compiler, or what?
|
|
|
|
|
thanks experts i think can't explain my querry
i want complie c proramme in vb.net 2005 whatever.
output display in textbox
|
|
|
|
|
If you can't communicate your apps specifications, you're not going to get any meaningful answers.
What you have posted has a lot of different answers, and each of those opens up more and more questions.
Sorry, but it is VERY true that the quality of the answer you get is directly dictated by the quality of the question.
|
|
|
|
|
Hello to everyone,
I want to implement voice recognition feature in my application. I need to recognize couple of words and then open the recognized application(i.e. word, excel, etc.). I really new to it, so help me out.
Thank you in advance.
|
|
|
|
|
You might want to look into the System.Speech.Recognition namespace, particularly the class SpeechRecognitionEngine. Don't forget to call LoadGrammar with a new instance of System.Speech.Recognition.DictationGrammar.DictationGrammar
|
|
|
|
|
Hi,
I have a function that populates a list with items of type 'RemoteCustomFieldValue'. Now I would like to extend this function in a way that the list would accept items of different type 'RemoteFieldValue'.
I thought this would work like in the snippet but I get the following error in the if-statement:
'The expression of type "System.Collections.Generic.List(Of T)" can never be of type "System.Collections.Generic.List(Of legion.SST.Jira.RemoteCustomFieldValue)".'
And another one when adding the item to the list
'The value of type "legion.SST.Jira.RemoteFieldValue" can not be converted to "T"'
How can I solve this problem? Perhaps is there another way to do it.
Many thanks in advance
Private Sub GetUserInputValues(Of T)(ByRef alRemoteCustomFieldValue As List(Of T))
....
If TypeOf alRemoteCustomFieldValue Is List(Of RemoteCustomFieldValue) Then
Dim rcfvUsrInput As RemoteCustomFieldValue = New RemoteCustomFieldValue
rcfvUsrInput.customfieldId = ContentCtrl.ID
rcfvUsrInput.values = s.ToArray
alRemoteCustomFieldValue.Add(rcfvUsrInput)
Else
Dim rcfvUsrInput As RemoteFieldValue = New RemoteFieldValue
rcfvUsrInput.id = ContentCtrl.ID
rcfvUsrInput.values = s.ToArray
alRemoteCustomFieldValue.Add(rcfvUsrInput)
End If
End If
End Sub
|
|
|
|
|
Even if you could have the TypeOf ... is ... condition you were trying for, the code inside that if block will still fail. Just because you have made a check to ensure that the contents of a variable is a certain type, the compiler will still treat the variable as if it is the base type. You would need to put something like this:
Private Sub GetUserInputValues(Of T)(ByRef alRemoteCustomFieldValue As List(Of T))
....
If TypeOf alRemoteCustomFieldValue Is List(Of RemoteCustomFieldValue) Then
Dim customList As List(Of RemoteCustomFieldValue) = _
CType(alRemoteCustomFieldValue, List(Of RemoteCustomFieldValue)
Dim rcfvUsrInput As RemoteCustomFieldValue = New RemoteCustomFieldValue
rcfvUsrInput.customfieldId = ContentCtrl.ID
rcfvUsrInput.values = s.ToArray
customList.Add(rcfvUsrInput)
Else
....
The problem stems mainly from the fact that generic classes cannot be converted based on the type parameter (eg: List(of Derived) cannot be converted to List(of Base) ). You can however create a specialized version of the function for when T is RemoteCustomFieldValue.
Private Sub GetUserInputValues(alRemoteCustomFieldValue As List(of RemoteCustomFieldValue))
End Sub
However, if you have a class SpecializedFieldValue that derives from RemoteCustomFieldValue , and you have a List(of SpecializedFieldValue) , the more generic version of the function would be called.
Also, unless you intend to completely replace the list in the code that calls the function (not just Clear and Add new items), you should probably pass ByVal instead of ByRef.
|
|
|
|
|
This program can make back ups of set directories at an interval or on demand. Instructions are given as you click buttons.
<size=18>New Version: 3.1
Changes in 3.1:
- No error occurs when minutes box has a 0 in it.
- Stop auto-backup button with confirmation on press if you're sure.
- Close button checks if you're auto-backing up, and gives message accordingly.
- Timed out messagebox's timer now restarts every time it pops up and doesn't carry over.
Pic: View Pic
Virus Scan: Virus Scan Results
Download link: Download
Original thread: Clicky
|
|
|
|