|
Thanks for your reply,
and what is the equivalence of the following code in vb.net?
Global Const SQL_SUCCESS = 0
thanks
|
|
|
|
|
Hi,
You can use Public Const SQL_SUCCESS = 0 in VB.Net 2005.
You may put this code in a Module to make it Global to your application.
I hope this helps.
-- modified at 9:02 Thursday 1st November, 2007
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
I am writting a car PC project and have got to the last bit now, the DVD player.
I started using WMP, but it has limited functionality, and I was told to try DirectShow which I didn't understand. SO MSWebDVD was my option, as it seems really easy, apart from one problem I have.
How do you tell MSWebDVD what drive you want to use, it only uses one of my drives. I also want to play movies from my hard disk, but using the code:
MSWebDVD.dvdidrectory = "c:\dvd\video_ts"
only works if there is a DVD in the DVD drive, why is this?
Surely you don't have to have a disk in the DVD drive to enable MSWebDVD to play a DVD folder on the hard disk.
Thanks for any sugestions
Craig
|
|
|
|
|
As far as I can tell, it will only work with DVD volumes, not non-DVD drives. That property sets the current video root of a DVD volume, which can have multiple roots in various directories on the disk.
|
|
|
|
|
But why do you have to have a disk in one of the drives, and with 2 DVD drives, which one is the one that it uses?
DirectShow can be used to play DVDs, can anyone post a small code snippet to get me started, as I don't understand all the filter graph stuff that I was reading on the Microsoft site.
Thanks again
|
|
|
|
|
Hi I am converting a project fromVB6 to vb.net the following line gives an error, Can anyone tell me how to fix it?
Private Sub Form_Load()
Load(AccessForm)
Load(LeaveMsgForm)
The error I get is:
'Public Event Load(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
|
|
|
|
|
s3rro wrote: Private Sub Form_Load()
You have to change its structure like this:
Private Sub Form_Load(sender as Object,e as System.EventArgs) handles MyBase.Load
'Additional Code here
End Sub
Hope it helps !
AliAmjad(MCP)
|
|
|
|
|
|
I am in the final throws of my development for an app so I have started my testing.
One of my scenarios is a the removal of the SQL Native Client driver (Windows XP). After the uninstall, I attempt to run the app and am always presented with this error message, which is expected as the native client was required.
The problem I have is that I did not write in a message box to display this error!
I've searched through the code to find a rouge msgbox but found nothing that would present this error.
Any suggestions to suppress this so I can present something more friendly?
Here's how i create connection, if needed
<br />
<br />
Try<br />
Using connection As New OdbcConnection(ConnectionString)<br />
Dim command As New OdbcCommand(queryString, connection)<br />
connection.Open()<br />
<br />
Dim reader As OdbcDataReader = command.ExecuteReader()<br />
<br />
While reader.Read()<br />
count = reader(0).ToString<br />
End While<br />
<br />
connection.Close()<br />
reader.Close()<br />
End Using<br />
Catch ex As Exception<br />
SQLERROR = True<br />
WriteErrorLog(ex.ToString)<br />
Exit Sub<br />
<br />
End Try<br />
|
|
|
|
|
I think this is an unhandled exception error message try to use this code to handle it:
Dim withevents ap as AppDomain
Private Sub ap_UnhandledException(ByVal sender As Object, ByVal e As System.UnhandledExceptionEventArgs) Handles ap.UnhandledException
'Additional Code
End Sub
hope it helps !
AliAmjad(MCP)
|
|
|
|
|
Exactly what it was! Thanks for letting me know, YTMND!
|
|
|
|
|
??? I wasn't letting u know that Its an unhandled exception but rather tried to give you the solution.
AliAmjad(MCP)
|
|
|
|
|
If you're running on SQL Server, why are you bothering with the ODBC provider?? It's slower and doesn't use any features or optimizations that are specific to using SQL Server.
|
|
|
|
|
Its the only way i know how to do it programmatically...
|
|
|
|
|
It's not very different from what you already have. You're just using the OdbcXXX classes instead of the SqlXXXX set of classes.
|
|
|
|
|
After I finished converting(with visual studio 2005 automatic convertor) a windows application written in vb.net 2002 to vb.net 2005
I recieved few syntax errors that I did not find a sulution for them yet.
The first one is:
The error line - If TypeOf Me.WorkingTable.Column(i).DataType is Boolean Then
The error message- Expression of type 'system.Type' can never be of type 'Boolean'.
finally worked like this:
If Me.WorkingTable.Columns(i).DataType is GetType(Boolean) Then
-- modified at 12:25 Wednesday 31st October, 2007
|
|
|
|
|
Hi all...
I am using the following code: Shell("cmd.exe /c cscript C:\Projects\TEST\FileMonitor.vbs", AppWinStyle.Hide, True, -1) in vb.net
Now... the FileMonitor.vbs section is a vbscript file that contains code to monitor a folder for any new file creations... when it gets the file i can have cmd prompt display the filepath\filename. Is it possible to send this filename\filepath back to vb.net as i run the Shell("cmd.exe /c cscript C:\Projects\TEST\FileMonitor.vbs", AppWinStyle.Hide, True, -1) in vb.net??? I want add this filename into a variable.
Thank you in advance.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Would it be possible to have the VBS write the filepath/filename to a textfile and then just have the VB app read that?
|
|
|
|
|
You are a geniuse... Thank you... i did not think of that
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
I don't know about genius. I was trying to think of the easiest/laziest way possible
Let me know if you run across any more questions.
|
|
|
|
|
There's several ways of doing this. The 2nd easiest is, like the other person said, to have the script write it to a file.
The 3rd easiest is to rewrite your Shell statement into a .NET Framework Process object and use that to redirect the console output to a stream in your code.
The very easiest way to do this would be to scrap the VBScript part entirely and just use the .NET Frameworks FileSystemWatcher class, which will tell you if a file was created in the folder it's watching and what the new filename is.
|
|
|
|
|
Dave
I seem to have read somewhere that FileSystemWatcher has a problem when too many events hit it too quickly. We looked at it 2 yrs ago and decided to do it manually as we had 1000s of file to process.
|
|
|
|
|
True, if you have a bunch of files being created at once.
|
|
|
|
|
Hi guys.
I wanna pass an event to a sub but i dono how to perform it.
Some thing like this:
Private Sub Event_Performer (ByVal arg1 as ????)<br />
RaiseEvent arg1<br />
End Sub
|
|
|
|
|
Would this help?
http://www.codeproject.com/vb/net/StepByStepEventsInVBNET.asp
|
|
|
|