|
I need the user of my program to select a computer name from the computers attached to his network, but have no idea how to get started to make a list of the computers.
This has to be done in VB6 (or Delphi)
Once that is done I can readily handle all the rest of the code I need.
Laurie
|
|
|
|
|
Try to check the information from here.[^]
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
In VB6 you can find a lot of info regarding the network using the Active DS Type Library (Domains, Groups, Users and Computers).
First set a reference to the above library
then declare your object variables
Dim objIADsContainer As IADsContainer
Dim objIADsDomain As IADsDomain
Dim objIADSComputer As IADsComputer
If you need to find a list of the domains first use the following code:
Set objIADsContainer = GetObject("WinNT:")
For Each objIADsDomain In objIADsContainer
Debug.Print objIADsDomain.Name
Next
If you only have 1 domain and want to find all computers on that use the following:
Set objIADsContainer = GetObject("WinNT://" & "Your_Domain_Name")
objIADsContainer.Filter = Array("Computer")
For Each objIADSComputer In objIADsContainer
Debug.Print objIADSComputer.Name
Next
All this assumes you have a windows NT network. You should be able to get the basic info above on any NT network. If you have a well designed Active Directory structure you can find a lot more than just the computer name.
Hope its helpful
Jonathan
|
|
|
|
|
how can i calculate total levels in a treeview?
Sumit Domyan
Software Developer
ANALEC INFOTECH
|
|
|
|
|
What do you mean by "total levels"?
Are you talking about how many levels deep the deepest child node is from the tree root?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
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
|
|
|
|