|
Sorry, but your posted message is very hard to understand. And I'm confused about your code. How is the Run() method called or by what control? What type of VB are you using? Perhaps it is my own limited knowledge, but I really don't understand the AddHandler code you are using.
Perhaps you should think about using a timer control. That way you can check the file every half hour without the user pressing a button.
For anyone else who is trying to help, I used an online translator to translate the error message to english and got this:
Error with providing the form. Further information finds you in exception inside exception. Error: For the current Thread the STA mode (single Thread apartment) must be specified, before OLE calls can be implemented. Guarantee that the main function is marked by STAThreadAttribute.
Perhaps you can use some break points/debugging methods to pin point exactly where the error is occuring.
Sorry I couldn't help you more.
|
|
|
|
|
Hallo thanks for answere. First the txt file not look every half an hour exectly so i want do this with the watcher. My vb is VB2005 netframework2.
In this Code i look for change filter on the sms.txt file. Then i have an Frmsms its look informations about the productivity of some works. I want only refresh the label in this Form and the translated message from you is correct. If the txt changed a msgbox is popup i have test it.Thats all correct by the handle but if i do refresh or do anything outside this class (frmsms.label5.refresh) or else the error is pop up..
I look to command my code and post nearly.
Thanks Thomas
|
|
|
|
|
Sorry, but this doesn't help. We still can't understand a thing you said.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi everyone,
I have this application that I need to actually restart it because I have so many things to reset and I can't identify all of them to reset them one by one. So I thought of using Application.Restart and it works but the blinking of the interface seems a little annoying.
I was thinking is there any better way to do it other than making another identical interface on top of it? So that the user would not know it is being restart.
Thanks
J Liang
|
|
|
|
|
Not really. You've got 4 options...
1) Use Application.Restart
2) Launch a new copy of your application, and probably get the same effect as #1
3) Reset everything that needs to be reset, one thing at a time.
4) Move as much data as you can, that needs to be reset, into it's own seperate class, then serialize the "just initialized" state of this class out to a file. When you need to restart, just reload the data.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
First, with a cold restart, blinking seems to be inevitable. However, it's difficult to re-initialize the running application to its startinf state without a restart. Actually, GUI is not the most difficult part; the system state is.
The approach we often adopt is save/restore or snapshot. The original idea is that during training, the trainee often want to take a snapshot and save it to a disk file. Next time, when you run the app again, you could load that snapshot and restore to the system state when the snapshot was taken. We also find the snapshot is handy when we want to re-initialize the application without restarting, which I call "hot restart". But usually, it is not trivial to implement a snapshot capability.
Best,
Jun
|
|
|
|
|
Hi
How to filter record in dataset and update those filtered records
Thanks in advance
|
|
|
|
|
'** Creat a dataview of the table in the dataset
Dim tableView As DataView = New DataView(dataSet.Tables("TableName"))
'** Filter the dataview to isolate the one row being updated
Dim sb As New StringBuilder
With sb
.Length = 0
.Append("TableColumnName")
.Append("= '")
.Append("ValueOfData")
.Append("'")
tableView.RowFilter = .ToString
End With
sb = Nothing
'** Do the update
If tableView.Count > 0 Then
'** Create a view of the row being updated
Dim tr As DataRowView
tr = tableView.Item(0)
'** Update the columns being changed
tr.Item("NameOfColumnBeingChanged") = "NewValue"
tr = Nothing
End If
tableView = Nothing
|
|
|
|
|
I have one font required in my project . which I dont want to install on the client infact it should be some where in my Resource files and I should use it from there.
Any ideas or suggestions
Regards
Rizwan Bashir
|
|
|
|
|
Hi all,
I'm having trouble editing the atrribute "member" of a group. I can extract all the information but can't add or remove anything. It's a Win2003 Server/DC, I have the rights to add/remove.
I'm using VB .net 2005
My Code:
oSearcher.Filter = "(&(objectClass=group)(cn="something..."))"
oSearcher.SearchScope = System.DirectoryServices.SearchScope.Subtree
oSearcher.PropertiesToLoad.Add("member")
oResult = oSearcher.FindOne
oResult.GetDirectoryEntry.Properties("member").Remove(something...)
oResult.GetDirectoryEntry.CommitChanges()
Is there an error in the code? What ist the better way to go: to use "Invoke" or the "Properties"? What's the difference? Is there any way to get a response if the add/remove didn't work (eg don't have the rights or wrong group name...)? I need to get this done by Monday so pleeeeeaaase help!
Regards,
Uli
-- modified at 6:27 Friday 14th July, 2006
|
|
|
|
|
I figured it out myself.
The problem was that I was trying to edit the oResult Object which doesn't work!
oResult = oSearcher.FindOne
Dim deObject as DirectoryEntry
deObject=oResult.GetDirectoryEntry
deObject.Properties("member").Remove(something...)
deObject.CommitChanges()
That's all.
Hope this helps someone.
Uli
|
|
|
|
|
hellow to all
i am trying to build my own Custom Control that Inherits from AxMSMask.AxMaskEdBox .
i wanna do simple thing i wanna have some property that when i make it ture it will run function every time that the user leave the MaskedBox it will run .
i started writing my own code , but i code stucked i didn't found good stuff anyone can help me with the following code ? , or give me links to related issues ?
Imports System.ComponentModel
Public Class MskTextBox
Inherits AxMSMask.AxMaskEdBox
Private DateStr As Boolean
Public Property DateValidator() As Boolean
Get
DateValidator = DateStr
End Get
Set(ByVal Value As Boolean)
DateStr = Value
End Set
End Property
Private Sub MskTextBox(ByVal Datestr As AxMSMask.AxMaskEdBox)
If Not IsDate(Datestr.FormattedText) Then
MessageBox.Show("error ! ")
End If
End Sub
End Class
|
|
|
|
|
Is there is specific problem you are having with your code?
|
|
|
|
|
I have developed project on VB6.0 and Database backend in SQL Server
more than 30 user are use this software in at time. They are not faced any problem the s/w working fine but as soon as the no. of user are increased we are
faced process Id problem Plz Help me
Process ID problem means There was error as dead processId of sql server
-- modified at 9:00 Friday 14th July, 2006
|
|
|
|
|
Sinchan Nikam wrote: but as soon as the no. of user are increased we are
faced process Id problem
What do you mean by "a process Id problem"?? There's not enough information here to figure out what your talking about let alone what the problem is.
The EXACT, word-for-word, error message would help greatly!
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 9:53 Friday 14th July, 2006
|
|
|
|
|
If it's the error that I THINK you're getting, you might want to look at Troubleshooting Deadlocks[^] in the SQL Server documentation.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Please help me how to set the connection pulling in VB6.0
|
|
|
|
|
Sinchan Nikam wrote: Please help me how to set the connection pulling in VB6.0
"Connection pulling"?? What do you mean by this?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm assuming he means connection pooling
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
So am I, but I've been wrong before!
I'm actually looking for why he thinks he needs to "turn it on"...
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 9:47 Friday 14th July, 2006
|
|
|
|
|
I need my program to do the following things in this order:
Find all the CDROM Drives on a computer
Determine which CDROM Drive contains a certain CD (i.e. My Stuff)
Find a file on that cd ( i.e. Setup)
Run that file
thankyou in advance
Im using VB.NET Express Edition and i am only a self taught amateur.
Posted by The ANZAC
-- modified at 6:56 Friday 14th July, 2006
|
|
|
|
|
try this. it's VB 2005.
Imports System.IO
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'get the drives
Dim di As System.IO.DriveInfo
For Each di In My.Computer.FileSystem.Drives
'check that the drive is ready
If di.IsReady = True Then
If di.DriveFormat = "CDFS" Then
If di.VolumeLabel = "My Stuff" Then
'list files
FileSearch(di.Name)
End If
End If
End If
Next
End Sub
Private Sub FileSearch(ByVal Drive As String)
'search for files on the drive matching criteria
Dim strCriteria As String = "*.exe"
Dim objDirInfo As New DirectoryInfo(Drive)
Dim objFile As FileInfo
'list each file in all directories
For Each objFile In objDirInfo.GetFiles(strCriteria, SearchOption.AllDirectories)
If objFile.Name = "Setup.exe" Then
objFile.Open(FileMode.Open, FileAccess.Read)
End If
Next
End Sub
End Class
-- modified at 7:46 Friday 14th July, 2006
|
|
|
|
|
Thankyou very much, just testing now.
-----------------------------------------
Didnt seem to work.
What about DVD Drives?
Is it possible to directly access the drive that the program was run from.
Posted by The ANZAC
-- modified at 8:31 Friday 14th July, 2006
|
|
|
|
|
The ANZAC wrote: Didnt seem to work.
which version of vb are you using? 6? 7? 8? it worked for me (i tested it using a text file in VB Express).
The ANZAC wrote: Is it possible to directly access the drive that the program was run from.
yes, examine the code in the FormLoad sub - it's a method for accessing drives.
|
|
|
|
|
I understand about the FormLoad Sub.
Ive done some tests with a message box that says "Worked!" and it appears that the program is finding the file, it's just not running it.
Posted by The ANZAC
|
|
|
|