Solved

Main Volume OCX

Posted on 2004-08-27
10
487 Views
Last Modified: 2008-01-09



Well u r right that i want to control  to adjust the volume of microphone.
I read the artcile which  have given in
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21084780.html#11912087

I jsut want to change the slider bar in the  Volume bar same  as  in sndvol32.exe .
I need the slider control similar to that only.

Pls if possible  help me out. I really need it urgenlty
0
Comment
Question by:rajender123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
10 Comments
 
LVL 4

Expert Comment

by:Daniellus83
ID: 11915001
okay its coming up!
0
 
LVL 4

Expert Comment

by:Daniellus83
ID: 11916381
Hello, rajender123.... I kept my word... after some programming:

http://www.danieltrommel.com/download/SetPlaybackVolume.zip

I hope this is what you want. I've included a sample project because the Slider (like in sndvol32.exe) isn't VERY difficult to make in VB6 but easy in VB.NET. I also changed the OCX so you can call a sub "SetVolumeMain()" and "SetVolumeMic" ...

Succes!!
0
 

Author Comment

by:rajender123
ID: 11919401
Hi  daniell

well thanks  for  your help. I tried using the s ame OCX with two slider controls but i ma not able to run since as soon as i complie and run the program  and then i try to move the sldier it is showing me this error:-

"Object reference not set to an instance of an object."


can u tell me wht i have to do to use this OCX.

although i have added the ocx propelry in my code.Pls do let me know

0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 4

Expert Comment

by:Daniellus83
ID: 11920677
Hello;

>> First of all:
 
   Did you try to build the FULL ORIGINAL project (without changing!) from the website above? Did it work?

>> The problem you asked about in your last post;

   Is it about the original project OR did you tried to make your own by copying the OCX to your own directory?
0
 
LVL 4

Accepted Solution

by:
Daniellus83 earned 500 total points
ID: 11920700
To use the SetVolumePlayback2.ocx in a new (your own) project; you have to do this:

---------------------------------------------------------------------------------------------------------------

1) Start your VB.NET 2003,...

2) Create a new project

3) Select on the TOOLBOX (left on you .net 2003 interface) the section "My User Controls..."

4) Press now with your Right-mouse-button on the empty gray area on the toolbox and...

5) choose Add/Remove Items

6) In the new opened window choose the SECOND tabsheet "COM Components"

7) Press the button "Browse" and open the OCX file  "SetVolumePlayback2.ocx"

8) Now you should see a new icon appear on you Toolbox > My User Control > "Volume" (could be named different!)

9) Add this component to your Form

Now have I implemented nothing graphical on the OCX thing.... you just have to name it:

10) Select the added component and name it "MyVolume" (or so)

11) Now in your code you will be able to call these functions:

            MyVolume.SetVolumMain( value )

      and
           
            MyVolume.SetVolumMic( value )

     where 'value' is supposed to be a value between 0 and 65536
---------------------------------------------------------------------------------------------------------------

Get it? You just have to name (!) the added OCX component, and than you can set both volumes via that name!

Daniël
0
 

Author Comment

by:rajender123
ID: 12237097
Dear daneil

Its agian me for asking some more details  about the volume...
It is working fine.. but  each and very time i load my form the slider moves to the initial value.. although the microphone volume in the task bar has chnaged.

How the volume control be set to that value which we have chnaged last time..
why is it moved each and every time to zero..
can u pls help me out
0
 
LVL 4

Expert Comment

by:Daniellus83
ID: 12243020
First off all; I feel a little disappointed it had to come to a forced points accept!!


I think I understand what you mean...

The 'problem' is that the Volume slide is ONLY made to SET the volume. If you had ASK for it, I had included a GETVOLUME method wich would retrieve the current volume and set the Volumebar so...

So it is set to zero because it doesn't retrieve (would be the GETVOLUME method...) the current Volume, it is set to the initial value of the bar itself; zero.

Daniël
0
 
LVL 4

Expert Comment

by:Daniellus83
ID: 12243044
You could solve the problem by storing the last volume settings of your application in a configuration file (on exit?), and when you open the program again, you would read the config-file again and set the volume.

ONE BIG advantage of this is: when the Volume is changed by another application, you would restore always the last (correct) volume setting!

Daniël
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question