|
Excel won't quit because your code still has references to object you were using in Excel. You have to explicitly set EVERY object you create in the Excel object model to Nothing, THEN call Quit, otherwise, you'll get the behavior you're seeing.
|
|
|
|
|
i have installed Visual Studio 2005.net and a writing a student management system,however, i need to create a help file,but i have got no clue....where do i begin to create one..
|
|
|
|
|
You can find a pretty tutorial here[^].
|
|
|
|
|
How to make my application shareware
|
|
|
|
|
Give it away
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
|
Hi all,
I'm currently working on an application that opens media files with respect to their file extensions. Images are opened with Microsoft image viewer, video is opened with VLC and mp3 is supposed to be played with windows media player/VLC. So far opening images works fine but when I try to open video or music files i get the error that the opened application is unable to play the file.I'm positive that It has something to do with the spaces on the file location e.g. c:\Program Files\Windows Media Player\something.mp3. Question is how do I make it that the location doesn't incur any spaces or is there another way to open the files in their respective application aside from what I've been doing. I'm using vb6 by the way. Below are the codes I use for my task:
Images
Shell "rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen " & txtscreenshot.Text & "", vbMaximizedFocus
Video
Shell ("C:\Program Files\VideoLAN\VLC\vlc.exe " & txtscreenshot.Text & ""), vbNormalFocus
Music
Shell "C:\Program Files\Windows Media Player\wmplayer.exe " & txtscreenshot.Text & "", vbNormalFocus
Many thanks for all your replies!
|
|
|
|
|
Shell "C:\Program Files\Windows Media Player\wmplayer.exe '" & txtscreenshot.Text & "'", vbNormalFocus
Notice the extra quotes around "txtscreenshot.Text"
tatchung wrote: I'm using vb6
..why? VB.NET is a free download, check out Visual Basic.NET Express
I are troll
|
|
|
|
|
Hi! Thanks for the reply
Eddy Vluggen wrote: Notice the extra quotes around "txtscreenshot.Text" Smile
Yeah I've tried removing that quote but it still doesn't open. So in static "txtscreenshot.Text" generates path names like "C:\Documents and Settings\Computer1\Desktop\New\something.mp3". Shell command recognizes "C:\Documents" as 1 file "and" as another and so on. How can I make it recognize the path name as it is?
Eddy Vluggen wrote: ..why? VB.NET is a free download, check out Visual Basic.NET Express Smile
I know...that's a great deal of my problem
Aim small, miss small
|
|
|
|
|
tatchung wrote: I know...that's a great deal of my problem
What does this mean ? VB6 was always crap, and it's been unsupported for a long time. In VB.NET, you drag a WMP control onto your form and tell it what to play, easy.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Couldn't agree more...i meant using vb6 has been a burden for me. Unfortunately this was a requirement...client haven't, couldn't, wouldn't install a .NET framework for reasons they "wouldn't" disclose. Lotsa "'s"s in there
Aim small, miss small
|
|
|
|
|
Perhaps this one?
Shell "C:\Program Files\Windows Media Player\wmplayer.exe " & Chr(34) & txtscreenshot.Text & Chr34, vbNormalFocus
The above code will put quotation-marks inside the command. That way Windows knows that the path doesn't end after the first space that it sees.
Enjoy[^]
I are troll
|
|
|
|
|
|
In my project while images are loading in to application if i try to close application its not closing, After the completion of loading only it is closing.
Please help me what is the problem. How to close the Application.
|
|
|
|
|
All your images are being loaded by code on the UI thread. It's busy doing that, so there's no way for the UI thread to respond to the Close messages it's getting. You have to move your image loading code to another thread so the UI thread can get the messages to close.
|
|
|
|
|
Hi,
as Dave said, use another thread to load the images.
Don't forget to make it a background thread, i.e. one that does not prevent the app from closing
while it, the thread, still has some work left.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
When I Working on this code it will work properly with minimize status.
Shell("cmd", AppWinStyle.MinimizedFocus)
SendKeys.Send("-")
SendKeys.Send("C:{ENTER}")
SendKeys.Send("DIR{ENTER}")
SendKeys.Send("CD WINDOWS{ENTER}")
But same code with small change in Open the Command Prompt(Hide status).
It open the maximum Process. I checked in Task manager
The Code as Follows.
Shell("cmd", AppWinStyle.Hide)
SendKeys.Send("-")
SendKeys.Send("C:{ENTER}")
SendKeys.Send("DIR{ENTER}")
SendKeys.Send("CD WINDOWS{ENTER}")
plzzz help me.
|
|
|
|
|
This isn't going to work. SendKeys sends keystrokes to the window that has the input focus. Since you launched the CMD prompt hidden, it can't possibly have the input focus. Your app retains the input focus, so you just sent all those keystrokes to your own app, not the CMD prompt you launched.
I have no idea what you're trying to accomplish with this, so I can't tell you what the best solution would be...
|
|
|
|
|
I want take a backup from PostgreSQL from vb.net so I know only one way is command prompt.
When user click on Backup I want take backup. but user not aware of open command prompt.
Sorry My English is poor plzz understand i help me.
|
|
|
|
|
You don't use a command prompt to do this. Use the Process class[^] to launch the same command you would type at that prompt to do it without the prompt.
|
|
|
|
|
I have a DataGridView whos datasource is a bindingSource. I wish to filter the DataGridView via a comboBox, with a button to instigate the whole thing. So I have:
Private sub selectionButton_Click(ByVal sender as system object, byVal e as system.eventargs) handles selectionButton.click
transactionBindingSource.filter = String.format("TranType = '{0}'", itemSelectionComboBox.text)
End Sub
But although tracing the code shows that the filter is correctly selected, my DataGridView does not reflect the filtering selected.
What am I doing wrong please?
|
|
|
|
|
You need to rebind the data source
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Well, I originally thought that too Bob, and tried adding:
transactionDataGridView.DataSource = nothing<br />
transactionDataGridView.DataSource = transactionBindingSource
without success
|
|
|
|
|
I think you have to make the underlying source a view. This is the code from VS help
Private Sub PopulateDataViewAndFilter()
Dim set1 As New DataSet()
' Some xml data to populate the DataSet with.
Dim musicXml As String = " & _
"<music>" & _
"<recording><artist>Coldplay</artist><cd>X & Y</cd></recording>" & _
"<recording><artist>Dave Matthews</artist><cd>Under the Table and Dreaming</cd></recording>" & _
"</music>"
' Read the xml.
Dim reader As New StringReader(musicXml)
set1.ReadXml(reader)
' Get a DataView of the table contained in the dataset.
Dim tables As DataTableCollection = set1.Tables
Dim view1 As New DataView(tables(0))
' Create a DataGridView control and add it to the form.
Dim datagridview1 As New DataGridView()
datagridview1.AutoGenerateColumns = True
Me.Controls.Add(datagridview1)
' Create a BindingSource and set its DataSource property to
' the DataView.
Dim source1 As New BindingSource()
source1.DataSource = view1
' Set the data source for the DataGridView.
datagridview1.DataSource = source1
source1.Filter = "artist = 'Dave Matthews'"
End Sub
(I chopped some of the xml out, so I may have been over enthusiastic and chopped too much!)
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|