|
Absolutely right.
(I incorrectly assumed that true would be 1 and not -1)
|
|
|
|
|
Dim query As ObjectSet(Of customer) = context.customers
Dim queryResult As ObjectResult(Of customer) = query.Execute(MergeOption.AppendOnly)
how do i get ddlcust.selectedvalue= queryResult.customerid
|
|
|
|
|
i am actually working on my final year project which is a pc-based fruit sorting system which involves computer vision.i am trying to use my program in vb to do all tasks involved.can you help me please?
|
|
|
|
|
Please understand that posting the same or similar question so often is considered spam.
"People demand freedom of speech to make up for the freedom of thought which they avoid."
|
|
|
|
|
Typically the folks here will not do your homework for you. Everyone here is extremely helpful providing you do your own research first and when you get stuck, then post your question along with a detailed explanation and you will get a prompt response.
My suggestion is to do some research first (Google it), then come back when you get stuck.
Good luck.
|
|
|
|
|
Wait, you're serious? Wow, I thought the previous post was a joke... Who in their right mind would try to do all of that in VB6?
|
|
|
|
|
I understand you're new around here. Please stick to a single thread as long as you're on the same subject, so don't hit "New message" all the time, just hit "Reply" when you want to reply to something someone has answered to one of your earlier posts.
As I said before, VB6 is not the best choice, but I understand there may be reasons for that choice. It will limit the amount of useful reactions you may get. I for one don't have any VB6 code, program or tool around. Parallel ports are a bit ancient too, my systems don't have any. There used to be an "inout.dll" file that did some input/output magic, back in time when Windows still let you do anything you wanted; not sure that DLL would be acceptable to Win XP, I'm pretty sure Vista/Win7 will dislike it.
And then there is the matter of responsiveness. In my opinion Windows isn't capable of providing smooth steps to a stepping motor. It you wire it up, the result will be jerky and loud, as no pulse will have a reasonably accurate position or width. In order to control a stepper motor, you need a micro-controller (with or without a very simple kernel), and not a mighty CPU with a massive operating system that lacks real-time qualities.
|
|
|
|
|
Take a look on the coding4fun[^] blog; they've got a section on hardware-projects, being complete tutorials that could be inspiring.
Are you sure that your school accepts VB6?
I are Troll
|
|
|
|
|
First, I'd seriously question the quality of the school yuo're going to if they are still teaching in VB6.
Second, in order to get a stepper motor to work reliably, and allow your code to do other thing while the motor is turning, you need to go with dedicated hardware, like the stuff you find as Phidgets.com and TrossenRobotics.com.
If you tried to do this in your VB6 code, you'd be able to turn one motor only and do nothing else until your code stopped the motor.
|
|
|
|
|
i am actually working on my final year project which is a pc-based fruit sorting system which involves computer vision.i am trying to use my program in vb to do all tasks involved.can you help me please?
|
|
|
|
|
VB6... Gotta mention that it's VB6... Otherwise you ruin the joke
|
|
|
|
|
No no, the joke is intact. It just got a tiny bit more subtle.
|
|
|
|
|
can anyone help me with codes to control a stepper motor in visual basic 6 via the parallel port?
|
|
|
|
|
No thanks, for all kinds of reasons:
1. VB6 is dead. However they forgot to bury it.
2. Parallel ports are rare.
3. A Windows system is too expensive and Windows itself too slow to step a stepper motor.
What you must do is have some stand-alone intelligence that creates the steps (or microsteps), and accepts macroscopic commands (e.g. ramp up linearly from velocity1 to velocity2 in x seconds) over a rather modern and cheap interface (e.g. RS232C or USB), and provides all necessary safety precautions (e.g. a set of microswitches breaking all power in an emergency).
|
|
|
|
|
Luc Pattyn wrote: VB6 is dead. However they forgot to bury it.
You have to shoot it in the head or cut off its head to stop it.
Man, study the works of George Romero or else you are lost when it comes to the worst!
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
I'm quite familiar with Romero's work, thanks; I'm not afraid of a little VB6, I just don't keep it around nor do I offer any assistance.
Smithers-Jones wrote: You have to shoot it in the head or cut off its head to stop it.
Nah. I just prefix a little Option Strict On and I'm pretty sure it stops compiling.
|
|
|
|
|
can anyone help me with codes to control a stepper motor in visual basic 6?
|
|
|
|
|
Hi,
Throughout my application I have several ComboBoxes which are data bound to a collection of objects (uaually a generic list). Because the user needs the option to not select an item in the Combobox I need an empty item at the start which says something like "Please Select".
The way I am doing this currently is to add an extra object to the start of my collection which gives me what I want. However, because a lot of these Comboboxes are bound to a collection of objects that are built when the application starts and remains in memory for the duration of the users' session, it means that my collections have an extra object in them which is causing problems elsewhere in the application.
Is there any other way of inserting an item into the start of a combobox that is bound to a collection of objects?
I hope this makes sense, if not then please let me know and I will try to clarify. Thanks for your time.
Jay
|
|
|
|
|
How about creating a wrapper class over the list, that adds the null element?
Just need a class that implements IList<whatever> and passes all operations through to the underlying list, except that it returns a count one higher than the list count, subtracts one from all provided indices, and returns null for element #0.
|
|
|
|
|
OK, thanks a lot. Sounds like a good idea, will give it a go tomorrow.
Thanks again for your help
|
|
|
|
|
Hi guys,
i have a vb.net application that watched a folder and whenever a rtf file is dropped i want to read the text an save it to a txt file.
here's my code
Dim word_app As New Microsoft.Office.Interop.Word.Application
Dim word_doc As New Microsoft.Office.Interop.Word.Document
word_doc= word_app.Documents.Open(in_file, False, True, False, , , , , ,Microsoft.Office.Interop.Word.WdOpenFormat.wdOpenFormatRTF)
word_doc.ActiveWindow.Selection.WholeStory()
word_doc.ActiveWindow.Selection.Copy()
str = My.Computer.Clipboard.GetData(GetType(String).ToString)
'word_doc.SaveAs(out_file, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatText)
doc.Close(False)
word_server.Quit()
Dim sr As New IO.StreamWriter(out_file, False)
sr.Write(str)
sr.Close()
this is running on the a windows 2008 rc2 server as a window service.
the error messaage is "Object reference not set to an instance of an object"
if there is another simpler way please advise.
thank you kindly
Anoop
|
|
|
|
|
Hi,
the line which reads
doc.Close(false)
should that be
word_doc.Close(false)
And also, you have an object named word_server, where is that declared?
|
|
|
|
|
hi,
sorry i tried to make it more readable for you guys. i seemed to have mis-renamed the var on this snippet.
thanks
|
|
|
|
|
I suggest you forget about Word and experiment with a RichTextBox. You could set its Rtf property to load the RTF file content; then get its Text property. I haven't done this at any length, however the doc seems to suggest it would return the document content without any markup.
BTW: IMO the RTB does not have to be visible, nor part of any Form for this.
PS: As there are different levels of the RTF specification, it could happen that Word is more capable than an RTB, so complex documents might fail. I just don't know, I wish I did.
|
|
|
|
|
agreed, here is the function you can use..
Sub convertRTFtoText(ByVal in_file_path As String, ByVal out_file_path As String)
Dim rtb As New RichTextBox
rtb.LoadFile(in_file_path) 'this is your rtf file path
IO.File.WriteAllText(out_file_path, rtb.Text) 'this is your txt file path
End Sub
|
|
|
|