|
Use the BackgroundWorker class, and when it fires the event to say that the first thread has finished, start the second one. Why would you start a thread you don't want to run ? Better yet, just have the one thread perform both actions, that's how it will work in the end
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
HI! All
I need to write a VB application that eads the database content and writes into a comma seperated .csv file. Please tell me how to do it?
Thanks and regards,
Virendra
|
|
|
|
|
hi, how can i import a CrystalReportViewer in VB.Net 2005 just like the CrystalReportViewer of VB.Net 2003? because i can only use ReportViewer in VB.Net 2005 not CrystalReportViewer. thanks
Don't block the drive way of all the newbies in programming.
|
|
|
|
|
which version of vb.net are u using? express does not have Crystal Reports
|
|
|
|
|
i'm using express. so it means that i cannot import a crystalreportviewer in express?
Don't block the drive way of all the newbies in programming.
|
|
|
|
|
Hi all... is there any way to merge two or more cell in datagridview of .NET 2005??
Thank's
|
|
|
|
|
I am interested in using multiple threads to increase the speed for a real time image processing application(vb .net 2005). Currently I am using a bitmap and processing the data directly through the bitmap e.g., currentpicture.GetPixel(x, y).GetBrightness. The other option is to implement an array and store the values, process and then return. I am wondering if multiple threads can be used to access an object or an array and hence speed up my application. I am not a cs major and far from an expert on threading, so I may be way off on this one. I have yet to read any articles on this approach so I am guessing there must be a catch with this method. Any links or ideas would be great. Thanks in advance for any help.
Erik
|
|
|
|
|
First of all - multiple threads will not speed up your app, they will just keep the UI responsive
Second - you can read my C# image processing articles, but VB cannot do image processing as fast, as it does not support pointers. Your best bet is to do image processing through a library written in C#.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Greetings,
I have been working on this problem for about a day now and it is driving me mad (I hope that what I am typing will make sense, as I have not slept much in the last few days). Basically I am creating a graphical bolt on application for a console application written in the old C. Its purpose will be to start / stop / monitor about 20 hidden console windows from a clean GUI (the console application being StreamRipper from sourceforge).
The problem is that I cannot monitor the applications running for the output refreshes itself in a single line continuously due to a kb download counter updating itself, so anytime I try to redirect console output, I lock up (or infinite loop rather) for these programs do not stop until terminated by the user. I am not going to input anything to these console, once I start them with certain arguments, they run until I use their process object to .kill() them.
The "single line refresh problem" I believe to be this line of code in streamripper.c
<br />
case RM_STATUS_RIPPING:<br />
if (m_curinfo.track_count < m_opt.dropcount) {<br />
strcpy(status_str, "skipping... ");<br />
} else {<br />
strcpy(status_str, "ripping... ");<br />
}<br />
format_byte_size(filesize_str, m_curinfo.filesize);<br />
fprintf(stderr, "[%14s] %.50s [%7s]\r",<br />
status_str,<br />
m_curinfo.filename,<br />
filesize_str);<br />
break;
Bah, why could he not just use /n instead of \r, anyways, recompiling this is out of the question, for I need it as a pure bolt on without modifying streamripper.
I then tried to monitor the folders being created by streamripper, which worked, but I also play to have a changing layout for the directories (IE station name may not always be in the root), so this approach (while it worked great under certain conditions), proved to be futile when putting together the longterm goal.
Anyways, my next course of action seeing how redirecting the console output of this application is impossible would be to get the information I need directly from the server that I am streaming from (this is a streamripper bolt on I am writing, btw).
Example would be http://64.62.194.11:8095/
What I need to do
I would like to grab only the Stream Title from that page, I tried to use curl for this, but curl tries to grab the streaming .mp3 as well (and its self timeout can only be set to 1 second (integer), so the textfile that would normally be created by grabbing the headers is now full of random garbage).
So what I am thinking is:
1. VB.NET gets the header files and I pull in the station name
2. process object gets assigned a name that I pulled from the header file in a listbox
3. Process starts and is controlled in various ways from the listbox
Now another trick would be getting the song that is currently ripping, but I will save that turmoil until after I figure this out.
I then tried this:
http://msdn2.microsoft.com/en-us/library/system.net.webheadercollection.add(VS.71).aspx
but, I cannot seem to get it to work either (something that has to do with printHeaders, but I maybe missing a library for that (like having to put system.net.* on several of those other statements).
I also tried this (but these methods do not seem to want to work right with the shoutcast server no matter what I try):
http://developer.yahoo.com/dotnet/howto-rest_vb.html
Anyways, I am all out of ideas, I have probably worked on this for about 10 hours over the past day (I get obsessed with problems I cannot solve).
As part of my desperation, I started to translate the code here into VB in order to get the station information:
http://www.codeproject.com/cs/media/SHOUTcastRipper.asp
Module Module1<br />
<br />
Sub Main()<br />
Dim server As String = "http://64.62.194.11:8095"<br />
Dim serverPath As String = "/"<br />
<br />
Dim destPath As String = "C:\\" ' destination path for saved songs<br />
<br />
Dim request As Net.HttpWebRequest = Nothing ' web request<br />
Dim response As Net.HttpWebResponse = Nothing ' web response<br />
<br />
Dim metaInt As Integer = 0 ' blocksize of mp3 data<br />
Dim count As Integer = 0 'byte counter<br />
Dim metadataLength As Integer = 0 ' length of metadata header<br />
<br />
'metadata header that contains the actual songtitle<br />
Dim metadataHeader As String = ""<br />
'last metadata header, to compare with <br />
'new header and find next song<br />
Dim oldMetadataHeader As String = Nothing<br />
<br />
' receive buffer<br />
Dim buffer(512) As Byte<br />
For counter As Integer = 0 To 512<br />
buffer(counter) = New Byte<br />
Next<br />
<br />
'input stream on the webrequest<br />
Dim socketStream As System.IO.Stream = Nothing<br />
<br />
'output stream on the destination file<br />
Dim byteOut As System.IO.Stream = Nothing<br />
<br />
<br />
' create request<br />
request = System.Net.HttpWebRequest.Create(server)<br />
<br />
'clear old request header and build <br />
'own header to activate Icy-metadata<br />
request.Headers.Clear()<br />
request.Headers.Add("GET", serverPath + " HTTP/1.0")<br />
'needed to receive metadata informations<br />
request.Headers.Add("Icy-MetaData", "1")<br />
request.UserAgent = "WinampMPEG/5.09"<br />
<br />
'execute request<br />
Try<br />
response = request.GetResponse()<br />
<br />
Catch ex As Exception<br />
Console.WriteLine(ex.Message)<br />
Console.ReadLine()<br />
Return<br />
End Try<br />
<br />
<br />
metaInt = Convert.ToInt32(response.GetResponseHeader("icy-metaint"))<br />
<br />
<br />
End Sub<br />
<br />
End Module
But, I believe this to be a dead end (so I have not translated the next section as the server returns an invalid protocol error), I also do not know C#, so this translation was all guess work from my knowledge of C++ and VB (which most of my VB knowledge comes from VB6)
Any help would be appreciated, I am using VB.NET 2005
|
|
|
|
|
Is it possible to monitor other application´s window to see if it changed in order to capture it?
mcfonseca
|
|
|
|
|
|
I want to rar a File to A certain Directory , But I an not getting it right.Please suggest me any command to do that
Develop2Program & Program2Develop
|
|
|
|
|
Zip is built in to .NET 2.0. Rar is not, you'd need to build a command line that runs a command line app to do it, or find a library.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have been given another project to build another front end for a dos app...
The company I work for has this program that reads in a data file that represents a 3d cube image in sections, and outputs some results. I have been tasked to write an app to stream line the process of building these 3d cube images but am not sure best way round it.
Example of text file I need to create:
House
3,3,3
0,15
0,12
0,20
a Brick
b Door
c window
d roof
e chimney
f ground
g
h
i
j
k
l
m
n
o
p
q
r
s
t House
ffffffffffffffffffffff
faaaaaaaaaaaaaaaaaaaaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faffffffffffffffffffaf
faaaaaaaaaaaaaaaaaaaaf
ffffffffffffffffffffff
The lines are as follows:
1. The internal name of the file
3. Cube size
5. Dimensions, numbers of cubes high
6. Dimensions, numbers of cubes wide
7. Dimensions, numbers of cubes long
9 - 26. letters representing certain ites of the house
27. Another title of the file.
29 - 45. Creates a segmentised make up of the house at the first cube size, so in this case a 3ft section through the house
47 - ???. Further segements through the house until all segments required are built.
Now initial thoughts are to have an initial screen get all the inputs with regards the sizes, char code representations, etc and then have another screen build a grid resenting the extenet of the house layout and allow the user to select a letter/colour to represent each seperate item in the section as required, but my question is what is the best way to do this???
As I have posted before I am new to prgramming so any help would be greatfully received.
regards,
Matt
|
|
|
|
|
matt_hirst wrote: I am new to prgramming
How new is new ? That phrase does not sit well with the task at hand, I am afraid. Do you need to display the cube, or just generate this file ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
New, is very new... Have just returned to programming, about 6 months ago, after a long - 6 year - break. Am trying to get the people I work for to send me on a few training courses, highly unlikely though.
I would like to have a representation of the model created with the layers in the top left hand side of the screen, if this is possible? Generating the first part of the file is straightforward I am just struggling with what to do to create the grid and then transfer that to the file.
regards,
Matt
|
|
|
|
|
To generate a 3D model will require DirectX or WPF. Not remotely trivial.
The way I'd do anything like this, is to create a base entity class and build derived classes for the different objects that need to be defined, and have a virtual base method that writes that entities information to the file. However, I'm not sure how sane this file format is, to lend itself to that, I tend to use XML. Is the file format fixed ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Must admit you're losing me already...
Keeping it simple for me, this is probaly totaly the wrong thing to do but... what if I created a grid by generating a grid of panes, then by clicking each pane it flips a colour/character on the layer being created, an array is built up of the layers and then output to the file???
regards,
Matt
|
|
|
|
|
It's a 3D representation, right ? So you need to be able to build layers ? Your big problem will be representing the layers in 3D. If you don't need to do this, you can probalby just build a collection of 2D arrays and have each one represent a layer. Then you could well just show a grid, but I'm not sure how usable that will be.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hay every one,
I want to delete temporary internet files programatically with vb.net, plz tell me how to implement code,
if possible give me code to do this not just hint because i m new to vb.net
looking for someone brave to made me thankfull to him
|
|
|
|
|
Christian and I have given you all the information you need - don't repost questions if you're obviously not prepared to do any work on your own - it wont make you any friends here
You should see the 'how to get an answer to your question' topic at the top of the forum
If you want to be a programmer then you have to be prepared to read and experiment - by us doing it all for you, it teaches you nothing - you will have a false sense of what you can achieve, and be worthless in a programming position.
|
|
|
|
|
What Garth said. Sure, this time you started with the right question, but you've got the answer, you just need to apply it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Or just forget the code altogether and solve the problem in about 15 seconds by doing what Guffa told you to do.
|
|
|
|
|
how can i delete a specific group of files or full listings from within specific directory with vb.net application
|
|
|
|
|
I do appreciate if some one help me with sample code
|
|
|
|
|