|
http://sean.o4u.com/ap/calendar/calendar.htm[^]
This link above is a Chinese calendar. If you move mouse to any day on the calendar, it will pop up some informations about Chinese.
This page can be downloaded.
I have question that...is there any method to grab the pop up information of this page? I wite a windows form and I hope I can do this.
Can any one help me?
thanks very much.
|
|
|
|
|
No, there isn't. Java isn't rendered using Win32 windows. There are no window handles to grab and, hence, no way to talk to that window to get at it's information. It is, quite literly, a picture that looks like text.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
first of all i am not sure, that this is the right place. Since I did not find any place to place my question regarding an excel macro, I am using this place because the macro is being written using VB.
Consider a case, where I am opening an existing excel file that has filters. If I want to disable/remove/delete the filters, how can I can i do it in the same macro.
Thanks.
Keshav Kamat
India
|
|
|
|
|
|
need help in crystal report.....,
take sample like this....,
In table i have collections of students marks based on studentid....,
i displayed based on the studentid his grandtotal and some other calculations in my form,
Now what are the output i am getting in my form,those things i want to display in crystal report also...,
how to pass thos evalues to my crystal report.....
plz help me...
-- modified at 3:13 Monday 2nd April, 2007
Magi
|
|
|
|
|
create parameters in your crystal reports and pass them values from your form like:
u need the following classes to pass parameters:
Imports CrystalDecisions.crystalreports.engine
Imports CrystalDecisions.reportsource
Imports CrystalDecisions.shared
Imports CrystalDecisions.windows.forms
import them like so...then: in your code
private sub ViewReport()
Dim yourReport As New Report ''create an instance of ur crystal report
'Dim crParameterDiscreteValue As ParameterDiscreteValue
'Dim crParameterFieldDefinitions As ParameterFieldDefinitions
'Dim crParameterFieldLocation As ParameterFieldDefinition
'Dim crParameterValues As ParameterValues
'crParameterFieldDefinitions = rep.DataDefinition.ParameterFields
'crParameterFieldLocation = crParameterFieldDefinitions.Item("ParamenterNameInReport")
'crParameterValues = crParameterFieldLocation.CurrentValues
'crParameterDiscreteValue = NewCrystalDecisions.Shared.ParameterDiscreteValue
'crParameterDiscreteValue.Value = "Your parameter value"
'crParameterValues.Add(crParameterDiscreteValue)
'crParameterFieldLocation.ApplyCurrentValues(crParameterValues)
CrystalReportViewer1.ReportSource = YourReport
end sub
|
|
|
|
|
Hello
I wrote the web page with VB.net (web application) and pages work fine, but back button of the IE browser does not work ? Clicking the back button at my homepage does not open the earlier pages. But in Firefox everything works fine. How do I get project work also in Internet Explorer.
|
|
|
|
|
Hi,
I want to access database which is kept on website database folder.
Anybody could help me please? How to connect this database? What should be
connectionstring for it with detail code? i am developing it in Vb.net 2005.
I am beginer for vb.net.
Kiran Sajanikar
Software Engineer
Pune.
|
|
|
|
|
Hi,
Have a look at THIS[^]
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
Thanx For your immediate reply.
I used that code.
But it is giving error:
The error is:
---------------------------------------------------------
System.Runtime.InteropServices.COMException was unhandled
Error code=-2146819841
Message="Internet Server Error"
Source="Microsoft ADO/RDS"
---------------------------------------------------------
The Error occured while opening the recordset.
Please give me solution for this.
I have used the same code as per that article.
Waiting for your reply
Kiran Sajanikar
Software Engineer
Pune.
|
|
|
|
|
I'm using Visual Basic 4.0 ( Unable to upgrade for reasons, to lengthy to describe )
and I'm having trouble generating sound frequencies. What I'm hoping for is to find
some sort of code solution or tips, advice on this.
A simple VB form, with a text box on it, a command button and the relevant code would be sufficient, thanks!
There are two main things I'd like to be able to do, but I'd be happy to come across solutions for either.
First;
I have an application that generates a series of numbers and then dumps these to a text file. The numbers are hertz fequency values to four decimal places. The text file will generally be comma delimited, in a format similiar to;
432.1298
256.9887
333.99
2445.77
and so on....
A text file may contain as little as eight numeric frequency values or up to three thousand.
What I want to do, is feed this text file of numbers into some sort of music generating tool, convert these numbers into actual musical frequencies and store these files as avi, mpeg, wav files, whatever. If I coudl do this in code without having to use a dedicated musical software program that would be great, but I'm open to other sorts
of solutions too.
I'd like to be able to set the time duration for how long each note in the file is played for, i.e. all note are played for 120 seconds, etc....
A 'nice' thing to do also possibly, would be to choose some sort of instrumental sound, like chimes, flute, etc as the instrument the frequencies are to be played on.
Secondly;
I want to specify exact frequencies for play back, NOT just preset values for specific tones, such as one base freq for a given note, its sharp or flat.
Want to play musical notes but NOT just on PC Speaker.
What I'm hoping to figure out;
-Allow any numeric value for frequency in hertz in the format of 888.88 as input into text box for VB application
-Value of frequency in textbox saved to a variable
-Variable passed to relevant routine or ocx component
-Routine or component plays back specific tone frequency on Sound Card (Not PC Speaker)
-Playback allows volume adjustment
I just need something basic and simple to play with to see if it will work for me, all I need is for the sample code to; Allow any numeric value in the format of 888.88 as input into text box
Value in textbox saved to a variable Variable passed to relevant component. Component plays back specific tone frequency Playback allows volume adjustment
==============
I've received a lot fo different tips and advice on how to do all this but nothing that meets all the requirements, i.e.
Hi,
I've seen your software online and noticed you were using something called MMTools to play sounds with.
I just need something basic and simple to play with to see if it will work for me, all I need is for the sample code to; Allow any numeric value in the format of 888.88 as input into text box
Value in textbox saved to a variable Variable passed to relevant component. Component plays back specific tone frequency Playback allows volume adjustment
I've listed some of the things I've already tried below and described why these won't work, and in summary they are;
BeepAPI
How to Emulate QuickBasic's SOUND Statement in Visual Basic
midiOutShortMsg and related
===============
Problem with MIDI;
Also, I love this method, but after reading all the info it looks like it won't actually let me specify exact frequencies for play back, only preset values for specific tones, such as one base freq for a given note, its sharp or flat.
Knowing how to do this is valuable in and of itself, I now can play back musical notes that sound a lot better than the PC Speaker sounds. Sadly this doesn't solve the problem I have though....
create wav file
--------------------------------------------------------------------------------
The following code works but won't let me specify exact frequencies, only tones
This generates a wave file (no clicks or ticks... just clear sound ):
(It makes a 1 second tone of 440 Hz)
VB Code:
Option Explicit
Private Type tWAVEFORMATEX
wFormatTag As Integer
nChannels As Integer
nSamplesPerSec As Long
nAvgBytesPerSec As Long
nBlockAlign As Integer
wBitsPerSample As Integer
cbSize As Integer
ExtraData(1 To 32) As Byte ' makes the structure 50 bytes long
End Type
Private Type FileHeader
lRiff As Long
lFileSize As Long
lWave As Long
lFormat As Long
lFormatLength As Long
End Type
Private Type WaveFormat
wFormatTag As Integer
nChannels As Integer
nSamplesPerSec As Long
nAvgBytesPerSec As Long
nBlockAlign As Integer
wBitsPerSample As Integer
End Type
Private Type ChunkHeader
lType As Long
lLen As Long
End Type
Private Sub Form_Load()
Dim Buff(0 To 44100) As Integer
GenerateTone 440, Buff, 1
SaveWaveFile "C:\test_Wave.wav", Buff
End Sub
Private Sub GenerateTone(ByVal Frequency As Single, IntBuff() As Integer, Optional Amplitude As Single = 1, Optional SamplesPerSec As Long = 44100, Optional Startpos As Long = 0, Optional Length As Long = -1)
Dim K As Long, V1 As Double
Const PI As Double = 3.14159265358979
V1 = SamplesPerSec / (PI * 2 * Frequency)
If Length = -1 Then Length = UBound(IntBuff) - Startpos
For K = Startpos To Startpos + Length
IntBuff(K) = CInt(Fix(Sin(K / V1) * (32766.5 * Amplitude)))
Next K
End Sub
Private Sub SaveWaveFile(ByVal WaveFileName As String, ByRef Buffer() As Integer, Optional SamplesPerSec As Long = 44100)
Dim WF As tWAVEFORMATEX
WF.wFormatTag = 1 'WAVE_FORMAT_PCM
WF.nChannels = 1
WF.wBitsPerSample = 16
WF.nSamplesPerSec = SamplesPerSec
WF.nBlockAlign = (WF.wBitsPerSample * WF.nChannels) \ 8
WF.nAvgBytesPerSec = WF.nSamplesPerSec * WF.nBlockAlign
Open WaveFileName For Binary Access Write Lock Write As #1
WaveWriteHeader 1, WF
Put #1, , Buffer
WaveWriteHeaderEnd 1
Close #1
End Sub
Private Sub WaveWriteHeader(ByVal OutFileNum As Integer, WaveFmt As tWAVEFORMATEX)
Dim header As FileHeader
Dim HdrFormat As WaveFormat
Dim chunk As ChunkHeader
With header
.lRiff = &H46464952 ' "RIFF"
.lFileSize = 0
.lWave = &H45564157 ' "WAVE"
.lFormat = &H20746D66 ' "fmt "
.lFormatLength = Len(HdrFormat)
End With
With HdrFormat
.wFormatTag = WaveFmt.wFormatTag
.nChannels = WaveFmt.nChannels
.nSamplesPerSec = WaveFmt.nSamplesPerSec
.nAvgBytesPerSec = WaveFmt.nAvgBytesPerSec
.nBlockAlign = WaveFmt.nBlockAlign
.wBitsPerSample = WaveFmt.wBitsPerSample
End With
chunk.lType = &H61746164 ' "data"
chunk.lLen = 0
Put #OutFileNum, 1, header
Put #OutFileNum, , HdrFormat
Put #OutFileNum, , chunk
End Sub
Private Sub WaveWriteHeaderEnd(ByVal OutFileNum As Integer)
Dim header As FileHeader
Dim HdrFormat As WaveFormat
Dim chunk As ChunkHeader
Dim Lng As Long
Lng = LOF(OutFileNum)
Put #OutFileNum, 5, Lng
Lng = LOF(OutFileNum) - (Len(header) + Len(HdrFormat) + Len(chunk))
Put #OutFileNum, Len(header) + Len(HdrFormat) + 5, Lng
End Sub
===========
===========
This code works, but only allows me to generate sounds to the PC Speaker, which sounds horrible!
Option Explicit
Private Declare Function Beep Lib "kernel32.dll" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Command1_Click()
Beep 432.8765, 1000
End Sub
================
=========================
This code works for MIDI, but doesn't let me specify exact frequencies only preset musical tones
==================
midiOutShortMsg
The midiOutShortMsg function sends a short MIDI message to the specified MIDI output device.
VB4-32,5,6
Declare Function midiOutShortMsg Lib "winmm.dll" (ByVal hMidiOut As Long, ByVal dwMsg As Long) As Long
Operating Systems Supported
Requires Windows NT 3.1 or later; Requires Windows 95 or later
=============
PLAY NOTE:
Private Declare Function midiOutClose Lib "winmm.dll" (ByVal hMidiOut As Long) As Long
Private Declare Function midiOutOpen Lib "winmm.dll" (lphMidiOut As Long, ByVal uDeviceID As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Long
Private Declare Function midiOutShortMsg Lib "winmm.dll" (ByVal hMidiOut As Long, ByVal dwMsg As Long) As Long
Dim hMidiOut As Long
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@allapi.net
Dim T As Long
midiOutOpen hMidiOut, 0, 0, 0, 0
midiOutShortMsg hMidiOut, 6567325
T = Timer
Do: DoEvents: Loop Until Timer > T + 4
midiOutClose hMidiOut
End Sub
----------------------
http://allapi.mentalis.org/apilist/midiOutShortMsg.shtml
===============================
Again, this only works for the PC Speaker
A better beep
If you aren't satisfied with the standard Beep command (who is?) you can use the Beep API function instead, that lets you control both the frequency (in Hertz) and the duration (in milliseconds) of the beep. Note that you need an aliased Declare to avoid a name conflict with the VB command:
Private Declare Function BeepAPI Lib "kernel32" Alias "Beep" (ByVal dwFrequency _
As Long, ByVal dwMilliseconds As Long) As Long
The standard Beep command has a frequency of 440 Hertz and a duration of 200 milliseconds (more or less), so you can produce a short beep with a higher pitch with the following statement:
BeepAPI 600, 100
And of course you can even produce more complex sounds, when a simple beep won't suffice:
Dim i As Long
For i = 100 To 1000 Step 10
BeepAPI i, 20
Next
|
|
|
|
|
Everything you've provided examples for will only work with the PC speaker.
You'll get the greatest flexibility with DirectSound which is part of the DirectX SDK. The problem is you're using VB4. You REALLY have to upgrade. You've got to be the last person on earth using it. Let me demonstrate how far behind you are:
VB4 came out in October 1996, yes, over 10 years ago!
VB5 came out in April of 1997.
VB6 came out in October 1998.
Service Pack 6(!) for Visual Basic 6 came out in 2004.
VB.NET 2002 came out in, well, February 2002
VB.NET 2003 ...
and currently VB.NET 2005, which is about 1 year and half old itself.
VB4 simply has no support with any SDK's anymore. Any example code we give would most likely have to be rewritten because the language has advanced so far beyond what you're using.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
DOUGT - Sound Working But...
--------------------------------------------------------------------------------
I needed to be able to create wave sound files with VB 4.0. I received some code that would allow this to be done, but it only
worked for VB 6.0. With some helpful insight from DougT I was able to get it to work in VB 4.0. Am including this code below.
Dougs' "theory" turned out to be right on the nose.
I took his suggestions and made the changes and 'voila' out came a baked tone cake! Got a wave file that sounded just fine. File size about 87 kb.
So it looks like this will work just fine as he said right from the beginning.
It looks like there is still a hitch though. While the sound quality and ability to adjust it is indeed there, I'm still left needing to produce a series of these tones in one wave file. It won't actually work for me unless I can do this, I'll just end up with a whole bunch of really small wave files of one tone each, if you get my drift...
So the scenario is still, I have a simple text file that contains a variable number of hertz frequencies as numeric decimals, i.e.
234.7856 Hertz
432.56
256.01
542.1711
329.8888
etc.....
In some text files there may be only a dozen notes, but in some text files there could be hundreds.
What I intend to do is feed the text file of notes into the routine provided and use the routine to output to a wave file. So I can figure out how to set up my loops (I'm pretty sure), but the 'chunking' stuff is way over my head. Sounds stupid, but its simply the truth. I can grasp what the more complex parts of the code is doing concept wise, but it makes my head swim a little bit. I tried to figure out how to loop this on my own, thought I could loop the generate function, but it blew the stack. Also I could not join the buffs together to make a sequence of tones before writing them all to file.
So I'm stuck, ironically, with the solution in sight. I can see that the basic premise is sound, but I do not understand how to make it produce a wave file consisting of a series of tones from the input text file. I don't need to be spoon fed, but I also don't grok how to make a series of tones in the wave file..... Am I making sense?
==========
create wav file
Originally Posted by DougT
Both model statemets are perfectly OK in VB6 so I would guess that VB4 does not support Optional arguments. You can test the theory by making a few simple changes. (To make it work in VB 4.0)
Model statements:
Private Sub GenerateTone(ByVal Frequency As Single, _
IntBuff() As Integer, _
Amplitude As Single, _
SamplesPerSec As Long , _
Startpos As Long , Length As Long)
Private Sub SaveWaveFile(ByVal WaveFileName As String, _
ByRef Buffer() As Integer, _
SamplesPerSec As Long )
and change the calling statements to include all the arguments. eg
Code:
GenerateTone 261.62, Buff, 1, 44100&, 0&, -1&
SaveWaveFile "C:\test_Wave.wav", Buff, 44100&
(The '&' after some of the values is to force them to be of type Long)
--------------------------------------------------------------------------------
The following is the code for VB 6.0
The following code lets me specify exact frequencies
This generates a wave file (no clicks or ticks... just clear sound )
(It makes a 1 second tone of 440 Hz)
VB Code
Option Explicit
Private Type tWAVEFORMATEX
wFormatTag As Integer
nChannels As Integer
nSamplesPerSec As Long
nAvgBytesPerSec As Long
nBlockAlign As Integer
wBitsPerSample As Integer
cbSize As Integer
ExtraData(1 To 32) As Byte ' makes the structure 50 bytes long
End Type
Private Type FileHeader
lRiff As Long
lFileSize As Long
lWave As Long
lFormat As Long
lFormatLength As Long
End Type
Private Type WaveFormat
wFormatTag As Integer
nChannels As Integer
nSamplesPerSec As Long
nAvgBytesPerSec As Long
nBlockAlign As Integer
wBitsPerSample As Integer
End Type
Private Type ChunkHeader
lType As Long
lLen As Long
End Type
Private Sub Form_Load()
Dim Buff(0 To 44100) As Integer
GenerateTone 440, Buff, 1
SaveWaveFile "C\test_Wave.wav", Buff
End Sub
Private Sub GenerateTone(ByVal Frequency As Single, IntBuff() As Integer, Optional Amplitude As Single = 1, Optional SamplesPerSec As Long = 44100, Optional Startpos As Long = 0, Optional Length As Long = -1)
Dim K As Long, V1 As Double
Const PI As Double = 3.14159265358979
V1 = SamplesPerSec / (PI * 2 * Frequency)
If Length = -1 Then Length = UBound(IntBuff) - Startpos
For K = Startpos To Startpos + Length
IntBuff(K) = CInt(Fix(Sin(K / V1) * (32766.5 * Amplitude)))
Next K
End Sub
Private Sub SaveWaveFile(ByVal WaveFileName As String, ByRef Buffer() As Integer, Optional SamplesPerSec As Long = 44100)
Dim WF As tWAVEFORMATEX
WF.wFormatTag = 1 'WAVE_FORMAT_PCM
WF.nChannels = 1
WF.wBitsPerSample = 16
WF.nSamplesPerSec = SamplesPerSec
WF.nBlockAlign = (WF.wBitsPerSample * WF.nChannels) \ 8
WF.nAvgBytesPerSec = WF.nSamplesPerSec * WF.nBlockAlign
Open WaveFileName For Binary Access Write Lock Write As #1
WaveWriteHeader 1, WF
Put #1, , Buffer
WaveWriteHeaderEnd 1
Close #1
End Sub
Private Sub WaveWriteHeader(ByVal OutFileNum As Integer, WaveFmt As tWAVEFORMATEX)
Dim header As FileHeader
Dim HdrFormat As WaveFormat
Dim chunk As ChunkHeader
With header
.lRiff = &H46464952 ' "RIFF"
.lFileSize = 0
.lWave = &H45564157 ' "WAVE"
.lFormat = &H20746D66 ' "fmt "
.lFormatLength = Len(HdrFormat)
End With
With HdrFormat
.wFormatTag = WaveFmt.wFormatTag
.nChannels = WaveFmt.nChannels
.nSamplesPerSec = WaveFmt.nSamplesPerSec
.nAvgBytesPerSec = WaveFmt.nAvgBytesPerSec
.nBlockAlign = WaveFmt.nBlockAlign
.wBitsPerSample = WaveFmt.wBitsPerSample
End With
chunk.lType = &H61746164 ' "data"
chunk.lLen = 0
Put #OutFileNum, 1, header
Put #OutFileNum, , HdrFormat
Put #OutFileNum, , chunk
End Sub
Private Sub WaveWriteHeaderEnd(ByVal OutFileNum As Integer)
Dim header As FileHeader
Dim HdrFormat As WaveFormat
Dim chunk As ChunkHeader
Dim Lng As Long
Lng = LOF(OutFileNum)
Put #OutFileNum, 5, Lng
Lng = LOF(OutFileNum) - (Len(header) + Len(HdrFormat) + Len(chunk))
Put #OutFileNum, Len(header) + Len(HdrFormat) + 5, Lng
End Sub
|
|
|
|
|
Hi,
I need to print Receipt(Bill) in VB.Net application. I created that Receipt using crystal report wizard and I put report name as myBill.rpt. My application has "Print" button. I need to print that receipt directly after clicking that "Print" button without using Crystal Report Viewer tool.
Is it possible? What are the coding I'll add to that "Print" button. Any one can help me, pls send me some sample code ?
Regards
Kusal
|
|
|
|
|
Kusal wrote: Is it possible? What are the coding I'll add to that "Print" button. Any one can help me, pls send me some sample code ?
Off course ,possible..
try this code in Print button's Click event
Dim myRpt as myBill<br />
myRpt .Refresh()<br />
myRpt .PrintOptions.PrinterName = "Path of the printer"<br />
myRpt .PrintOptions.PaperSource = "Printer tray"<br />
myRpt .PrintToPrinter(1, False, 1, 1)
hope it will work
Tirtha
Miles to go before I sleep
|
|
|
|
|
Dear Tirtha
Many Thanks
Regards
Kusal
|
|
|
|
|
can some one help me with a problem Im having with generating soudn frequencies?
|
|
|
|
|
Do you want to describe the problem or should we just guess?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I use vb.net to create project new website and it run completely in my client browser but when I move that project to my server and run in intranet the error is "Unrecognized configuration section 'connectionStrings'" in web.config (Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300 ) I don't know how to correct it. May I must install the other version of .NET Framework or not?
Thank you for your suggestion.
Kitty
|
|
|
|
|
If your website is in .net 2.0 you need to have the 2.0 .net framework loaded and you need to set the properties of the site to be the .net 2.0 framework. Right click the web site select properties then go to the asp.net tab and make sure the 2.0 framework is selected.
Hope that helps.
Ben
|
|
|
|
|
No.You must create your ConnectionString on the server
|
|
|
|
|
I've tried to create website on server,but it still error. Yesterday I installed dot net framework version 2 on my server and restart the server but I observe that in the footnote of the error page it still show "Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300 " not show version 2 (version 2 is already show in admin page in control panel) Is it the cause of this errors?
Kitty
|
|
|
|
|
Now. I can manage my old trouble, the error of connecttionstring is passed and the footer show ->--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 .....ready but the next problem is <authentication mode="Windows"> I don,t know how to correct it.
Kitty
|
|
|
|
|
Heya, looking for some help with a tic tac toe program.
easy stuff for someone that knows how to program.
If u beeleive u can help me, reply and i will add you to my msn for details thanks.
|
|
|
|
|
I recommend doing your own homework. It tends to make it easier for you to do future homework, if you've built the foundation that your teacher intended.
If you do need to ask for homework help, try to make if of the sort where you ask a specific question and post code, not of the sort where you describe your homework broadly and show no sign of having given it any thought yourself.
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 )
|
|
|
|
|