|
Justin Perez wrote: No one gives a rats ass if it's urgent. Additionally, learn how to use google. Instead of waiting for a response from here, you could be doing research to actually get the job done yourself. Lazy ass.
Wow! You are on a roll today
"What's your question? All I see is some deranged, half-assed looking run-on sentence. Where are you having problems?" - Justin Perez
|
|
|
|
|
denilda82 wrote: How do i configure a barcode reader to read any cod
YOu're going to have to consult the documentation on the barcode reader. That stuff is covered in the manuals. Anything anyone tells you about a procedure to do what you want would be nothing more than a guess.
|
|
|
|
|
denilda82 wrote: please very urgent.
How rude.
"What's your question? All I see is some deranged, half-assed looking run-on sentence. Where are you having problems?" - Justin Perez
|
|
|
|
|
I am using a timer with 1000ms interval to count secs. I need to perform certain functions after regular intervals. The problem is the timers are not accurate. Every 30 mins I lose appx 25 secs i.e., when timer starts count=1 and after 30 mins the count is appx 1775 instead of 1800. I actually took a stop watch and timed it. This way I am losing a lot of time by the end of the day. I have tried using System.Timers and system.windows.forms.timer but both have the same problem. I am using VS 2005 express edition
If I use timer with interval 100ms .. it is even worse.
Am I missing something? Please help.
modified on Sunday, April 6, 2008 11:09 AM
|
|
|
|
|
Well this timers were never indented to be precise (there are a few "better" timers in the DirectX-SDK).
When I get your question correct all you need to do is still use your timer (let's say with an 500ms interval) and just check the timespan since last run:
Define a
private _lastCallTime as DateTime = DateTime.MinValue
in your form-class and in your Tick-Handler:
<br />
<br />
if DateTime.Now.Substract(_lastCallTime) >= TimeSpan.FromMinutes(30) then<br />
_lastCallTime = DateTime.Now<br />
end if<br />
<br />
|
|
|
|
|
Thank you for your response.
This will be temporary fix for one part of my program.In my application a lot of events depend on the One second timer. I also have to display the counter counting up, trigger various events when it reaches certain values and then reset. These values depend on lot of parameters and keep changing.
I really need a good timer. I have seen many applications where they use software timers to trigger events. I dont know how they do it, may be they use one of the "better" timers like you have suggested. (1) Could you please suggest some links where i can find examples for using one of these timers in vb.net application? (2) I searched online for directX SDK download which would worrk with vb.net on vista OS. I found the following link. Microsoft states that this file works with c/c++ and C# but doesnot mention vb.net. The other links I found for vb.net donot work with vista Any suggestions?
http://www.microsoft.com/downloads/details.aspx?FamilyId=4B78A58A-E672-4B83-A28E-72B5E93BD60A&displaylang=en
again... thanks a lot for your input!!
|
|
|
|
|
Out of all the Timers that come in the .NET Framework, the System.Windows.Forms.Timer class is about the worst when it comes to raising it's event on time. System.Timers.Timer is better, but can still be late. The System.Threading.Timer is the most accurate, but is also the hardest to use.
In any case, counting ticks of a timer is about the worst way you can implement this. You should be using a rather fast firing timer (accurate or not) and comparing the current time to the scheduled time of a process you need to launch, even if it's every one second.
If you're code is doing other things and the UI thread is blocked for longer than your Timer's Interval is set for, using anything but the Threading.Timer will result in your tick count not being accurate because the events cannot be processed until the UI thread is unblocked.
Another possible issue is something else running on the machine could be screwing with the O/S-based timers that the .NET Timer classes rely on. Be it bad hardware or an O/S problem.
|
|
|
|
|
i have batch file calling command prompt and i use shall() and System.Diagnostics.Process.start().WaitForExit() and it appear quickly where do not anything ?
and batch file I want to execute the C++ compiler(sound.exe)
modified on Friday, January 25, 2008 1:31:36 AM
|
|
|
|
|
Uhhh...what?
I can't understand what you're describing or what the question is. I don't think anybody else can undetstand what you said either.
|
|
|
|
|
Hi all,
I have an issue with the code below, What it does is it searches a character or a word in a text, the problem is that let's say im searching for the word "net" in "net work net work net work" what will happen is that it will highlight the second net then after pressing enter it will highlight the third net. It completely ignores the first "net". Any suggestions will be fine.
the value of nLoc_Temp is 1
Thanks,
Jj
Private Sub Find_Text()
Dim nLoc As Long
Dim nResp As Integer
StartSearch:
TextView.SetFocus
Radio_Vals (False) 'disable radio buttons
'check for search type
If rdo_Exact(0).Value = True Then
nLoc = TextView.Find(txt_srch.Text, nLoc_Temp, , rtfWholeWord)
Else
nLoc = TextView.Find(txt_srch.Text, nLoc_Temp)
End If
If nLoc <> -1 Then
'next start-up possition
nLoc_Temp = nLoc + Len(txt_srch.Text)
Else
If nLoc_Temp <> 1 Then
nResp = MsgBox("Search complete!" & Chr(13) & Chr(13) & _
"Search again from start?", vbYesNo + vbInformation)
If nResp = vbYes Then
nLoc_Temp = 1
GoTo StartSearch
Else
'clear selection
TextView.SelLength = 0
txt_srch.SetFocus
Radio_Vals (True)
End If
Else
MsgBox "Cannot find [" & txt_srch.Text & "]", vbExclamation
txt_srch.SetFocus
Radio_Vals (True)
End If
End If
End Sub
|
|
|
|
|
I am not entirely sure about how this TextView.Find works, but as you are checking for nLoc not being -1, I would guess that it works with a zero based index. As such, again by the look of it, it never finds the first net, because it starts searching at the e. You can easily test this with "xnet work net work net work" or by (re)setting nLoc_Temp to zero.
My advice is free, and you may get what you paid for.
|
|
|
|
|
monsieur_jj wrote: If nLoc <> -1 Then
'next start-up possition
nLoc_Temp = nLoc + Len(txt_srch.Text)
Else
what is this piece of code supposed to do?
and does it achieve that? if not, why not?
is this your code, or just something you copied without having a clue?
do you know how to debug some code?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi all
I'm just after general examples dealing with streamwriter appendtext examples.
I have had a look around microsoft and of course Code Project but can't find much to help. I am old and ready for the knackers yard, but still trying. I use the MSDN in Miscrosoft, but sometimes i find it more confusing than helpful. Can anyone just give me general guidance?
Thanks
Zeldacat
Regards
Zeldacat
|
|
|
|
|
Hi Zeldacat,
.NET has some really cool support for many things, among which are Streams. A Stream is ultimately derived from the System.IO.Stream Class.
Please know that StreamWriter Class Implements a TextWriter for writing characters to a stream in a particular encoding. StreamWriter defaults to using an instance of UTF8Encoding unless specified otherwise. This instance of UTF8Encoding is constructed such that the Encoding.GetPreamble method returns the Unicode byte order mark written in UTF-8. The preamble of the encoding is added to a stream when you are not appending to an existing stream. This means any text file you create with StreamWriter will have three byte order marks at its beginning. UTF-8 handles all Unicode characters correctly and gives consistent results on localized versions of the operating system.
I would suggest you to go through the following articles for more information regarding StreamWriter class. http://www.knowdotnet.com/articles/streams1_4.html
http://msdn2.microsoft.com/en-us/library/system.io.streamwriter(VS.71).aspx
http://www.exforsys.com/tutorials/vb.net-2005/access-and-manipulate-data-working-with-disk-files/1.html
I hope these articles will help you to understand the concept and functionality of StreamWriter class.
Have a nice day .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Thanks John for the info. It is the sort of info i needed to look at before i tried again
Regards Lawrence
Zeldacat
Regards
Zeldacat
|
|
|
|
|
I want to read from a file and save that data in variables. It worked fine when I used global variables in the same class. Now I am "cleaning" my code and want to make it more OOP. So, I have created another class that has those variables and I created get statements and set statements to control access to the variables. I need help using the set statements to save the variables.
Before OOP code.
FileOpen(3, path + "\" + "baseconfig.txt", OpenMode.Input, OpenAccess.Read, OpenShare.LockRead)<br />
Input(3, Database)<br />
Input(3, Connectionstring)<br />
Input(3, Table)<br />
Input(3, custNameField)<br />
Input(3, OrderNumField)<br />
Input(3, materialField)<br />
Input(3, TruckNumField)<br />
Input(3, Haulerfield)<br />
Input(3, LoadFinishedField)<br />
Input(3, TargetField)<br />
Input(3, GrossField)<br />
Input(3, TareField)<br />
Input(3, DatabaseType)
With OOP Not working-- I don't know how to put a method in the following code or even if it would work.
FileOpen(3, path + "\" + "baseconfig.txt", OpenMode.Input, OpenAccess.Read, OpenShare.LockRead)<br />
Input(3, Me.thisDatabaseChoice.SetDatabase(?))<br />
Input(3, Me.thisDatabaseChoice.SetConnectionString(?))<br />
Input(3, Me.thisDatabaseChoice.SetTable(?))<br />
Input(3, Me.thisDatabaseChoice.setsetcustNameField(?))<br />
Input(3, Me.thisDatabaseChoice.SetOrderNumField(?))<br />
Input(3, Me.thisDatabaseChoice.SetmaterialField(?))<br />
Input(3, Me.thisDatabaseChoice.SetTruckNumField(?))<br />
Input(3, Me.thisDatabaseChoice.SetHaulerfield(?))<br />
Input(3, Me.thisDatabaseChoice.SetLoadFinishedField(?))<br />
Input(3, Me.thisDatabaseChoice.SetTargetField(?))<br />
Input(3, Me.thisDatabaseChoice.SetGrossField(?))<br />
Input(3, Me.thisDatabaseChoice.SetTareField(?))<br />
Input(3, Me.thisDatabaseChoice.SetDatabaseType(?))
I do have one parameter in each of these methods. How can I make this work? Can I? Do I have to store them in a variable first and then do the set statements?
|
|
|
|
|
Why are you using methods when property get/set accessors are more appropriate?
I suggest you read this article[^].
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Maybe you didn't read my post closely enough? I AM using get and set accessors. My question that I need help on is not how to use get and set accessors in general. It is can I use them in the example that I posted. I will post again for you in this reply.
I am reading from a file. I am currently placing them in variables. But I want to place them in Class variables that I already created successfully and are using throughout my program.
EX: Right now.
FileOpen(3, path + "\" + "baseconfig.txt", OpenMode.Input, OpenAccess.Read, OpenShare.LockRead)
Input(3, database)
Input(3, connstring)
Input(3, table)
Input(3, custNameField)
Input(3, orderNumField)
Input(3, materialField)
Input(3, truckNumField)
Input(3, HaulerField)
Input(3, LoadFinishedField)
Input(3, targetField)
Input(3, grossField)
Input(3, tareField)
Input(3, databasetype)
I want to be able to use my setACCESSORS
I get an error when I try.
Input(3, SetDatabase()) 'As an example.
Do you know of a way to us the setaccessors in the Input(3, ) code? Or do I have to use the variables that already work?
|
|
|
|
|
vb.net /.net-framework 1.1
i created a class which inherits from datagrid.
i had to override onmousedown, but now the inherited grid doesn't sort and resize columns anymore.
with hittestinfo.type i can determine whether the user clicks on columnresize or on column, but how do i have to induce sorting and resizing now?
|
|
|
|
|
If you did an override on the onmousedown , you may need to supply code to do the sorting and resizing.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
yes, i know. but how do i do that?
ah, found out.
modified on Thursday, January 24, 2008 6:09:43 PM
|
|
|
|
|
|
I don't think anyone is going to give you complete code to encrypt and compress mpegs; would you??
Considering what is required and what is involved, I would look for a component that already does it. Why reinvert the wheel? Have a look at ComponentSource[^]
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
No1 : We dont work for you
No2 : We dont do work for other people
No3 : You dont respect us, you come here and say ...urgent!!!! to us
Until you start using Google or Respecting
We will ignore you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You expect people to simply do your work for them? Your post is very rude. You are demanding "detailed guidance," or complete source code to your project when you most likely haven't made any attempt, or done any research to get it done. Part of being a software developer is the ability to reserach and think on your own. Oh wait, it's urgent, huh? Oh I guess it's okay then. Posts like this will get you ignored 99% of the time. That's great though, hopefully when someone here won't do your project you will get fired, then it will be one less person posting crap like this. You will find a job flipping burgers will better suit you.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|