Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Main Volume OCX

Posted on 2004-08-27
10
Medium Priority
?
492 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

636 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