|
Oops! I forgot to mention that little tidbit. The code should work if you add a reference to the "Microsoft ActiveX Data Object Library" or something very similar. I can't remember the name off the top of my head.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I am trying to write a program to control a Digital Poteniometer via parallel. I was doing fine until I tried to work out how to read back some data from the device. I send a command to the chip, which then returns a serial stream of data out of a pin, which I have connected to S3 (status register) on the parallel port. I have been able to read the status register and then isolate S3 from this, but S3 is meant to be changing, so how can I make my program look for an event change in this register, ideally every x seconds or something??
Any help would be greatly appreciated.
Regards,
Adam.
|
|
|
|
|
have you tried a timer. I use it to make clocks on my apps by telling it to read the system time every second.
James Kennelly
|
|
|
|
|
This is what I use for a precision timer:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q172/3/38.asp&NoWebContent=1
How To Use QueryPerformanceCounter to Time Code
|
|
|
|
|
Sorry, Here is the one for vb.net:
http://support.microsoft.com/default.aspx?scid=kb;en-us;306978
How To Use QueryPerformanceCounter to Time Code in Visual Basic .NET
|
|
|
|
|
Here is one more that might be of help:
http://msdn.microsoft.com/msdnmag/issues/04/02/TimersinNET/default.aspx
Timers
Comparing the Timer Classes in the .NET Framework Class Library
|
|
|
|
|
Intelligent graphic image analysis and comparison
Hi,
I’m thinking if there is any way to compare two or images and see if they have let’s say have more than 80% common parts, which mean that they are probably the same?
At his moment I want to write an app that will stupidly see if the image is identical, well maybe there was some resizing, or quality reduction and or some other minor changing. In another words I wanna mach them up.
I think I need to use bit structure / analysis, but I have no idea how that works.
Thanks!
|
|
|
|
|
I have to do an Exercise by tomorrow but i don't know how to do it
Here is the exercise from the book:
In this excercise, you create an application from Premium Paper. The aplication allows the sales manager to enter the company's income and expense amounts. The number of income and expenses amounts may vary each time the application is started. For example, the user may enter five income amounts and 3 expense amounts. The application should calculate and display the company's total income, total expense, and profit(or loss). Use the InputBox function to get the individual income and expense amounts.
More instructions:
1. Design an appropiate interface. Use label controls to display the total income, total expenses, and profit(or loss). Display the calculated amounts with dollar sign and two decimal places. If the company experienced a loss,display the amount of the loss using red font. otherwise, display the profit using black ink.
CAN SOMEONE HELP AND SEND ME THE CODE FOR THAT? PLEASE!!!!
|
|
|
|
|
Please Tell me you dont want someone else to do your homework?
Isnt that cheating?
any ways you should be able to do it if you set your text boxes to 0 add and subtract the proper text boxes. As for the color use a if then statement like if textbox1.text < 0 then
textbox1.forcolor=system.drawing.color.red
else
textbox1.forcolor=system.drawing.color.Black
end if
very easy project if it is giving you this much trouble you might want to try a different field of research.
James Kennelly
|
|
|
|
|
joseuri21 wrote:
CAN SOMEONE HELP AND SEND ME THE CODE FOR THAT? PLEASE!!!!
This better be a joke...
If you have no idea how to do it, what on earth have you been doing in class all this time? And why did you wait till the last possible minute to start on this?
You're going down on this project and it's your own damn fault. None of us are going to bail you out by just handing you the entire project. We don't get anything for the work and all you're going to get is busted for plagerism. Since everyone's coding style is unique, your prof will instantly know that you didn't write the code.
We will help you with YOUR code. We will NOT write your code for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm using the ShellExecute API, but it is not opening any file with its associated program.
here is my coding:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd _
As Long) As Long
Public Sub RunProgram(ByVal strProgram As String)
Dim lRet As Long
lRet = ShellExecute(vbNull, "Open", strProgram, "", "", 1)
If lRet <= 32 Then
MsgBox("Error Running Program")
End If
End Sub
Public Sub btmView_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnview.Click
RunProgram(file_location)
end sub
It doesn't give me the error either. PLEASE HELP!
Lisa
|
|
|
|
|
It perfectly works in my pc. You might wanna check what is inside of the strProgram variable.( maybe there is a space in side?) try with the note pad like the following if it works.
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Dim lRet As Long
lRet = ShellExecute(vbNull, "Open", "C:\WINDOWS\SYSTEM32\notepad.exe", "C:\mytext.txt", "", 1)
If lRet <= 32 Then
MsgBox ("Error Running Program")
End If
End Sub
|
|
|
|
|
NO, it still doesn't do anything. I don't know what's wrong with it.
Lisa
|
|
|
|
|
Can you just create a new project with VB and copy & paste the following code.
In the form, you just add one button called "Command1"(by default).
Compile and run. it should work.
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd _
As Long) As Long
Public Sub RunProgram(ByVal strProgram As String)
Dim lRet As Long
lRet = ShellExecute(vbNull, "Open", strProgram, "", "", 1)
If lRet <= 32 Then
MsgBox ("Error Running Program")
End If
End Sub
Private Sub Command1_Click()
RunProgram "c:\windows\system32\notepad.exe"
End Sub
|
|
|
|
|
I meant at least you can launch notepad.
If using Windows2000,
you have to specified C:\WINNT\SYSTEM32\NOTEPAD.exe
|
|
|
|
|
it still doesn't work. it didn't open the notepad..and I'm using window2000..
Lisa
|
|
|
|
|
VB6 or VB.net? I am with VB6.
|
|
|
|
|
|
Try to use Shell or ShellExecuteEx to run from VB.NET instead of
ShellExecute
Since I don't have it installed, i can't test.
|
|
|
|
|
both won't work in the VB.NET
Lisa
|
|
|
|
|
Hello,
In VB .Net, you can use:
Process.Start( <insert your parameters here> )
Hope this helps,
Mitch
My sig:
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
My CodeProject Blog
Most recent blog post: April 3
|
|
|
|
|
|
Dear Friends
I faced a great problem when I want to run my database application built using VB .NET, on a computer that has no Visual Studio .NET and Microsoft Access installed.
What is the procedure to run my Windows application without VB .NET and Microsoft access.
I have to submit my assgnment in a few days. So if sombody know the solution please help me immidietely.
Tutul
Dhaka, Bangladesh.
Tutul
|
|
|
|
|
All it needs in the same version of the .NET Framework installed that you used to develop the app. You don't need Access or Microsoft Office. Just install MDAC 2.7 or better and you should be OK there also.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks a lot !! It realy works.
|
|
|
|