Answer Questions
Dan Rooney Events on a dynamically created object
I have a custom control, call it SimpleControl. It has a public event that I expose, TextChanged, which gets fired on a textbox_TextChanged event. I have another control that uses SimpleControl, call it MyControl. MyControl creates SimpleControl dynamically. How can I bubble up the TextChanged to the user of MyControl if SimpleControl is created dynamically Is this possible (SimpleControl isn't in the dropdown box in VS of available controls to choose events from because it wasn't created during design time) Please help! Any help is appreciated! You use the "sender" object in the event handling routine. Here's an example: Private Sub Button1_Click(ByVal sender As System.Objec ...Show All
Gary Spence Unable to cast COM object of type 'X.YClass' to interface type 'X._Y'.
Dear all, I'm getting this nasty error and I cannot find any answers (google didn't help either). Here's the thing: I'm calling a VB6 DLL from a VB.NET (VB2005) application. This is the error I get when I call the DLL: Unable to cast COM object of type 'X.YClass' to interface type 'X._Y'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{780BDA61-8169-4A5D-AD31-59A902BC3B84}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). Strange thing is, sometimes my code works properly, and the next hour I get this error. I rebuild the DLL, unregistered and re-registered the DLL, swept through the internet and the ...Show All
daydreamsy2k Initialize an instance of an own class
A question please. I instanced an own class and I set some properties, not all ones. When I ask: if myinstace.myproperty.trim() I get an error because I didn't set it. How can I initilize a property of a class if myproperty is string without initialize each property IF I do that, it is not enough... Dim myinstance As New ClassFormi Thanks... A simple example will show you two potential ways to remedy and show you why I'll explain why you are probably getting a problem You can add a default value on the field declaration - such as for Bar which will give it a default value. You could initialize a value in a constructor (whether it be a default constructor with now arguments, or ...Show All
K::ot???ter Ethernet Port Watcher
I am trying to write an application similar to file watcher, but instead of watching a directory I want to watch a wireless connection, as soon as the computer get connected to that specific connection an application will be automatically launched. any ideas Thanks. well there is no control to do this in .NET. You would have to make your own or use Win32 API to detect the status of a connection. Partial Example Private Sub Form2_Load( ByVal sender As Object , ByVal e As System.EventArgs) Handles Me .Load ' Monitor for network availablility change AddHandler System.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged, AddressOf Me .netchanged ...Show All
maqk 2005 Compiler not recognising code changes
Ok you guys, I know this is probably going to be something really simple so I apologise in advance. I've recently converted a vb.net 2003 solution to 2005. everything is great and I've got rid of my pre-compilation conversion errors and warnings etc and am reading to carry on development. My problem is this - in a sub project (which is referenced in the main solution by the sub projects DLL file, but I also change the source code for the subproject whilst in the main solution (hope that's clear!)), when I change or add to the source code (in the sub project) and start debug, or even rebuild the whole solution, the new code doesn't get picked up. I've tried putting a breakpoint in the code, and it doesn't pick it up, so i tried typing " ...Show All
KAAU Vista problem with handshaking on serial ports?
I am working on an application for a device that uses hardware handshaking on the serial port. Here is the code that I use to open the port... mscomm1 = MyPort.OpenSerialPort( "COM1" ) With mscomm1 .Close() .DataBits = 8 ' .BaudRate = 9600 .Parity = IO.Ports.Parity.None .StopBits = IO.Ports.StopBits.One .Handshake = IO.Ports.Handshake. RequestToSend .ReadBufferSize = 500 .DtrEnable = True .RtsEnable = True .ReceivedBytesThreshold = 2 .Open() End With This does not work under Vista. I have tried it under Vista Ultimate on two different test machines using the 'built in' serial port. It does work under XP on the same machines. I have also tried it under 98 and ME on othe ...Show All
Niro [OTP] VBS Script "my network places"
I have the following script I found on the MS site for adding my network places shortcuts which works great. I would also like to remove some shortcuts but I can't get it to work. At the bottom is my problem. I am a sys admin with little programming knowledge - pls help. Const NETHOOD = &H13& Set objWSHShell = CreateObject("Wscript.Shell") Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(NETHOOD) Set objFolderItem = objFolder.Self strNetHood = objFolderItem.Path strShortcutName = "Win2000" sreShortcutComments = "test" strShortcutPath = " \\win2000\share " Set objShortcut = objWSHShell.CreateShortcut _ (strNetHood & "\" & strShortcutName & ".lnk") objShortcut.TargetP ...Show All
Sneak Creating instances (for a chat program)
Okay, for part of my program, i am adding a chat feature. I would like to not need to run a seperate server because my computer is not up 24/7. I was able to get the ip's of the clients that are currently online and put them into a data base with the following order (and it is updated constantly) ID(Unique integer for each user, is stored also on the target computer) Name(Used just for the human to know the person) ip (external ip) compname(name of the persons computer) I would like to know how i can get a window to open in multiple instances that have diffrent settings (ie: diffrent text for the chat), and how to refer to the window later (ie: a variable so i can manipulate the settings on it) thanks, ...Show All
FredV Sql Server project stuff...
Dear folks, I’ve created a Sql Server Project from my Visual Studio 2005 with Visual Basic. When I try to add GetCommand it doesn’t appear at all, intelligense doesn’t show me that method. Why I don’t get the point. What else/assembly is needed Dim oCommand As New SqlCommand Dim oPipe As New SqlPipe oCommand = SqlContext. Thanks in advance for your comments and thoughts, I'm stuck with that. Any idea What does intellesense show you Is it showing you only the methods for object or another set of methods You're accessing the SqlContext class statically/shared. The intellesense you're listing is the correct intellesense for that class. ...Show All
ar_pad CheckBox Service control (VB, VS 05)
I decided to try and expand my project, I now wish to have the (current, I'm adding more as I find out which aren't required ) two processes here's a brief on what stage the additions are at. I have added 4 check boxes named; SpoolCheck1 SpoolCheck2 MDMCheck1 MDMCheck2 (more will be added as I find out more that can be stopped) and two command buttons named; StopCheckedButton StartCheckedButton I would like to 'link' the check boxes to the command buttons, but the checkboxes job (when checked, then clicking the start/stop command buttons) is to start/stop the selected program/process, in this case spool and mdm. I have these codes for starting and stopping the processes and return a message if there is a problem. ...Show All
FredMunro Copy of Screen
Good day to you. I don't know much about the ClipBoard and GetData and so forth but there seems to me that 2005 Express is not quite the same as .NET 2003. The code that I shall give in a moment gave me a full screen copy on the Form_Load event and gave a copy of the Form on a button_click event. Now, when using the code in 2005 Express the Load event only gives a copy of part of the screen. Why is this happening Is there a way in which I can rectify matters. I would be very pleased for any info. I have tried with Imports and Inherits and Paint. It is the sizing I believe. Private Sub frmScreen_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load SendKeys.SendWait( "{PRTSC}" ) D ...Show All
StarRrr problem adding menu item
i have db connection that loads 2 fields, name and directory then i need to add the 2 records to a menu so i have file.dropdownitems.add(name, nothing, process.start(directory)) but VB is telling me that system.diagnostics.process cannot be converted to system.eventhandler what am i doing wrong can someone point me in the right direction ! thanks in advance!! The event handler needs to know which program needs to be started. You could use the Tag property of the ToolStrip button to pass that information. This code demonstrates the technique: Public Class Form1 Private Sub RunProcess(ByVal Sender As Object, ByVal e As EventArgs) Dim item As ToolStripItem = CType(Sender, ToolStripItem) If Not i ...Show All
chendil vanan >256 fields...parse comma delimited text file into array and average columns???
I am writing an application that will have to access comma delimited text files of numbers (both types: short and double). This text file has 318 columns (every time), 1-3 rows of data and no header line. I need to do some averaging of about 15 fields. I was using datatables, but that method is not working now that I cleared 256 columns (schema.ini column names are not taking...not sure if "F318" and similar would work). I am now looking into arrays for performing the computations. Assume the text file looks something like this: 1,-3.45,5,7,6.676 2,-3.12,6,8,9.787 Does anyone have some suggestions on how to read this in a rectangular array and average a column I can split the first line into a single dimension array (with the cod ...Show All
dotnetsr Checking User Group in Active Directory using VB.net
Hi i am new to .net and active directory. i need to validate user in Active directory. my input data is Domain name , Username and groupName and i won't pass password private function chechkUser(ByVal domain As String, ByVal username As String, ByVal GroupName As String) As Boolean if username is found in active directory chechkUser = true else chechkUser = false end function how to resolve this can any send VB.net code for this requirement thanx in advance -naren this following statement works for me.. i dont know whether it is correct approach This statement validates my domain,group and user If System.Environment.UserDomainName = "DomainName" And My .User.IsInRole( "Gro ...Show All
crgsmrt How can i obtain the compilation date and the last modification date of a proyect.
I want to put into a msgbox the compilation date and the last modification date of a proyect . Is possible obtain this dates from a variable or a function... Have a look in the My.Application class Failing that you could read that info off the actual DLL.. ...Show All
