|
Dwayne J. Baldwin wrote: Even in c#, pointers are unsafe and unmanaged and must be declared as such.
Hence the "unsafe" keyword...
Dwayne J. Baldwin wrote: You need to jump through hoops to point to managed objects. You can use complex and often misused compilation tricks in either c# or vb.net to create a QuasiManagedPointer
Not really, when you know what you're doing. Various cases in point...[^]
Dwayne J. Baldwin wrote: C++.net is the only way to go should you ever happen to really need to go in that direction.
I'm not about to talk anyone through that little maze of confusion. There are far more articles that are "newbie understandable" about C# pointers and image processing than there are on C++/CLI and VB.NET integration.
Dwayne J. Baldwin wrote: Stop spreading this nonsense
When everyone else does, and/or VB.NET gets better at faster image processing.
|
|
|
|
|
|
Good find. Though it's not entirely pointerless as the author claims. It's still requiring unsafe code and the pinning pretty much just tells the GC to keep its mitts off the object and returns, of all things, a managed pointer to it. Different semantics doing the same thing...
|
|
|
|
|
To get fram by frame, you can go for VLC media player plug in.. There you could have an option to snap video file which is playin'on it.. By using Timer set the interval and use snap make the video in to Image and then process whatever you want.. Still you had doubt, mail me at whitewinter_alone@yahoo.co.in
|
|
|
|
|
you just need to use the openfilediag component and set a condition to test the file if it is the file extension you need or not. and display them is ok.
|
|
|
|
|
Hi I use this code and want to add id and avtor to combobox but display the field "avtor", when I select some from combobox I want to get "id"
Private Sub avtori()
Dim selectdata As String
selectdata = "SELECT id, avtor FROM avtor"
Dim strConn As String
Dim reader As OleDbDataReader
'Низ за връзка с БД
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strAcessFilePath1 & ";Jet OLEDB:Database Password=;"
OleDbConnection2 = New OleDbConnection(strConn)
OleDbConnection2.Open() 'Отваряне на връзка с БД
OleDbCommand2 = New OleDbCommand(selectdata, OleDbConnection2)
reader = OleDbCommand2.ExecuteReader()
'Цикъл за извличане на всички автори и тяхното добавя към комбинирина списъчна кутия
Dim i As Integer
While reader.Read()
ComboBox1.Items.Add(reader("avtor"))
End While
reader.Close()
OleDbCommand2.Dispose()
OleDbConnection2.Close()
End Sub
modified on Saturday, February 5, 2011 2:15 PM
|
|
|
|
|
Instead of going through a datareader and adding each item to the combobox, fill a datatable with the data, then bind the combobox to it using its DataSource property. Then set the combos DisplayMember (what the user sees in the list) and the ValueMember (what is returned by the combo) properties to the column names in the datatable.
|
|
|
|
|
I have the following sub routine
Private Sub Exceptionquery()
Dim connection As System.Data.SqlClient.SqlConnection
Dim connectionString As String = "Initial Catalog=mdr;Data Source=xxxxx;uid=xxxxx;password=xxxxx"
Dim _sql As String = "SELECT [Exceptions].Employeenumber,[Exceptions].exceptiondate, [Exceptions].starttime, [exceptions].endtime, [Exceptions].code, datediff(minute, starttime, endtime) as duration INTO scratchpad3 " + _
"FROM [Exceptions]" + _
"where [Exceptions].exceptiondate between @payperiodstartdate and payperiodenddate" + _
"GROUP BY [Exceptions].Employeenumber, [Exceptions].Exceptiondate, [Exceptions].starttime, [exceptions].endtime," + _
"[Exceptions].code, [Exceptions].exceptiondate"
connection = New SqlConnection(connectionString)
connection.Open()
Dim _CMD As SqlCommand = New SqlCommand(_sql, connection)
_CMD.Parameters.AddWithValue("@payperiodstartdate", payperiodstartdate)
_CMD.Parameters.AddWithValue("@payperiodenddate", payperiodenddate)
Try
connection.Close()
Catch ex As Exception
connection.Close()
End Try
End Sub
Private Sub exceptionsButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exceptionsButton.Click
Exceptionquery()
Dim connection As System.Data.SqlClient.SqlConnection
Dim adapter As System.Data.SqlClient.SqlDataAdapter = New System.Data.SqlClient.SqlDataAdapter
Dim connectionString As String = "Initial Catalog=mdr;Data Source=xxxxx;uid=xxxxx;password=xxxxx"
Dim ds As New DataSet
Dim _sql As String = "SELECT * from scratchpad3"
connection = New SqlConnection(connectionString)
connection.Open()
Dim _CMD As SqlCommand = New SqlCommand(_sql, connection)
_CMD.Parameters.AddWithValue("@payperiodstartdate", payperiodstartdate)
_CMD.Parameters.AddWithValue("@payperiodenddate", payperiodenddate)
adapter.SelectCommand = _CMD
Try
adapter.Fill(ds)
If ds Is Nothing OrElse ds.Tables.Count = 0 OrElse ds.Tables(0).Rows.Count = 0 Then
MessageBox.Show("There was no data for this time period. Press Ok to continue", "No Data")
connection.Close()
Exceptions.saveButton.Enabled = False
Exceptions.Hide()
Exceptions.Show()
Else
connection.Close()
Exceptions.Show()
End If
Catch ex As Exception
MessageBox.Show(ex.ToString)
connection.Close()
End Try
End Sub
and when I run my code, my subroutine is not being fired off. I know that because I would have a scratchpad3 in my sql database. I know that I'm probably missing something simple, but can anyone tell me what I may be missing?
Thank you
Doug
|
|
|
|
|
At a quick glance you do not execute the command.
Also there's something peculiar about your try block. You catch an exception if it fail on closing the connection, then try to close again. Thus raising another exception?
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
David,
Thank you for pointing that out to me. I changed the code:
Private Sub Exceptionquery()
Dim connection As System.Data.SqlClient.SqlConnection
Dim connectionString As String = "Initial Catalog=mdr;Data Sourcexxxxx;uid=xxxxx;password=xxxxx"
Dim _sql As String = "SELECT [Exceptions].Employeenumber,[Exceptions].exceptiondate, [Exceptions].starttime, [exceptions].endtime, [Exceptions].code, datediff(minute, starttime, endtime) as duration INTO scratchpad3 " + _
"FROM [Exceptions]" + _
"where [Exceptions].exceptiondate between @payperiodstartdate and payperiodenddate" + _
"GROUP BY [Exceptions].Employeenumber, [Exceptions].Exceptiondate, [Exceptions].starttime, [exceptions].endtime," + _
"[Exceptions].code, [Exceptions].exceptiondate"
connection = New SqlConnection(connectionString)
connection.Open()
Dim _CMD As SqlCommand = New SqlCommand(_sql, connection)
_CMD.Parameters.AddWithValue("@payperiodstartdate", payperiodstartdate)
_CMD.Parameters.AddWithValue("@payperiodenddate", payperiodenddate)
connection.Close()
End Sub
and I thought by using this command in my next sub
Exceptionquery()
that I was calling that subroutine.
|
|
|
|
|
Double-click on the "exceptionsButton" in the designer to make sure that it takes you to the specified procedure... VS may have mapped it differently.
|
|
|
|
|
Chandra,
I double checked it and the mapping is correct.
|
|
|
|
|
You are calling the routine but the routine does not execute the SqlCommand.
It just sets it up and provides values for the parameters.
You need and _CMD.ExecuteNonQuery.
BTW using _CMD as a variable name is a bit strange in VB - smacks of C++ with a mix of _ for class level variables and all upper case for constants. But that's a matter of taste.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
PS Meant to say you could wrap the connection stuff in a try...finally...end try block with the close in the finally part. Note no catch - if an exception occurs it will be thrown but the close will still be done.
VB also has the using...end using construct to do this automatically so you don't need the close.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
David,
I have now added this to my code:
_CMD.ExecuteNonQuery()
and I get the error: Incorrect Syntax near the keyword BY.
|
|
|
|
|
So your SQL statement is wrong.
There is a payperiodenddate with a @ missing.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc,
Thank you for noticing that. I have added that and now get the error:
'Must declare the variable for @payperiodenddateGROUP'
|
|
|
|
|
another obvious mistake. Check your SQL statement once more. The error message is very clear. Build up some confidence, and use this site for the hard stuff.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc,
I've verified that the sql query works and that the variables are being both declared and passed to my sub.
|
|
|
|
|
Look at the SQL - it seems to me there are missing spaces before keywords.
As antip always make sure there is one e.g.instead of "GROUP...." type " GROUP..."
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
hi all, im trying to register a ocx control tabctl32 on a windows 7 machines to run vb6.
if i run this command regsvr32 command, it finishes succesfully but if i go on a tab its still returnig the error message that the control is missing. im running as an administrator.
is there anything else i must do.
Regards
|
|
|
|
|
It's probably missing a dependancy. Google for "Dependancy Walker" and use that to open the tabctl32.ocx file and it'll show you the .DLL's it's trying to load.
|
|
|
|
|
Is there some way to stop Windows from hiding a notifyIcon? I'm not afraid of API calls if they're necessary. We're developing a program that will minimize to the tray and it's important that it's icon is always visible (it updates the user by changing the icon as events occur).
I'm sure there's a way, since the Windows icons do it.
Thanks,
Ray Phillips
Jeff Computers
StudyX.com
|
|
|
|
|
NotifyIcons do what you tell them to do, they don't just disappear. In fact you have to add extra code (a call to Dispose) to make sure they disappear when your app exits. If your NI disappears inadvertently it tells me it is being garbage collected, which implies you didn't give it enough scope. Is it a member of your form class? It should not be a local variable!
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
What I meant was, if the user has auto hiding of their notify icons turned on, the icon gets "hidden" (where you have to push the arrow to see the "hidden" icons). We need ours to always be visible. It's not that the icon is disappearing, per se; it's being hidden until the user clicks that arrow.
Sorry for the confusion
-Ray
Jeff Computers
StudyX.com
|
|
|
|