Jump to content
Xtreme .Net Talk

Nazgulled

Avatar/Signature
  • Posts

    120
  • Joined

  • Last visited

Everything posted by Nazgulled

  1. Hum... Thanks, I always had troubles with initializing arrays in VB... But, do I really have to size the array? What if I don't know it's size?
  2. Here's my code that doesn't work, I get thrown lots of exceptions and can't seem to understand why... Friend Structure structTest Dim varA As String Dim varB As Integer Dim varC() As String End Structure Friend struct() As structTest struct(0).varA = "blabla" struct(0).varB = 10 struct(0).varC(0) = "aaa" struct(0).varC(1) = "bbb" struct(0).varC(2) = "ccc" This is what happens at line: struct(0).varA = "blabla" How can I fix this?
  3. Hum... You didn't confuse me... Although I don't know exactly what are delegates, I took your example and implemented it correctly (I guess) in my test application. Everything seems to be working the way I want it... Sorry giving you guys all this work in help me out...
  4. I've been trying to use your code in my test application but I've failed... I can't seem to understand enough to take this and apply it to my application. Did you take a look at the personal message I've sent you? Did you opened the solutions inside the zip file? Do I really need all of the above code to do what I want? (just create a function2() in the plugin without implementing it in the interfaces)
  5. But those things you are asking don't really matter, that's up to me and my application, I don't think it will really help me explaining how exactly my whole application will work and how the plugins system will work... And besides, I don't know exactly how the plugins system will work caus I've just thought on how to do it and I'm seeing if it's a viable solution, but I can't really test it cause I have the problem described on this thread. Anyway, the application I'm coding has to do with network connection cards, to configure ips and such with the ability to have profiles and just apply one of them. I want to add the plugins system so users can extend the functionality of the profile selection to other stuff. For instance, the IE proxy, that's the first plugin I'm developing to release with the final version of the application. That plugin would have 2 functions, one to set proxy in the registry and the other to clear it. However, other plugins may do other stuff or may change proxies too on some other programas but may need more functions to be called or maybe just one. What I want to do, is to allow the plugins to have functions they want, then, "share" the ones that can be used by the main application. When creating a new profile, the user selects the plugins he wants to use, then, for each plugin, selects the functions that he wants to be called when that profile is applied. For instance, you would create a profile for "home" with the IE plugin, calling just the function to clear the proxy and another profile for "university" with the IE plugin, calling just the function to set the proxy in the registry (that's actually an example for the real use I'm going to give to my program). I'm no begginer, but I'm not that average user either, I just now some stuff, maybe just a bit more than a begginer, but not too much... Maybe cause english is not my main language and there are many words in the documentation to describe stuff that I don't really understand... Shure I look up for words in the dictionary and google, shure I get the meaning of them, but sometimes that doesn't really help to understand the concept and the real meaning of them in context of conding in VB.NET. A bunch of things you just said, I don't understand that well... I didn't knew Interfaces exist nor what were they, until I read the tutorial by devil and still, even after reading msdn, I don't really get what exactly are they, what are they for and how exactly they work. I just know a bit and understand this and that, but the whole concept, no... I always had difficulties in this field, even in my home language, but I don't really read documentation in my language so, I don't think it's a valid point. I'm going to read this whole code you posted, see if I can understand it and implement it on my project... I'll report back later! Thanks. I'm sorry giving you this whole work...
  6. It doesn't matter what I want this for, I want to do it and I know why I want it this way... And no, I don't want to call them in sequence I just want to call functions in the plugins. Functions that I don't know their names nor I want to specify them in the host interface cause I don't want to limit the plugins to a number of functions and/or names.
  7. Maybe I chose wrong title, I didn't mean exactly random, what I meant is that one plugin may have 2 functions, another one may have 3 with completely different method names... @marble_eater Your method described earlier seems to be the best option, however, I'm having problems working with it, can you please provide a more complete example?
  8. There's no need to convert it from C# to VB, I can easily read it either way. Thanks anyway. I will investigate other possibilities...
  9. I've been trying to use System.Reflection and those methods you tell me about, but I can't seem to make them work...
  10. I'm using the tutorial from divil (http://www.divil.co.uk/net/articles/plugins/plugins.asp) to develop plugin-based applications but I'm having some problems that I don't have a clue on how to solve them... For instance, in the interfaces plugin: Public Interface IPlugin Sub Initialize(ByVal Host As IHost) ReadOnly Property Name() As String Function Calculate(ByVal int1 As Integer, ByVal int2 As Integer) As Double End Interface We are pre dictating that we only have a Sub called Initialize, a ReadOnly Property called Name and a Function called Calculate. However, I want the plugins written to my application to have their own functions (the many they want, public, private, whatever...) with their own names, than I want to be able to use them on my main application. For one part of this, I though I could create a string array, listing the names of the public functions that the plugin author want to be used by the main application. But than the problem came... How can I have the plugin author create their own functions with their own names and allow me to use them in the main function, how can I do that?
  11. I want to access some form controls (like a textbox and buttons) and read some properties for those controls; for the textbox I also want to be able to write some text on it... The thing is, I don't want to do this on my windows forms, the application I'm coding, but some other running application. How can I have access to these stuff?
  12. Nevermind... after a lot of search and a bit of luck I found something about association between those 2 WMI classes and came up with something like this: Dim mos As ManagementObjectSearcher mos = New ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True") For Each moConfig As ManagementObject In mos.Get mos = New ManagementObjectSearcher("ASSOCIATORS OF " + "{Win32_NetworkAdapterConfiguration.Index='" + _ moConfig("Index").ToString + "'}" + " WHERE AssocClass=Win32_NetworkAdapterSetting") For Each moAdapter As ManagementObject In mos.Get() If moAdapter("Caption").Equals("[00000010] Marvell Yukon 88E8036 PCI-E Fast Ethernet Controller") Then TextBox1.Text = moAdapter("NetConnectionID") TextBox1.Text = TextBox1.Text + ControlChars.CrLf + moConfig("MACAddress") End If Next Next But if you guys know a better way to do this, just let me hear it...
  13. I'm trying to read an UInt32 value from WMI (Win32_NetworkAdapterConfiguration) but I'm getting some exception... Here's the VB code: Imports System.Management Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim mc As New ManagementClass("Win32_NetworkAdapterConfiguration") Dim moc As ManagementObjectCollection = mc.GetInstances For Each mo As ManagementObject In moc If mo("Caption").Equals("[00000010] Marvell Yukon 88E8036 PCI-E Fast Ethernet Controller") Then TextBox1.Text = mo("InterfaceIndex") End If Next End Sub End Class Here's the exception: The exception happens at this line: TextBox1.Text = mo("InterfaceIndex"). It also happens if I try something like: Dim val As UInt32 val = mo("InterfaceIndex") Replacing TextBox1.Text = mo("InterfaceIndex") with val = mo("InterfaceIndex"). How can I access this? I need to save the interface index to a variable so I can compare network interfaces between Win32_NetworkAdapterConfiguration and Win32_NetworkAdapter. Here's some interesting links: MSDN: Win32_NetworkAdapterConfiguration MSDN: Win32_NetworkAdapter
  14. yes, I tried closing in between, and I didn't have more than 1 VS window opened. And I have 10 on that value...
  15. I don't have any recent projects on my list... no matter how many I open, close, save or whatever... the list is always empty, any reason why?
  16. That didn't work, nor Integer.parse() I had to solve it with the tryparse() thanks... I thought I had option strict on but I guess I was wrong. If I enable it globally in the options, I'll still have to add it to my program right? Unless I start to create a new project... right or wrong?
  17. thanks... however, i'm having difficulties to convert the string of the masked textbox to int to see if it's less than 256... Private Sub mtxtLIP_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles mtxtLIP.KeyUp Dim segments As String() = mtxtLIP.Text.Split(".") Dim segment As String For Each segment In segments If segment > 255 Then picLIP.Visible = True Else picLIP.Visible = False End If Next End Sub Obviously, this doesn't work... but I tried many int conversions and none of them worked...
  18. Is it possible to have a textbox to act like the ones in the network connections in the TCP/IP properties? how?
  19. Hi, Is there any articles about .net 2.0 that points out important things about it that everyone should know about? I have my apps in .net 1.1 but I'm moving them to 2.0 and I just wanted to know if there is anything I should really know about the 2.0 framework.
  20. doesn't the name say it? it jus aniamtes teh window with blend, slide, and some other effects...
  21. I've crossed something like this too, anyone has a tip on how to fix it?
  22. that won't work... when I click the notify icon, the HWND will be the one from my form's window, I can't compare to myself... it will always be true with that...
  23. My app has a notify icon and when clicking on it I want to know if my app is the most on top or not. If it is it means it's visible, I can see it. If it's not, then maybe something is in front of it (talking about maximized apps only, doesn't matter if it's not the most on top but visible anyway, doesn't matter that). How can I find out if my app is the topest one? Or, how can I get the title of the topest window, so I could compare to my app?
  24. thx, but I think they way I did it is simpler and has less lines of code and besides. I have an option on my app that if it's active then the user can't move the form if it's not then he can freely move it and it's easier to make that validation. anyway thx. how do you do that vb.net syntax here in the forum?
×
×
  • Create New...