|
You wouldnt happen to know what it is called once inside the controls property would you? Because I can't seem to find one that will work. If anyone knows where i could find out how to do this or if you know how to do this please let me know.
Again, Thanks
|
|
|
|
|
Here's my code:
mainMedia = mainPlayer.newMedia(info.FilePath);<br />
mainPlayer.stretchToFit = true;<br />
mainPlayer.settings.autoStart = false;<br />
mainPlayer.currentMedia = mainMedia;<br />
mainPlayer.settings.volume = RegistryFacade.PlayerOptions.TrackVolume;<br />
<br />
mainPlayer.BringToFront(); <br />
<br />
mainPlayer.Ctlcontrols.play();
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hey, thank you very much. I'm not sure how i managed to miss that section lol. I really Appreciate your time and help.
|
|
|
|
|
hihi,
I am creating a datagrid and i wanted to display all the values that i retrieve from the database. I was able to do this. However, i need to add a checkbox into one of the columns. This checkbox is not binded or link to the database, it is use for my own reference. I was wondering how can i create this checkbox into the datagrid without any mappingname. Hope someone can help me with this. Thank You..
Kekin
vb.net Programmer
|
|
|
|
|
I assume you are wokring with DataTables/DataSets. If yes, you will have to add a column to the DaatTable where you want the extra column in the grid to appear. I think there is no other way.
|
|
|
|
|
Hi there,
I am still relatively new to vb programming, and after migrating to vb.net, I have come across a problem.
I am wanting to store the details of around 15 FTP servers. The plan is to populate a treeview with the server's names, and show the corresponding hostnames, port, username, password and notes in the textboxes (similar to FlasFXPs interface).
However, I would have previously used the "Type" object, and then set up an array based on that type. Example :
=========================
Private Type FTPSitesType
ServerName As String
Hostname As String
Username As String
Password As String
Port as Long
Dim my_FTPSites(1 To 15) As FTPSitesType.
========================
I am trying to do the same thing within a class, but I can't seem to get any results, nor think of a google search query that will actually return something helpful.
Any help would be much appreciated!
Mason
|
|
|
|
|
|
Thank you for your very neutral arguments on this topic
|
|
|
|
|
Something like this should address your question:
Public Structure FtpSite
Public Hostname As String
Public Username As String
Public Password As String
Public Port As Integer
End Structure
Public Class UsesFtpSite
Public Sub MyMethod()
Dim al As New ArrayList
Dim fs As New FtpSite
fs.Hostname = "ftp.mysite.com"
fs.Port = 21
fs.Username = "user"
fs.Password = "password"
al.Add(fs)
End Sub
End Class
Although, it is also possible to use a class in this situation as well. Another alternative might be to create a DataTable in memory.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Thanks for that. I can see exactly how that should work, but I don't think I am putting in the right statemets in the relevant places. Here is my layout:
I have a main form, frmMain.vb... I then have a class, ftpClass.vb, which contains all the main operations.
I then have another form, frmSiteManager.vb, and I want to add another class, SiteManager.vb.
Could anybody tell me where I should be placing this code, and the correct method for accessing it's features? Everything I have tried so far, such as Dim my_sites as FTPSites ont he sitemanager form, always gived me a "Decleration expected".
Sorry to be any bother I can't find any decent tutorials for storing data.
|
|
|
|
|
Right... the Dim statement is limited to declaring variables within Functions or Subs, any other declarations in your classes or modules must be marked Public, Private or Protected. Does that help?
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Hi
Is there any body help me to solve my problem ?
I read a HTML file from web unsing MSWinSock and I need show some strings contaned in it that is UNICODE (such as "س") in a textbox, but i can't convert it to original carachters readable for human.
Please help me
if you can help me please send your solution to my mail box : mirzaei@gmail.com
Thank You
|
|
|
|
|
Hi
Is there any body help me to solve my problem ?
I read a HTML file from web unsing MSWinSock and I need show some strings contaned in it that is UNICODE (such as "س") in a textbox, but i can't convert it to original carachters readable for human.
Please help me
if you can help me please send your solution to my mail box : mirzaei@gmail.com
Thank You
|
|
|
|
|
How do I get the real serial number of the hard drive and mother board in VB6
|
|
|
|
|
The GetVolumeInformation API will return a hard drive serial number.
Don't know about motherboard.
Robert
|
|
|
|
|
You'll have to use WMI (Windows Management Instrumentation) to get this information. Be warned though, not all manufacturers supply providers that will server up this information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I have an Access form that I created an Unbound OLE object frame on it. The OLE object was configured (by the Wizard) to accept Excel and I want to use it as a portal to import Excel worksheets into my Access DB (drag/drop filename and voila, my OLE object has an Excel sheet!)
My question is, once that the Excel worksheet is in the OLE object, how can use VBA code to go through the Excel object and extract field values and populate a given Access table?
Here are some defintions that I started to try but did not work:
<br />
Private Function ReadExcelObject()<br />
Dim bRetStatus As Boolean<br />
<br />
Dim oXLapp As Excel.Application<br />
Dim oXLwsh As Excel.Worksheet<br />
Dim oXLrng As Excel.Range<br />
bRetStatus = True<br />
<br />
'OLEUnboundExcel is an Unbounded Object Frame<br />
' Set oXLapp = OLEUnboundExcel.Application 'this produces a type-mismatch<br />
' Set oXLwsh = oXLapp.Worksheets(1)<br />
'OLEUnboundExcel<br />
'Set oXLapp = GetObject(, OLEUnboundExcel)<br />
' Set oXLapp = OLEUnboundExcel.Object<br />
' Set oXLwsh = oXLapp.Worksheets(1)<br />
<br />
'what do I do to make this work???<br />
<br />
ReadExcelObject = bRetStatus<br />
<br />
End Function
Thanks in advance!
Johnny
|
|
|
|
|
Oh, my configuration is as follows:
Access 2000
Excel 2000
VB 6.0, ver 8435
Win2000
Johnny
|
|
|
|
|
I'm trying to retrieve a value in the registry that is a Qword (64bit value). Anybody have any idea how I can accomplish this with .NET v 1.0/1.1? I've tried retrieveing it as binary and as a string with no prevail. I have also tried using RegOpenKey/RegQueryValue API with no luck (even retrieving normal registry values).
So basically anyone know how to accomplist this natively in .NET? I have tried several different declarations for the API and no luck, am I doing something wrong (.NET permissions possibly)?
I have a .reg file to add a qword to the registry if needed.
Thanks,
-Jerry
|
|
|
|
|
Can't be done with the .NET BCL. You have to use the Win32 API functions to read/write a REG_QWORD value. I don't have any example code to show you because, frankly, hardly anyone ever uses the obscure little value type. I'll see if I can whip something up when I get home.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sample code:
Const KEY_QUERY_VALUE = &H1&
Const KEY_SET_VALUE = &H2&
Const KEY_CREATE_SUB_KEY = &H4&
Const KEY_ENUMERATE_SUB_KEYS = &H8&
Const KEY_NOTIFY = &H10&
Const KEY_CREATE_LINK = &H20&
Const READ_CONTROL = &H20000
Const WRITE_DAC = &H40000
Const WRITE_OWNER = &H80000
Const SYNCHRONIZE = &H100000
Const STANDARD_RIGHTS_REQUIRED = &HF0000
Const STANDARD_RIGHTS_READ = READ_CONTROL
Const STANDARD_RIGHTS_WRITE = READ_CONTROL
Const STANDARD_RIGHTS_EXECUTE = READ_CONTROL
Const KEY_READ = STANDARD_RIGHTS_READ Or KEY_QUERY_VALUE Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY
Const KEY_WRITE = STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY
Const KEY_EXECUTE = KEY_READ
Const REG_NONE = 0
Const REG_SZ = 1
Const REG_EXPAND_SZ = 2
Const REG_BINARY = 3
Const REG_DWORD = 4
Const REG_DWORD_LITTLE_ENDIAN = 4
Const REG_DWORD_BIG_ENDIAN = 5
Const REG_LINK = 6
Const REG_MULTI_SZ = 7
Const REG_RESOURCE_LIST = 8
Const REG_FULL_RESOURCE_DESCRIPTOR = 9
Const REG_RESOURCE_REQUIREMENTS_LIST = 10
Const REG_QWORD = 11
Const REG_QWORD_LITTLE_ENDIAN = 11
Public Enum RegKeys As Integer
HKEY_CLASSES_ROOT = &H80000000
HKEY_CURRENT_USER = &H80000001
HKEY_LOCAL_MACHINE = &H80000002
HKEY_USERS = &H80000003
HKEY_PERFORMANCE_DATA = &H80000004
HKEY_CURRENT_CONFIG = &H80000005
HKEY_DYN_DATA = &H80000006
End Enum
Declare Auto Function RegOpenKeyEx Lib "advapi32" ( _
ByVal hKey As Integer, _
ByVal subKey As String, _
ByVal options As Integer, _
ByVal sam As Integer, _
ByRef phkResult As Integer) As Integer
Declare Auto Function RegSetValueExQWORD Lib "advapi32" Alias "RegSetValueEx" ( _
ByVal hKey As Integer, _
ByVal lpValueName As String, _
ByVal Reserved As Integer, _
ByVal dwType As Integer, _
ByRef lpData As System.UInt64, _
ByVal cbData As Integer) As Integer
Declare Auto Function RegQueryValueExQWORD Lib "advapi32" Alias "RegQueryValueEx" ( _
ByVal hKey As Integer, _
ByVal lpValueName As String, _
ByVal dwReserved As Integer, _
ByRef dwType As Integer, _
ByRef lpData As System.UInt64, _
ByRef cbData As Integer) As Integer
Declare Auto Function RegCloseKey Lib "advapi32" (ByVal hKey As Integer) As Integer
'
' This code writes a REG_QWORD value:
'
Dim hKey As Integer
Dim rc As Integer
rc = RegOpenKeyEx(RegKeys.HKEY_LOCAL_MACHINE, "SOFTWARE", 0, KEY_READ Or KEY_WRITE, hKey)
Debug.Assert(rc = 0, "RegOpenKey Failed with error " & rc.ToString())
rc = RegSetValueExQWORD(hKey, "TestValue", 0, REG_QWORD, UInt64.Parse("5842365264844985"), 8)
Debug.Assert(rc = 0, "RegSetValueEx Failed with error " & rc.ToString())
rc = RegCloseKey(hKey)
'
' This code reads a REG_QWORD value:
'
Dim hKey As Integer
Dim rc As Integer
Dim data As UInt64
Dim dataType As Integer
Dim dataSize As Integer = 8
rc = RegOpenKeyEx(RegKeys.HKEY_LOCAL_MACHINE, "SOFTWARE", 0, KEY_READ Or KEY_WRITE, hKey)
Debug.Assert(rc = 0, "RegOpenKey Failed with error " & rc.ToString())
rc = RegQueryValueExQWORD(hKey, "TestValue", 0, dataType, data, dataSize)
Debug.Assert(rc = 0, "RegGetValue Failed with error " & rc.ToString())
rc = RegCloseKey(hKey)
MsgBox("The value (" & dataType.ToString() & ", size: " & dataSize.ToString() & ") returned is: " & data.ToString(), MsgBoxStyle.Information, "QWORD Return Value")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks a lot Dave!
Yeah I got it to work with the API's. However I declared the data as a String in RegQueryValueEx and man did it take some jumping through hoops in order to convert it to a long. I tried the declaration with a long (int64) but I forgot the value is unsigned. Doh! Needless to say your code is a bit more efficient.
For some reason the declaration I had wasn't working. After letting it sit for a bit and going back to it (and a reboot) the code worked fine. Since I'm relatively new to .NET, I thought it might be some type of framework security feature. It was really weird cause the return value was always a really high non zero for the RegQueryValueEx, which really stumped me.
Guess it was just one of those days of banging your head against the wall...
(plus i never got an e-mail that you responded.. oh well)
Thanks again,
-Jerry
|
|
|
|
|
For testing I have added in form1
Public WithEvents myEvent As New Array1(New Panel) and added something to do when event is triggerd
Public Sub myEvent_Clicked(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles myEvent.Clicked<br />
MessageBox.Show("Button pressed")<br />
End Sub
To test the event I have added a button who's fireing the event in Array1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
myEvent.OnOff_ClickHandler(sender, e)<br />
End Sub
In Array1 there is the routine
Public Sub OnOff_ClickHandler(ByVal sender As Object, ByVal e As System.EventArgs)<br />
MessageBox.Show("Event routine")<br />
RaiseEvent Clicked(sender, e)<br />
End Sub
When I click button1 the event RaiseEvent Clicked(sender, e) is fired but when I click a button from the array panel with AddHandler aButton.Click, AddressOf OnOff_ClickHandler then nothing happed. I see the first message with "Event routine" appear but the second not
What's the different between a fixed button and a button from an array control?
In my opinion nothing but who am I
|
|
|
|
|
hy everyone
I do want to realice a kind of permutation in a VBA programm
Lets say I do have the three integer pairs "100 - 120", "200 - 220" and "300 - 320".
Now I would like to let my programm select every possible permution of them, meaning the lowerone of the first, the lower one of the second and the lowerone of the third.
Let me describe with a set of two pairs.
Lets say I do have the pairs "1 - 2" and "3 - 4" so my proggy should allow to access every permution, either for output or for furter use.
Well I will have to get "1 3" "1 4" "2 3" and "2 4".
This should work for every amount of pairs available. Lets say 16 or 20 pairs with a lower and higher number.
I thought about an inner and outer loop but this way I was not able to get all the permutations.
Does anyone of you know how to realice that.
Thanks!
Stephan.
|
|
|
|
|