|
1 - it's dead in that it is no longer supported and will not be subject to any updates or service packs
2 - actually, the way this works in VB6 is usually that you write 2 lines of code that call a C++ COM object to do the complex stuff that VB cannot do.
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 Xandip,
I hope the code is useful...
Here is the API declaration :
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _<br />
(ByVal hwnd As Long, ByVal nIndex As Long) As Long<br />
Private Declare Function SetLayeredWindowAttributes Lib "user32" _<br />
(ByVal hwnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long<br />
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _<br />
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long<br />
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)<br />
<br />
Private Const GWL_EXSTYLE = (-20)<br />
Private Const LWA_ALPHA = &H2&<br />
Private Const WS_EX_LAYERED = &H80000
Here is the code where you should use :
Private Sub Command2_Click()<br />
Dim fadeCtr As Integer<br />
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED)<br />
For fadeCtr = 255 To 0 Step -1<br />
Call SetLayeredWindowAttributes(Me.hwnd, 0, fadeCtr, LWA_ALPHA)<br />
DoEvents<br />
Call Sleep(5)<br />
Next<br />
End<br />
End Sub
Please dont use this code in Unload event of form - as you observe, I had used DoEvents in the above function. If this is useful, reply me to answer again.
|
|
|
|
|
Hi
This is my first time to use like this site
I need help in VB coding
I wont to know how I can create a VB program that read a data from a SQL database and then create and insert this data in a text file.
Regards,
jenans
|
|
|
|
|
hi..
in which part do u need help?? taking data from the tables..?? or createing and inserting the data into the textfile??
The name is Sandeep
|
|
|
|
|
Hi
for the data i will use SQL command but i wont to know how i can create and insert into the text file useing what i select in the SQL command
thank you
jenans
|
|
|
|
|
Which bits have you done before ? What code have you written before ?
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,
i am having a problem in viewing CR report using vb.net
I have a button and having this code
Dim ReportForm As New frmCrystalReportForm
Dim TableName(0) As String
Dim QueryString(0) As String
TableName(0) = "Strength"
QueryString(0) = "SELECT * FROM Strength"
ReportForm.MdiParent = frmMain
ReportForm.ViewReport("TEST.rpt", TableName, QueryString, "UnRegister")
ReportForm.Show()
on other form i have this
For I As Integer = 0 To UBound(TableName)
Adapter = l_objDBManager.GetDataAdeptor(QueryString(I))
Adapter.Fill(DataSet, TableName(I))
Next
Report.Load(Application.StartupPath & "/Reports/" & ReportName & "")
Report.SetDataSource(DataSet)
on last line i get this error
"no table found in the report "
K Dastgir
|
|
|
|
|
Hi all
Am having two tables, One is from Access and another from Sql,
Now i have to transact the data's in Sql table to Access table?
Can anyone pls give me some idea ASAP?
Thanks and Regards,,
Dana
|
|
|
|
|
They are seperate databases ( bad design ) You'll have to read the data you need from both and then deal with it in memory ( or you could merge the tables to one DB )
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 )
|
|
|
|
|
Dear Christian,
Can you be brief ?
Dana
|
|
|
|
|
I thought I was ?
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 have read from a text file and got the following result:
""c23","23/05/2007",93.37,94.01,93.22,93.9,6,303767,
"c24","23/05/2007",93.37,94.01,93.22,93.9,6,303767,
"c25","23/05/2007",93.37,94.01,93.22,93.9,6,303786,
"c26","23/05/2007",93.37,94.01,93.22,93.9,6,303787,
i have used
Dim txtData() As String
txtData = strContents.Split(separator)
now i want to loop through txtdata() and save each txtdata(i) to a database table. what is the fastest way to do that knowing that the txt files are really big.
thanks
|
|
|
|
|
The main thing is, you want to create batches of SQL that insert many records at once. That's where your main speed issue 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 )
|
|
|
|
|
how can i keep a thread waiting untill the other one finishes. Say i have
Dim t1 As Thread = New Thread(AddressOf execute)
Dim t2 As Thread = New Thread(AddressOf execute)
t1.start(0)
t2.start(1)
But t2 should not start untill t1 finishes. I have to create say varying threads right now i and only creating two threads but i have to actually create as many as there are records in the database. but at the same they won't be more then 5, but could be less even one. At end of the program(thread) i am updating records in the database and that is the reason i dont want to start the next thread before the finish of the first.
Regards
|
|
|
|
|
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
|
|
|
|
|
|