|
If they are .EXE's, you have little to no control over them. You'll have to get with the manufacturer of the .EXE's to see if there is any documentation on an API that they expose, if at all.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dude. You see the thing is i can get the 2 video's that are in exe format to play one after the other using the shell command in the load form. But is there any code a can add that makes it just either reload the form at a certain time or once it has finished playing the second video it goes back to the first one??????
|
|
|
|
|
You're not going to reload the form. You'll cause yourself too may problems.
All you can do is set a timer for how long the video plays. When the timer tick event fires, launch the video .EXE again.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dude i will give that i shot thanks again for the help
|
|
|
|
|
Forget about shell.
Use the Process library functions and you can call the EXE in a loop, the process will return when the exe terminates.
You create a process and use the WaitForExit function to wait until it terminates.
Example code:
-------------------------------------------------------------------------------------------
Dim strVideoFilePath As String = "<your fully qualified path to video .exe file>"
Dim siPlay As ProcessStartInfo = New ProcessStartInfo(strVideoPath)
Dim pPlay As Process = Process.Start(siPlay)
pPlay.WaitForExit()
-------------------------------------------------------------------------------------------
You need to add code to allow the loop to be terminated. You can do that by setting a timeout period in the wait function. You check the exit code in a loop to see if the timeout occurred because the exe ended or because the timer function timed out. If the timer expired, the exe is still running, so you go back into the wait state. The reason you do this in a loop is so you can throw a DoEvents in there to allow the user to set a "stop" flag by hitting a button. The application does not respond while it is in a wait state so you ned to exit often and pump the message loop to receive a button click.
Read the MSDN or SDK docs for more info on the Process class members and you can figure it out.
Robert
|
|
|
|
|
I need help in this subject please
when i work on my development machine i use a fixed connection string which belongs to my sql server
i need to know how to use dynamic connection string for deployment , what scenario dose you use to handle such subject , i just need head lines to go throw
can i use DSN in the odbc of windows or i do make a setup form to let user choose server from it another solution i think in is the DSN file file.udl please advice
Thanks
|
|
|
|
|
even i need help to have my deployed package itself create database or if possible create database as per users input how is this done plz help
ty
|
|
|
|
|
hi there my friend,
how about you do like this, it works in many ways
Make a config.ini in you app root directory
Config.ini
--------------
servername=MYSERVER {this is your servername}
databasename=MYDATABASE {this is your database name}
...
--------------
then retrieve the server name using FilesyStemObject(this might be a long
approach but it works and expandable)
so your connection string will look like this.
Put this in you form
-----------------------
'retrieve the string value in config.ini
'...
'After that put that value in a variable
strDBase = (retrieve database name)
strServer = (retrieve server name)
MYCONNECTION = "Provider=SQLOLEDB;User ID=sa;nitial Catalog=" & strDBase & ";Data Source=" & strServer
-----------------------
Beyond the Basic; Underground
ideas(Legal, but not commercially available due to the fact that, we use to develop software which we can earn more income not for the sake of personal satisfaction). Anything about IT.
|
|
|
|
|
developing user interface form that relies on playing sound files [.wav] after certain user input [users will be predominantly handicapped -blind]. How do I implement, invoke, insert or whatever the appropriate controls or code behind controls to allow me to do this? thanks so much for your replies: i.e user presses button, the code "on-click" then plays the audio file while other actions are being set...
teddy
|
|
|
|
|
There is a good c# article on this http://www.codeproject.com/cs/media/windowssoundevents.asp[^]
I recently took that article and created a VB.Net version. You will need a PlaySound class like this:
Imports System
Imports System.Runtime.InteropServices
Imports System.IO
Public Class WPlaySound
<DllImport("winmm.dll", EntryPoint:="PlaySound", CharSet:=CharSet.Auto)> _
Private Shared Function PlaySound(ByVal pszSound As String, _
ByVal hmod As Integer, ByVal falgs As Integer) As Integer
End Function
<DllImport("winmm.dll", EntryPoint:="PlaySound", CharSet:=CharSet.Auto)> _
Private Shared Function PlaySound(ByVal data() As Byte, _
ByVal hmod As Integer, ByVal falgs As Integer) As Integer
End Function
Public Enum SND
SND_SYNC = 0
SND_ASYNC = 1
SND_NODEFAULT = 2
SND_MEMORY = 4
SND_LOOP = 8
SND_NOSTOP = 16
SND_NOWAIT = 8192
SND_ALIAS = 65536
SND_ALIAS_ID = 1114112
SND_FILENAME = 131072
SND_RESOURCE = 262148
SND_PURGE = 64
SND_APPLICATION = 128
End Enum
Public Shared Sub PlaySound(ByVal fileName As String)
If File.Exists(fileName) Then
PlaySound(fileName, 0, CType((SND.SND_ASYNC Or SND.SND_FILENAME Or SND.SND_NOWAIT), Integer))
End If
End Sub
Public Shared Sub PlaySoundResource(ByVal resourceName As String)
Dim WavStrm As IO.Stream = _
Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( _
GetType(WPlaySound), resourceName)
If WavStrm Is Nothing Then Return
'Load the .wav from the stream into the byte array
Dim ClickSound(CType(WavStrm.Length, Integer) + 1) As Byte
WavStrm.Read(ClickSound, 0, CType(WavStrm.Length, Integer) + 1)
PlaySound(ClickSound, 0, CType((SND.SND_ASYNC Or SND.SND_MEMORY Or SND.SND_NOWAIT), Integer))
End Sub
Public Shared Sub PlaySoundEvent(ByVal EventName As String)
PlaySound(EventName, 0, _
CType((SND.SND_ASYNC Or SND.SND_ALIAS Or SND.SND_NOWAIT Or SND.SND_NODEFAULT), Integer))
End Sub
End Class
Using this class you can call the PlaySound method in your Click event of each button to play the appropriate WAV file. I have embeded the WAV as a resource and used the PlaySoundResource method.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
Hi guys,
I've been trying to figure a way to store and work with a set of data, and be able to save it to a file. As I'm quite new to vb.net, i'm looking for something that's not too complex.
I need to store data for multiple FTP sites, with information like servername, username, password, port. At the moment, i have a structure called ftpsites, with those said items. Then an array of type ftpsites.
I'm then sequentially on a line by line basis storing this information, and retrieving this info, looping through, on each loop adding 6 to an index. For instance,
<br />
For i = 0 to lines.count -1<br />
ftpsites(i).servername = my_data_array(i + 1)<br />
ftpsites(i).username = my_data_array(i + 2)<br />
.......<br />
i +=5<br />
Next<br />
Could anybody please suggest a better way of doing this, including storing the data? I am hoping to do all of this in a class, along with my other procedures.
Many thanks
Craig
|
|
|
|
|
The best way would be for you to use a class that uses a collection of objects but that may be too complex for you.
If you are happy with the way you are storing (in memory) the data at the moment (array of ftp sites) then I'd recommend you write a "saveasfile" function that basically loops through the array and writes its contents to a file using the streamwriter class.
You can then write the opposite function (read from a file) using the streamreader class.
Streamreader and streamwriter use plain text files so you will have to give some thought as to how you will organize the file itself (one line for all the info relating to each ftp site or multiple lines).
A little fancier than coming up with your own text file organization would be to use an ini file. There is a very easy to use ini file reader/writer for .Net freely available from http://www.mentalis.org/ . Yes, Ini files are old school but this reader will give you results within an hour or two without having to learn much.
|
|
|
|
|
Hi, just wondering if anybody knows how do download from multi hosts using the vb.net sockets.
I have created a class DLL and can download from one host. If i want to connect and download from another host I must disconnect first and reconnect to the new one. I want to get around the so I can download from multi hosts at the same time. My class DLL has events and I have no idea how to have it connect to multi hosts, so I can download multi files at the same time.
I have expermented with with object arrays and threading, but have had no luck as im fairly new to vb.net. I would appeaciate any insite into this.
Thanks in advance..
|
|
|
|
|
You would have to encapsulte your code into it's own class, then you can launch as many of copies of this class as you want, simultaneously.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I am trying to install .Net Service Pack 1 .
My machine is having Windows Xp , .Net Framework 1.0 installed.
And when i run SP1 exe "NDP1.1sp1-KB867460-X86.exe" it gives me this error message,
"The upgrade patch cananot be installed by windows installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch."
I am not able to install it,Help needed,what could be the reason??
|
|
|
|
|
It looks like your trying to install SP1 for the .NET Framework 1.1, not 1.0.
The .NET Framework 1.1 is not a patch over the top of 1.0. They are two distinctly different version of the .NET Framework and have their own service pack versions.
The current service pack for the .NET Framework 1.0 is SP3 and can be found here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i am creating pictureboxes with images on a panel at runtime & now i want to copy those pictureboxes to another panel in vb.net,how to do it.pls tell me the code for copying not moving them.thanks in advance
parag
|
|
|
|
|
Guys, I have this project that i've deployed and then i needed to do some changes to the code..no matter what, the code keeps ignoring any changes i've done and act as the deployed code!
HELP
|
|
|
|
|
How have you deployed your project?
What do you mean by code changes? You deploy compiled assemblies where you cannot change the code...
|
|
|
|
|
what i meant is, after the deployment, any changes to the original source code won't apply!
|
|
|
|
|
|
Well that's the weird thing, ANY changes to the original source won't apply..i re-compiled so many times but it keeps acting as the old code would!
It's like a fix code!
I don't get any compilation errors tho't
|
|
|
|
|
Are you sure you are using the correct binaries? I mean, the new assemblies do actually have the current date/time on them? The only thing I can think of is that you are getting the assemblies from an old directory, or you are looking in Debug or Release, when it is compiling to the other.
Have you tried deleting the bin directories in your project then getting it to rebuild the whole solution? That way at least you know that the files in the bin directories are new.
If it isn't any of the above, then I am not sure what it could be because I have never come across anything like this.
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
also make sure that after u have compiled ur project u rightclick on ur setup project and select rebuild option.
if problem still exist try to remove the setup project from the projectlist and then add a new setup project.
Hope it will work.
Computer... Programming... What That
|
|
|
|
|
how to find the key ascii values of the buttons preseed in vb.net? THANKS
THANKS
|
|
|
|