|
I have one ISDN PCI card installed on w2k system for voice communication.
When ever there is a incoming call i should get an aural indication through a buzzer which is on board of ISDN card.
Now the problem is that while giving the device driver the supplier has not compiled the buzzer activating file and now i am not getting aural indication.
So we have thought that we will activate the buzzer by accessing the registers of the card for which the supplier has given the details.
The supplier has given that in the register AOE and ACFG1 of PSB21150 IPAC Ic if we put value 0x04 and 0xfb the buzzer will activate and 0xff the buzzer gets deactivated.The incoming call indication is coming as interrupt to my VB application program and during that time i should activate my buzzer.
So if any one knows about how to access the registers then please let me know.
vani
|
|
|
|
|
Hardware registers? Can't be done from VB. You need to write a Ring 0 .DLL, essentially a device driver, accesses that hardware for you and exports functions for your VB code to call. What's stopping you from doing this in VB is the HAL (Hardware Abstraction Layer) of any NT Kernel-based Windows OS - NT4, 2000, XP, 2003, Vista.
You can find an example of this technique here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey guys,
Is there anyway to make a panel scroll when AutoScroll is true? If so, how does one accomplish this? Thanks
Mike
Gaming at the GuildofBlades.com is the only way to really experiece the level 99 Soul-Sucking Sword!
|
|
|
|
|
hi all;
I need Tutorial or source code to open
web cam on vb.net form (application)
and capture picture form it and save
it ofcourse as bitmap image.
I searched and I didnt found any thing.
THANKS
AMR-CIS
|
|
|
|
|
Look in the windowsmedia sdk documentation, or even directx has some examples.
|
|
|
|
|
How can I enforce Referential Integrity between 2 or more of my DataTables in VB.NET.
Please help with some sample code and oblige.
R. A. Abbasi
|
|
|
|
|
This largely depends on your database schema but you would probably be better off doing this via database triggers and stored procedures rather than in a VB program.
...Steve
|
|
|
|
|
Thanks Steve for the idea. I will appreciate if you would elaborate more on it as I am not very well versed with databases.
Regards.
|
|
|
|
|
I presume this is for an assignment/project? Unfortunately I cannot give you a tutorial on r/i via what I'd consider the best way (i.e. triggers) as it would take too long and I honestly cannot afford to spend the time doing so. Your best bet therefore is to implement the r/i in discrete code in your program.
This definition explains it better than I can. I hope it helps http://databases.about.com/cs/administration/g/refintegrity.htm[^]:
Definition: Referential integrity is a database concept that ensures that relationships between tables remain consistent. When one table has a foreign key to another table, the concept of referential integrity states that you may not add a record to the table that contains the foreign key unless there is a corresponding record in the linked table. It also includes the techniques known as cascading update and cascading delete, which ensure that changes made to the linked table are reflected in the primary table.
Consider the situation where we have two tables: Employees and Managers. The Employees table has a foreign key attribute entitled ManagedBy which points to the record for that employee’s manager in the Managers table. Referential integrity enforces the following three rules:
1. We may not add a record to the Employees table unless the ManagedBy attribute poi
2. nts to a valid record in the Managers table. If the primary key for a record in the Managers table changes, all corresponding records in the Employees table must be modified using a cascading update.
3. If a record in the Managers table is deleted, all corresponding records in the Employees table must be deleted using a cascading delete.
...Steve
|
|
|
|
|
Thanks again Sterve for further help.
I just expect to have a sample Stored Procedure, which implements Referential Integrity. The rest, I may try to manage myself.
Sorry for asking for more of your valuable time.
Best regards.
|
|
|
|
|
No problem. I don't mean to sound too harsh it's just that to provide detailed instructions on this board does take some time to do properly and there are other resources (either on this board or other web sites) that do address your questions. It's just a matter of finding them. I'm very glad to help where I can.
If you have access to the MSDN documentation, it provides some great info on transact-SQL and stored procedures, triggers, referential integrity etc. - most may be available free on the web too. Try a Google search and I'm sure that there will be something in the first few results that may be of interest.
Take your time to learn about the subject properly. It is something that cannot be learnt in one night.
...Steve
|
|
|
|
|
Hello again,
I'm trying to have have a command button that will map drives in vb.net...I have some code that does it...but it uses a command shell to map the drive and if the drive is already in use it does not show an error messsage to say it is not connected...I would also like a message showing that it is connected...I'll show you my code hopefully someone can show me where I went wrong...thanks again guys!
Private Sub btnMap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMap.Click
Dim ServerName As String
ServerName = txtIP.Text
Try
System.Diagnostics.Process.Start("net", "use h: \\" & ServerName & "\c$")
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
Andrew "Wondering where I went Wrong" Kong
|
|
|
|
|
Try this bit of code: (modify to suit your program)
Dim oNet As Object
Dim arrDrives() As String
Try
oNet = CreateObject("Wscript.Network")
'
' GetLogicalDrives returns an array with each entry
' being of the form "X:\" where X is the drive letter.
'
arrDrives = System.Environment.GetLogicalDrives
'
' Detect if it is already mapped.
'
If arrDrives.IndexOf(arrDrives, sDriveLetter.ToUpper & "\") >= arrDrives.GetLowerBound(0) Then
'
' optionally remove the drive
'
'oNet.RemoveNetworkDrive(sDriveLetter)
End If
'
' Map it.
'
Dim s As String = ""
s = oNet.MapNetworkDrive(sDriveLetter, sUNCPath)
'
' Report any errors by throwing an exception.
'
If s <> "" Then
Dim ex As New IOException("Unable to map the " & sDriveLetter & " drive. " & s & " - " & Err.Description)
Throw ex
End If
Catch ex As Exception
End Try
...Steve
|
|
|
|
|
I am getting the error message "Access of shared member or nested type through an instance; qualifying expression will not be evaluated." for the arrDrives.IndexOf line
I set the constant sDriveLetter and sUNCPath as:
Dim sDriveLetter As String = txtDrive.Text
Dim sUNCPath As String = txtIP.Text
but it still has not worked...
|
|
|
|
|
I assure you that code works very well on my system and it is in daily use.
Does the code compile? Maybe there is a typo or you have not included the required libraries?
Try stepping thru it in the debugger and inspect all the parameters to those calls. Something is not in the correct format as expected. Also look at the help files for the various methods and functions being used.
...Steve
|
|
|
|
|
I dont deny that your code works
I was thinking that maybe I'm missing the library...or perhaps the changes I made in the declaration are the problem...definately not typo though
Andrew
|
|
|
|
|
Hi all,
hope you can help me. I'm trying to create a dice roll project. I can't get the images to be randomly generated though. for the second one I tried picturebox instead of label - but I think that was probably wrong too.
any ideas?
thanks,
chris
Private Sub ButtonGooi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGooi.Click
Dim Dice As Integer
Dice = (6 * Rnd())
Select Case Dice
Case 1
LabelSteen1.Image = Image.FromFile(CurDir() & "\..\ds" & 1 & ".gif")
LabelSteen1.Image = Image.FromFile(CurDir() & "\..\ds" & 2 & ".gif")
LabelSteen1.Image = Image.FromFile(CurDir() & "\..\ds" & 3 & ".gif")
LabelSteen1.Image = Image.FromFile(CurDir() & "\..\ds" & 4 & ".gif")
LabelSteen1.Image = Image.FromFile(CurDir() & "\..\ds" & 5 & ".gif")
LabelSteen1.Image = Image.FromFile(CurDir() & "\..\ds" & 6 & ".gif")
Case 2
PictureBox1.Image = Image.FromFile(CurDir() & "\..\ds" & 1 & ".gif")
PictureBox1.Image = Image.FromFile(CurDir() & "\..\ds" & 2 & ".gif")
PictureBox1.Image = Image.FromFile(CurDir() & "\..\ds" & 3 & ".gif")
PictureBox1.Image = Image.FromFile(CurDir() & "\..\ds" & 4 & ".gif")
PictureBox1.Image = Image.FromFile(CurDir() & "\..\ds" & 5 & ".gif")
PictureBox1.Image = Image.FromFile(CurDir() & "\..\ds" & 6 & ".gif")
Case 3
Labelsteen3.Image = Image.FromFile(CurDir() & "\..\ds" & 1 & ".gif")
Labelsteen3.Image = Image.FromFile(CurDir() & "\..\ds" & 2 & ".gif")
Labelsteen3.Image = Image.FromFile(CurDir() & "\..\ds" & 3 & ".gif")
Labelsteen3.Image = Image.FromFile(CurDir() & "\..\ds" & 4 & ".gif")
Labelsteen3.Image = Image.FromFile(CurDir() & "\..\ds" & 5 & ".gif")
Labelsteen3.Image = Image.FromFile(CurDir() & "\..\ds" & 6 & ".gif")
Case 4
LabelSteen4.Image = Image.FromFile(CurDir() & "\..\ds" & 1 & ".gif")
LabelSteen4.Image = Image.FromFile(CurDir() & "\..\ds" & 2 & ".gif")
LabelSteen4.Image = Image.FromFile(CurDir() & "\..\ds" & 3 & ".gif")
LabelSteen4.Image = Image.FromFile(CurDir() & "\..\ds" & 4 & ".gif")
LabelSteen4.Image = Image.FromFile(CurDir() & "\..\ds" & 5 & ".gif")
LabelSteen4.Image = Image.FromFile(CurDir() & "\..\ds" & 6 & ".gif")
End Select
End Sub
Private Sub ButtonResultaatTonen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonResultaatTonen.Click
Dim LetsPlay As New FormToonDobbelStenen
LetsPlay.Show()
End Sub
Private Sub FormDobbel_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
randomize ()
End Sub
End Class
|
|
|
|
|
It looks like you're selecting the Dice at random but you are still loading the image controls in the same order (i.e. 1 thru 6) and the last one loaded will be the one displayed (i.e. "6").
You should be using the Dice variable (or another randomly generated one) to determine the face showing on the selected die.
Check that Dice = 6 * Rnd() will actually return an integer from 1 to 6 (hint: it doesn't the way it is coded now).
Additionally, if you only need to show one dice face this code can be simplified by removing the redundant image control load statements. If you need to show all faces of each die then be aware that opposite sides of the die total 7 (that is to say that 1 and 6 are on opposite sides of the die, as are 2 and 5, and 3 and 4).
...Steve
|
|
|
|
|
Is there any function to calculate z position in vb. We can calculate the x and y axis but how can we calculate the z axis. It is urgent.
|
|
|
|
|
Ummm.... This may be sound like a stupid question, but, calculate the z-position of what? Mars?????
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
maybe you can look for a prebuilt class with a zfromxandy function.
|
|
|
|
|
Hi Dev Gang
I have a folder with text files in it.. I would like to loop through each of the text files and look for a string e.g."me@here.com.au" and increment a count as each one is found...
Any Ideas?
I am new to programming and can reed text files but this is a little more than that so any help would be great...
Thanks Heaps...
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
If you know how to read textfiles as you say then it's rather easy. Let's suppose you read the textfile in a filecontent string and you look for something stored in the string texttolook then
if filecontent.indexof(texttolook)<>-1 then yourcounter += 1
that's it. And move onto the next file.
|
|
|
|
|
Okay, here's some pseudocode for you. I hope that it helps.
Construct a Regex for your search string
Initialize your count variable to 0
For each file in the directory
Open the file
Read it to the end and store the string
Find the number of matches to the regex in the string
Increment your count variable by that number and, some example (but not necessarily compilable) code
Dim i As Integer
Dim r As Regex
r = New Regex("me@here.com.au")
Dim fileEntries As String() = Directory.GetFiles(targetDirectory)
Dim fileName As String
For Each fileName In fileEntries
i = i + r.Matches(File.OpenText(fileName).ReadToEnd()).Count
Next
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi all,
I'm trying to use the Winsock component but when I receive data from the client conection the data buffer is empty although that the "bytesTotal" has the right value.
<br />
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)<br />
Dim data As String<br />
Winsock1.GetData(data)<br />
<br />
Text1.Text = Text1.Text & data<br />
End Sub<br />
If I try to add the type parameter (vbString) I can't compile: "Waiting for ="
Any idea??
Thanks in advance.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|