|
First thank you for answear, well when you say "Are you sure you have added proper references to the interop assemblies?", do you mean add the references in the menu project add references right?, yes I think I have add all references.
well I think I have a problem in translation this line in C# to VB .NET I dont know how make it right
m_device_conector.ConnectResult += New ...videosdk.device.deviceconectorEvents_ConectResultEventHandler(OnConnectResult)
I dont know if I need delegates, addressof or something like that...
can you help me?
thanks
|
|
|
|
|
Denis9999 wrote: I dont know ...
You could look it up in your VB.NET book. Or in MSDN. Or search some of the CP articles.
What you need probably looks like this:
AddHandler m_device_conector.ConnectResult, AddressOf OnConnectResult
|
|
|
|
|
Thanks for answear, I have a problem it appears me
-Not allowed a reference to the class DeviceConnectorClass when your assembly is connected by way NO-PIA
what means that of "NO-PIA"?? How can I solve it??
because this error I can see if it works the solution "addhandler...."
anybody knows how to solve it??
Thank you very much
|
|
|
|
|
NoPia blog posts[^]
have a read of that maybe it can help you?
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
You could try passing it through a .net converter to change from one to the other.
Google will provide you with many choices, some free, some, better ones, at a charge.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC League Table Link
CCC Link[ ^]
|
|
|
|
|
Dave the only problem is that the OP original did this and I think someone else had mentioned that the converters aren't 100% accurate in converting complex pieces of code
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
Of course not, but it is a start.
He will have to go over it, but if he does it block by block it is an achievable task.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC League Table Link
CCC Link[ ^]
|
|
|
|
|
Thank you all for your answears, I have used a converter to translated, but there is an error that I wrote before and I dont know how to solve it. can anyone help me?
|
|
|
|
|
Just curious...
Are you aware what a PIA is?
Have you contacted the vendor of the SDK you purchased to ensure that they even support VB? Sure, you may be able to get it to work, but things can be just different enough to make it tough sometimes and if they are not going to 'support it' then you might be in the hot heat.
|
|
|
|
|
Can anyone help me solve this problem? It give me this error at crypto.close. Any Suggestions?
Try
'checking to make sure the text box isn't null'
If (Decrypt_TextBox.Text = "") Then
MessageBox.Show("Need to put in the file location or select file in grid for decryption")
Else
'declaring string for file'
Dim filename As String
'Getting the file name that is selected'
filename = getFilename()
'Starting to abstract the data from the database'
database.ConnectionString = "Data Source = [name of database].db3;"
database.Open()
Dim command As SQLite.SQLiteCommand
Dim sqlstatement As String
command = database.CreateCommand
'The following will get the bytes of the file'
Dim filesize As Integer
sqlstatement = "SELECT FileSize From [table name] WHERE FileName=@file;"
command.CommandText = sqlstatement
command.Parameters.AddWithValue("@file", filename)
Dim reader As SQLite.SQLiteDataReader
reader = command.ExecuteReader
filesize = reader.GetValue(0)
reader.Close()
MessageBox.Show(filesize)
Dim data(filesize) As Byte
'The following should get the data'
sqlstatement = "SELECT FileData FROM [table name] WHERE FileName=@file;"
command.CommandText = sqlstatement
command.Parameters.AddWithValue("@file", filename)
Dim buf() As Byte
'This gets the file from the database'
reader = command.ExecuteReader
'The following should get the file back to its original form'
buf = reader.GetValue(0)
MessageBox.Show(buf.Length)
'This is go into the Safe and retrieve file'
Dim datawrite As New System.IO.FileStream("filename", IO.FileMode.Open, IO.FileAccess.ReadWrite)
datawrite.SetLength(0)
datawrite.Write(buf, 0, buf.Length)
datawrite.Close()
reader.Close()
Dim fileinput As New System.IO.FileStream("filename", IO.FileMode.Open, IO.FileAccess.ReadWrite)
'specific file output location wiht proper extension'
Dim fileoutput As New System.IO.FileStream(Decrypt_TextBox.Text & "\" & filename, IO.FileMode.OpenOrCreate, IO.FileAccess.Write)
'The next line makes sure that the file is empty'
'Declaring variables for encryption'
Dim buffer(4096) As Byte 'Holds the bytes for processing
Dim BytesProcessed As Double 'running count for bytes that are processed'
Dim filelength As Double = fileinput.Length() 'Length of file coming in where intEnd will be greater than intStart'
Dim bytesinblock As Integer 'current bytes in block'
Dim crypto As CryptoStream
'Declaring crypto service provider'
Dim scRijndael As New System.Security.Cryptography.RijndaelManaged
'setting up progress bars
Encrypt_ProgressBar.Value = 0
Encrypt_ProgressBar.Maximum = 100
crypto = New CryptoStream(fileoutput, scRijndael.CreateDecryptor(key, IV), CryptoStreamMode.Write)
While BytesProcessed < filelength
'reading the file'
bytesinblock = fileinput.Read(buffer, 0, 4096)
'writing the file to cryptoStream'
crypto.Write(buffer, 0, bytesinblock)
'updating bytes processed'
BytesProcessed = BytesProcessed + CLng(bytesinblock)
'equation for updating bytes in block'
Decrypt_ProgressBar.Value = CInt((BytesProcessed / filelength) * 100)
End While
crypto.Close()
fileoutput.Close()
fileinput.Close()
MessageBox.Show("File is done decrypting")
Decrypt_ProgressBar.Step = 0
Decrypt_ProgressBar.Value = 0
Decrypt_TextBox.Text = ""
End If
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
Return 1
|
|
|
|
|
The size of the file is 10 MB.
|
|
|
|
|
What error do you get?
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
I have searched the web and found many interesting code snippets and information on Speech Recognition however i am wanting to write code that will just recognise any sound coming from a microphone. Can anyone provide code or an idea on how to code, so that when any sound is heard in the microphone a procedure is called.
If there is not enough info above to make my question understood then here is an overview of what i wish the final code to do;
People with severe speech difficulties need to practice saying simple sounds of letters for example when you say the letter 'k' in the word 'kitten' its actually (phonetical type speech) "kuh". If i had a program that this person could use it would show the ltter 'k' and they would respond with "kuh" my program would then move to another letter etc. Well fortunately speech recognition on PC's nowadays is extremely sophisticated and i have coded something that actually works and responds to "kuh". This is great BUT for some of the severely speech diasabled people, what actually comes out when they respond is no more than a grunt. So for their intial training any response should call the procedure. This sounds simple enough but strangely i have found more information on actual recognition of words. Any help greatly apprieciated.
|
|
|
|
|
It means that you will have to do the recording part in your code. For each buffer received from the audio system, calculate the sum of squares of the sample values. If it is beyond a threshold, call your procedure.
|
|
|
|
|
Many thanks for a reply - was beginning to think i'd set a 'stinker' !! Ok i understand what you are saying - how do i record sound? I will do some Googling to see what i can find also.
|
|
|
|
|
This snippet of code runs OK on an XP machine. The database is a SQL Compact 3.1 and I am using VS2005
On a customer's Vista machine it causes an error saying that there is no Column 4 - even though there is!
The remed out bit is some diabnostics trying to solve this. The dtblLoc.Columns.Count must be returning 4 instead of 5 on the Vista machine as it responds for 4 columns but crashes on 5
The value of PLACE_COL is 3 and PROV_COL is 4
If bHasData = True Then
'intColumnsFound = dtblLoc.Columns.Count
'If bDiagsMode Then
' sw.WriteLine("-----------------Columns Found--------------------")
' sw.WriteLine(intColumnsFound.ToString)
'End If
If dtblLoc.Rows.Count = 1 Then
'================================================================================
' SINGLE RESULT AREA
'================================================================================
If ListProcessing = True Then
strReturn = dtblLoc.Rows(0).Item(PLACE_COL).ToString & "|" & dtblLoc.Rows(0).Item(PROV_COL).ToString
If bDiagsMode Then
Has anyone come across this kind of error, or got any ideas?
|
|
|
|
|
What is the value of intColumnsFound ?
I must get a clever new signature for 2011.
|
|
|
|
|
On an XP machine it is returning 5 columns and on a Vista machine it is 4 columns even though the database has 5 columns.
|
|
|
|
|
TheComputerMan wrote: On an XP machine it is returning 5 columns and on a Vista machine it is 4 columns even though the database has 5 columns.
Are you sure it's exactly the same database? This does not sound very likely.
I must get a clever new signature for 2011.
|
|
|
|
|
|
TheComputerMan wrote: I can assure you it is [the same]!
TheComputerMan wrote (in a message below): but this code has to access two versions of a database one has four columns and the later has 5 columns.
Either they are the same or they are different, they cannot be both.
I must get a clever new signature for 2011.
|
|
|
|
|
Sorry I was responding to your line
----Are you sure it's exactly the same database? This does not sound very likely.----
What I was meaning was that the program and database are exactly the same on each machine but runs on one and not on the other.
Incidentally, if stepping through a series of data rows
For Each drowLat As DataRow In dtblLoc.Rows
Got any ideas on how to go back one row? This is one of the reasons I was not using strings as column names because I have to get the previous row and you cannot use a field name in this type of statement.
strReturn = dtblLoc.Rows(intLastLatIndex).Item(PLACE_COL).ToString & "|" & dtblLoc.Rows(intLastLatIndex).Item(PROV_COL).ToString
If I can find a way round that I can get rid of the integer indexes.
|
|
|
|
|
TheComputerMan wrote: What I was meaning was that the program and database are exactly the same on each machine but runs on one and not on the other.
Well this still conflicts with your message below where you say that one system has four columns and the other has five; which is it?
TheComputerMan wrote: Got any ideas on how to go back one row?
I don't think you can. The whole point of a For Each loop is that it traverses a complete collection exactly once. If you need to have a more random traversal then you will need to use row indices, in order to move back to a previous point.
I must get a clever new signature for 2011.
|
|
|
|
|
Yes I suspected as much. Since it is only ever one row back on any occasion I have decided to simply hold the previous row for reference as a floating datarow that gets updated at the end of each loop. Seems to work OK and I have now go rid of columns being referenced by integer.
Thanks for your input. Waiting results from NZ.
|
|
|
|
|
Insufficient code. We have no idea what the SQL looks like that is returning these columns. But, based on looking at similar questions, I'd be willing to guess that it starts out something like "SELECT * FROM". Bad idea...
|
|
|
|