|
You're going to have to consult the documentation on the library that you're using. It should give you the signature of the method that you have to build so you can wire up the event handler with AddHandler.
|
|
|
|
|
Thanks for your prompt response. Actually there was no documentation on the library for now. The Moderator said I should make sure I attached to event:
AddHandler client.evDeliverSm, AddressOf client_evDeliverSm
The source code already have this;
Private Sub client_evDeliverSm(ByVal sender As Object, ByVal data As DeliverSm)
Dim messageText As String = SmppClient.GetMessageText(data.UserDataPdu.ShortMessage, data.DataCoding)
MessageBox.Show("Source: " + data.SourceAddr + "Text: " + messageText + "Coding: " + data.DataCoding.ToString())
End Sub
I just need a sample illustration. I can send sms but cannot receive.
An sample code to attached to the event will be appreciated.
Thank you.
Thayhor
|
|
|
|
|
OK, so in an appropriate place you make the AddHandler call to wire up the event. Where you put this depends on your design and code.
You already have the pieces, you just need to place them.
If there is only a specific time where it's legal for your code to receive messages, put the AddHandler in the code that sets up the receive.
|
|
|
|
|
Thank you.
I don't have any specify time to receive, I can receive from my smsc anytime. Can I leave it the way it was? or I should add a timer event;
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
AddHandler client.evDeliverSm, AddressOf client_evDeliverSm
End Sub
And when connected to smsc then enable timer1. Interval is 1sec i.e 1000.
I just want to perfect everything on my own side b/4 contacting my smsc provider which claims that shortcode "1234" have been added for me to receive sms.
Thank you.
Thayhor
|
|
|
|
|
No timers. You only need to setup the handler once, probably in Form.Load when your app starts.
|
|
|
|
|
hi,
i want to bing the checkedlistbox control with datasource,(with a table that in which i am fetching data from database.)
i am using the following code.
checkedlistbox.datasource = table
checkedlistbox.diplaymember = columnname
This is working fine.
after the execution of this code, the screen flickers and datarowview (a text) displays in the first row of checklistbox control and disappears after the control populates completely. I was using the loops to populate the control, but that was quite slow process, now the execution is faster, but the screen flickers a lot.
Please help
|
|
|
|
|
So, all you're doing is setting the DataSource and DisplayMember properties and the form is flickering constantly after that??
|
|
|
|
|
Yes, after writing this code, the checkedlistbox first row creates problem, in the first row, it shows a text dataroweview
and afterwards this text disappears and the control gets populated with the data.
Please suggest anything..
|
|
|
|
|
I am trying to play music in my application using command
My.Computer.Audio.Play (complete path , AudioPlayMode.Background).
The file I am trying to use is a wavefile(.wmv). However when the command is executed an exception is thrown saying The specified file is not PCM type wavefile. Please help regarding what i am supposed to do.
I am using Visual Studio 2008.
modified on Wednesday, May 6, 2009 2:40 PM
|
|
|
|
|
It's quite plain. The file you're trying to play is not in the correct format. Just because the file extension is WMV doesn't mean that the audio is encoded the same as every other WMV. The audio in each file, no matter what the extension, is encoded using different codecs, compressor/decompressors. But, there is a standard format called PCM (Pulse Coded Modulation) that is kind of like the Text file of the audio world. It's audio that is not compressed at all. This is the format that the Audio.Play method supports. It cannot play audio that is compressed. You have to use some kind of tool to create a new file with the audio uncompressed.
|
|
|
|
|
Any possible different method I can use the sound-file in my application.
Also guide me as how i can come to know the compression/decompression technique.
Thank You.
|
|
|
|
|
Ishaan Karnik wrote: Any possible different method I can use the sound-file in my application.
You can use a Windows Media Player component. Drop one from the ToolBox onto your form and you can use that to play the files.
Ishaan Karnik wrote: Also guide me as how i can come to know the compression/decompression technique.
It's not technique you use in your code. Google for "what is a codec" for more information.
|
|
|
|
|
Sir, I couldnot find a Media Player Component in my toolbox. Please guide me for the same.
Thank You
|
|
|
|
|
Then add it. Right-click the ToolBox, then click on Choose Items... In the dialog that comes up, click on the COM tab, scroll down the list until you find Windows Media Player and check the box next to it. Click on OK, and you're done.
|
|
|
|
|
...normaly a WMV file contains video and audio. My.Computer.Audio.Play supports only uncompressed .WAV Audio files. Convert your file to .WAV and try again.
Regards: Didi
|
|
|
|
|
Hi,
I have a problem to understand the perforance advantage
of Buffer.BlockCopy.
If I only copy the array one time the Buffer.BlockCopy-method is much more faster
then the Array.Copy-method, but if I copy the array in a for next loop the
perforance advantage is lost.
Here is the example-code:
Dim t As Long
Dim a(50000000) As Integer
Dim b(50000000) As Integer
Dim x As Integer = Buffer.ByteLength(a) - 1
Dim y As Integer = a.Length
'Copy with Array.Copy Method 1
t = Now.Ticks
Array.Copy(a, d, y)
ListBox1.Items.Add(Now.Ticks - t)
'Copy with Buffer.BlockCopy Method 1
t = Now.Ticks
Buffer.BlockCopy(a, 0, b, 0, x)
ListBox1.Items.Add(Now.Ticks - t)
'Copy with Array.Copy Method 100
t = Now.Ticks
For i As Integer = 0 To 5
Array.Copy(a, b, y)
Next
ListBox1.Items.Add(Now.Ticks - t)
'Copy with Buffer.BlockCopy Method 100
t = Now.Ticks
For i As Integer = 0 To 5
Buffer.BlockCopy(a, 0, b, 0, x)
Next
ListBox1.Items.Add(Now.Ticks - t)
thanks in advance
andre
|
|
|
|
|
Hi,
I doubt your measurements are correct. Here is my suggestion:
put ALL the code in one big for loop, and make it run five times; then check whether the iterations all show the same behavior. I trust they will not, there typically are lots of reasons why a first iteration inside a process behaves differently.
If you want more reactions, show all the time measurement results.
|
|
|
|
|
|
Hi,
I have never used Buffer.BlockCopy myself, so I can't answer from experience.
As your link explains, the difference is in some checks that get performed; now that would be relevant only on small copy jobs, it will be relatively insignificant on the 50MB you experimented with. IMO it won't make much difference at all. The main difference is a semantic one: copying array elements versus copying bytes.
Your app's performance will depend much more on other things such as debug versus release build.
|
|
|
|
|
I am new to vb 2008. i have four textboxes. and the data is displayed in a listbox in four columns. but the columns are not formatted. like the data shows like this.
Order1 23 3 23.2
new order1 25 3 54
Order4 54 4 52.3
as you see the columns are not formatted. kindly advise me how to format columns in listbox so that data is aligned in a proper format.
|
|
|
|
|
Use a fixed-width font, such as "Courier New"
I are troll
|
|
|
|
|
thanks for your advice.
I tried that font of COURIER NEW. but the result is same. the columns data is not formatted. kindly give some other idea. or is there any option in listbox properties to align the data in columns.
|
|
|
|
|
Using a different font won't change the formatting. You can add spaces to the text so that it aligns nicely. Not a good solution, but rather a quick-fix.
A better solution is provided here[^], based on the MultiColumn property, along with a sample. This puts items in multiple columns, but those can't be considered as rows - it's a list of multiple items that continues on the second column once the first column runs out of rows.
Lastly, you could consider exchanging the ListBox for a ListView . That one does columns
I are troll
|
|
|
|
|
so there is no option for alignment of data in columns in listbox.
to add spaces is difficult. because the data is being transferred from tables and there is text of different in each row and column. like:
Coca Cola Normal
Sprite
Fanta
Pepsi
Coca Cola Zero
so it is not possible to add spaces.
can anybody have any idea to fix the problem of aligning the data in columns in listbox in vb2008
|
|
|
|
|
ListBox supports a MultiColumn[^] property that sounds like it might do what you need.
|
|
|
|