|
yup dear, you got my point, any solution?
Sumit Domyan
Software Developer
ANALEC INFOTECH
|
|
|
|
|
Hey, this is my first time, so I'll try to be as clear as possible
What I am trying to do, is control the system device audio levels in my VB app. Basically I want to create my own "mixer board" very similar to the supplied "Volume Control" program supplied with windows. On first glance, it seems relatively easy, however I am running into some problems.
Here is what I have so far...
Public Declare Function auxSetVolume Lib "winmm.dll" (ByVal uDeviceID As Integer, ByVal dwVolume As Integer) As Integer
Public Declare Function auxGetVolume Lib "winmm.dll" (ByVal uDeviceID As Integer, ByRef lpdwVolume As Integer) As Integer
Public Declare Function auxGetNumDevs Lib "winmm.dll" () As Integer etc.
the problem is, whenever I call auxGetNumDevs(), it returns 0, which means there are no sound cards present (which is NOT the case), or an error occured. I have no idea why it keeps returning 0.
Maybe this isn't the best way to go about controlling the system audio, so I am open to any suggestions
Thanks in advance
|
|
|
|
|
Since auxGetNumDevs doesn't return an error value, there's no way to tell why the call is failing. auxGetNumDevs doesn't exactly return the number of sound cards, but returns the number of controllable auxillary audio output devices. This might not be supported by your sound card.
I think your just using the wrong interface to get at the sound cards' mixers. Try using mixerGetNumDevs instead. The docs start here[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you sooo much, I've asked questions about this on many forums, and have had no good responses, this seems to be EXACTLY what I need, I'll keep working on it and probably be back with more questions
Thanks again Dave!
-Eric
|
|
|
|
|
Hi All,
Please help me with this problem, say in VB I have two variables of string type
dim x as string
dim y as string
x="y"
y="dd"
Is there any way by which I can change the value of y through x, like in some languages u can use
&x="fff"
which actually changes the value of y thru x.
Is there any thing like that in VB, Please help
|
|
|
|
|
Your talking about pointers and VB/VB.NET doesn't support them. That's reserved for C++ and C#.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi! Im trying to convert this stuff and im new to his vb.net Can somebody help me to convet this in .NET.. thanks for your help guyz..
<br />
If pPayload.Length > 0 Then<br />
ReDim pPayload.Data(pPayload.Length - 1)<br />
For i = 1 To pPayload.Length<br />
pPayload.Data(i - 1) = AscB(Mid(txtPayLoadData.Text, i, 1))<br />
Next i<br />
End If<br />
<br />
' kernel32 Windows API<br />
CopyMemory(pPayloadBuffer(0), VarPtr(pPayload.Length), 4)<br />
If pPayload.Length > 0 Then<br />
CopyMemory(pPayloadBuffer(4), VarPtr(pPayload.Data(0)), <br />
pPayload.Length)<br />
End If<br />
|
|
|
|
|
Another question to make (and so soon). How can i make a label on another form (lets say Form1) to change from a Form2. In vb6 we used to say Form1.lblTest.caption = "Test"
in VB.NET how is it possible???
So far i have:
==============================
Dim frmRead As New Form2
Form2.Show
==============================
In Form2 when i click a button i want to change a label text in form1.
=====================================================================
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
form1.lblTest.Text = txtTestBox.text
=====================================================================
the above command produces an error.
Any help? Please?
Trying to find the way
|
|
|
|
|
|
V_A_S_S wrote:
Dim frmRead As New Form2
Form2.Show
First of all, I hope that's a typo, cause it should be:
frmRead.Show
You have to set the access modifier for lblTest to either Public or Friend to be able to access it from another form.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
Yes it was a typo. A messaage comes up saying:
"Reference to a non-shared member requires an object reference"
The modifier of the text box in form1 is Friend.
ARGG!! Why VB.NET is so crapy???!!?!
if i type form1.lblTest.text = "Test" then there is a blue wiggly line under it.
Trying to find the way
|
|
|
|
|
what's the name of your form1? is it really form1?
Unlike vb6, VB.Net does not automatically create a variable for a form, you have to manually create it.
Try setting the text without referencing the form.
lblTest.text = "Test"
See if that works
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
No still doesn't work.... yes i keep my forms form1, form2 etc for now. I am new in VB.NET.
Thanks for all the help though.
Trying to find the way
|
|
|
|
|
Hmmm, that's strange.
Are you sure that there's a line:
Friend WithEvents lblTest as Label
in your form1?
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
I found a article with the follwing code:
Public Class Form1
Inherits System.Windows.Forms.Form
Dim F2 As New Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowButton.Click
F2.ShowDialog(Me) ' Show Form2
Me.UserLabel.Text = "Current User : " & Form2.NuNameTB.Text
End Sub
======================================================================
Public Class Form2
Inherits System.Windows.Forms.Form
Public Shared NuNameTB As TextBox
Private Sub CloseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseButton.Click
' Assign this form's TextBox to the Object Variable
NuNameTB = UsersName
' Now close the form
Me.Close()
End Sub
================================================================
it seems to be working ok. Thank you for all the support Nick and Colin. VB.NET is a bit annoying sometimes. Now if i could get help about the paper size collection.
Thanks again.
Trying to find the way
|
|
|
|
|
Actually, it's not a problem with VB.NET. You would have the exact same problem with C# too.
This is beause your not following proper OOP coding practices to get what you want done.
Try reading Working with Multiple Forms in Visual Basic .NET: Upgrading to .NET[^] on MSDN for a better explanation of moving data between forms.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a problem with enumerating a list box with the available papers sizes of a printer. I want to be able when i click on the printer combobox the listbox to be able to fill with the available paper sizes. So far it seems that it's able to find only the default paper sizes.
I have post this question again earlier on but it was lost in all the new entries. I am really lost of what to do . Any help will be much appriciated. Thank you in advance...
Here is the code so far. cmbPrinter = combobox of available printers.
lstPaper = listbox of available paper sizes.
============================================================================
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objPrint As New System.Drawing.Printing.PrinterSettings
Dim strItem As String
Dim strPrinters As String
For Each strItem In objPrint.InstalledPrinters
cmbPrinter.Items.Add(strPrinters & strItem)
Next
End Sub
Private Sub cmbPrinter_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbPrinter.SelectedIndexChanged
' Add list of supported paper sizes found on the printer.
Dim searchstring As String
Dim SearchChar As String
Dim MyPos As Integer
Dim i As Integer
Dim pkSize As System.Drawing.Printing.PaperSize = Nothing
SearchChar = "A4"
For Each pkSize In printDoc.PrinterSettings.PaperSizes
lstPaper.Items.Add(pkSize.PaperName)
Next
For i = 0 To lstPaper.Items.Count - 1
lstPaper.SelectedIndex = i
searchstring = lstPaper.SelectedItem()
MyPos = InStr(searchstring, SearchChar)
If MyPos = 0 Then
lstPaper.Items.Remove(0)
Else
paperToUse = searchstring
End If
Next
updateDisplay()
End Sub
I can fill the combobox of the printers and the list box of the papers. BUT when i click on another printer the program DOSEN'T give me the list of the paper sizes on the new selected printer. It's like it stucks in the paper sizes of the default printer...
HEEEEEEEEEEEEEEEEEEEEEEEEEELP!!!
Trying to find the way
|
|
|
|
|
Hi all,
I want to build an application that can get emails from my yahoo, hotmail and gmail accounts and display them formatted in a text box. Please guide me where to start for this project i can do the second part but have no idea how to start working on the first part as how the application will login at hotmail or yahoo and how'll it get the emails.
Thanks in advance.
Regards,
Umar Inam
UI
|
|
|
|
|
Do hotmail and yahoo expose their mail functionality to this sort of program ? I'd guess the best place to find out is hotmail and yahoo.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I am not sure that they do. but there should be work arround as we can check the mails through browser. now just it has to communicate with my app or something like that any one please??
Regards,
Umar Inam
UI
|
|
|
|
|
If they don't expose that functionality, then you need to control IE and get it to click on each new email, grab the text from it, and copy to your app. Sounds like a lot of work for little reward to me, and as soon as they change the pages, your app won't work anymore.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Yep thats wat i thought and thats why i am lookking for a work arround.
UI
|
|
|
|
|
I am working on a project where the DataLayer and Business Objects will be written in C# and the UI will be VB.Net and or ASP.Net.
For testing I have created simple c# class and collection class.
Both objects are under the same namespace
I compiled them using the build option in the IDE.
In VB.Net I have referenced the c# dll and used imports.
The intellisense work and I am able to see the namespace and my objects.
When I use the following code:
Dim oWidgets As New Widgets ' the collection
oWidgets can not be used (intellisense does not work)
and there is syntax error line under it. When I hover over it i get 'declaration expected'
HC
|
|
|
|
|
hagridcracker wrote:
and the UI will be VB.Net and or ASP.Net.
Why would you do such a thing ?
ASP.NET requires you use VB.NET or C#, it's not a different thing altogether.
hagridcracker wrote:
oWidgets can not be used (intellisense does not work)
Does it compile/run ? Maybe intellisense is all that is broken.
hagridcracker wrote:
and there is syntax error line under it. When I hover over it i get 'declaration expected'
Does Widgets have a public default constructor ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Why do such a thing...
I've jsut started coding in both VB.Net and C#.. just nver used one with the other yet. I've been coding in vb 3-6 since 93' so I am very familiar with OOP..
Short Rant:
Also if you are lucky enough to get a gig with Microsoft or a contract they usually (as in 99.9% of the time) require all coding to be in c# whether it is a stand alone app/part of a solution or if you are doing asp.net coding...
there are more short term vb.net gigs than c# and c# pays better, but doing the ui in vb is much easier faster.
-- Nope it will not compile
-- if you mean the Wiget() method of the Widget Class yes.
JG
|
|
|
|