TestClass = Nothing Does Not Destroy Class
Nov 18, 2009I have a class that has timers and logic that I want to "Kill". Performing a TestClass = Nothing does not destroy it (calling it form a form).
View 3 RepliesI have a class that has timers and logic that I want to "Kill". Performing a TestClass = Nothing does not destroy it (calling it form a form).
View 3 RepliesWhat does the "where T : new()" do? VS 2005 public class TestClass<T> where T new()?
View 1 RepliesI have:
Page.aspx
Page.aspx.vb
TestClass.vb
I'm trying to access a shared property of the TestClass class from the Page.aspx.This code works fine:
<head>
<script language="JavaScript">
<% if System.Globalization.CultureInfo.CurrentCulture.Name.ToLower = "pt-br" Then %>[code]......
this used to be so easy in C++ and VB6 I am dynamically creating multiple instances of a fairly simple class, tracking them via the Collections class in vb.net. I loop through the collection if I need to get to a particular instance to set some property, for example. Everything is fine, and works ok until I try to destroy the instances that I created (largely because I am probably not doing it right). What I am doing setting the instance to "nothing". That is, here is the portion of the code:
[Code]...
I am writing a chat application quite similar to MSN and others alike, where you have a main window that can spawn several chat windows.So I have a chat class form (called frmChat) that I just instantiate whenever I need it, with the following code from the main form:[code]In this form I have a button labeled as 'End chat'. I would like not just to close the form, but actually to destroy its instance in order to dispose memory. I tried what would seemed to be to me the more direct and obvious way to do that (see below), but unfortunatelly VB syntax checker doesn't allow me to do that:[code]
View 3 Replieswhy does finalize not get fired when i try to destroy a class until the application is exiting. i feel like because these objects were never actually finalized until the program is exiting that its somehow bogging down the operation of my app VS 2008?
View 1 RepliesI have written my and in a test class for vb.net and it works as follows:
A stored procedure is executed and the result is saved in an xml file with the help of a dataset. What I need to do now is , Information of this dataset should also be redirected to a textbox in a form so that I can copy this information in clipboard and create dynamic assert statements for instance I want
datatable.rows.count,
datatable.columns.count,
datatable.columns(i).ColumnName,
and same to get columnType. All of this info would be shown in the form but I am unable to open a form in NUnit test class.
A have written an activex exe (let say FileCopy.exe. I want that obect itself can be destroyed from the class.
suppose an application creates a component from the class "FileCopy"
Set NewFile =CreateObject ("FileCopy.Filops")
Is it possbile the application quits and object is still running in separate space and We can destry it (Filops) based on certain condition (let say timeout) from its own code (Filops).[code]..
I programatically add a group of UserControls to a flowLayoutPanel control.
sometimes I need to destroy that group of controls, but have no idea on how to do it.
assigning the flowLayoutPanel variable to nothing only erases the pointer, but the controls remain in the window.I have found a page in MSDN saying that the best way to destroy a control is to call the DestroyWindow API, to destroy the container window. But I don't want to destroy the container window.
I have a function like the following: Public Function testFunction(ByVal input_string As String) As String
[Code]...
or just let the garbage collector do the job for us? Both the above functions work, but I want only know the best practice for performance...
Here is the situation: User logs in via username/password stored in an MSSQL database If the user is authenticated, the system makes a session variable with username/SHA1'd password and boolean if the user is logged in or not (for subsequent pages) I need to be able to destroy the session variable. I want a confirmation box as well.
This is what I have so far:
<script type="text/javascript">
//<![CDATA[
function doLogout() {
[CODE]...
Since it is an ajax request won't reload the page (the functionality works fine, the request destroys the session), I think I need a different approach to do this. I would really like to be able to do it all in ASP.NET if possible.
As the title states, I have a session variable that is set during a login script with asp.net and vb.net code-behind. Can I call a javascript function when a link is clicked that will destroy that session variable? If it is possible, can I use jQuery to make that process easier?
View 4 RepliesI'm developing an app which creates like 30 labels at runtime.The problem is that with the click of a button, I need to destroy those created labels.[code]...
View 17 RepliesI migrate a project from vb 6.0 to vb.net 2008.
[Code]...
When the form first loads there are two global variables (assigned values in the form load sub as a default) that set the number of days back in time and how many days ahead events will be displayed (in an array of labels). If the user wants to view more events (or less events) the number of labels displayed (and the text they contain) will change. I have one sub (code below)that creates an array of labels.
[Code]...
Deleting a file is one of the controversial matters of computing. When a user deletes a file (removing it also from the Recycle Bin), they assume that the file is indeed deleted. However, what happens is that only the reference to that file is deleted, so the system can no longer remember where the file is located, but the file itself is very much intact.
I am looking for a way to delete a file permanently, the way e.g. the application Wipefile would do it, by applying successive overwrites (up to 30) over the actual position of the file on the disk. There must be a way to do this through code (I just presented an example that this has indeed been done ), so I'd like to know how to do it.
Im new to visual basic but i have some experiance in other languages.I been trying to build an application that uses the webbrowser module.There is only 1 thing i cant find anywhere.in my app i use my browser to signup at a sertain webpage.This page remembers my login info.When i close my application and open it again and go to the same page i can login again.But when i switch forms and go back to the browser form it will automatical login for me.
View 4 RepliesUsing vb.net 2008 I have a form with a PDFViewer control. I pass the filename and path to open the pdf. When the form is closed, AcroRd32.exe is not destroyed. It remains in Task Manager even after I've completely closed the application. The more pdf files I open, the more memory used. How can I destroy? I've tried setting the control = nothing, ctrl.dispose but neither is working. What am I doing wrong?
View 5 RepliesI need to know how to have a button on a tab to create another button on a second tab that contains a panel, with appropriate spacing, the same size as other buttons already present, and the name of the tab that generated this new button as the text on the newly created button. I.e. button1 on tab1 will create and place a new button on a panel in tab2 that already has a grid of buttons (maybe 3x10 buttons) which will be placed underneath a particular column with the text tab2 on the new button which can also refer back to that tab automatically. Hopefully we can get all this code under a single button event.
I also don't know how to have a button on tab1 that focuses on tab2, which sets the back button on tab2 with a reference to go back to tab1 in order to remain dynamic. I.e. clicking on tab1's button will go to tab2 and set the back button there with a link back to the tab it was referred from.
I'd also like to know if there's an easy way to create and destroy tabs with a specific layout. I.e. We have home tab, and comment tab. (This is for the sake of argument) On the comment tab1 (which contains all posted comments), we have a new comment button which creates a comment tab2 (or a dialog box for that matter) with appropriate textboxes, labels, and buttons in the right places which could also make use of the issues I posted above. So the new comment button on the comment tab1 will create either a new comment tab2 with appropriate objects, or a dialog box with the same, and then the submit button on this comment tab2 or box will create a new textfield/buttons on the panel containing the grid of buttons with the information provided in the fields from comment tab2/dialog box which is then destroyed.
I hope i haven't made the examples too confusing, but I can't figure out how to even make progress in these directions. Trying either fails completely, or semi-fails in getting these examples to function 100%.
I've already tried posting in other forums, but with no replies. Hopefully you all can help me figure this out.EDIT: This is not homework, I have scoured forums and google trying to find the answer to these problems. I'm hoping that because these are mainly VB based forums I can find some answers here.
In VB6 I used internet explorer object a lot. There things internet explorer object can do that webbrowser control cannot. For example, internet explorer object is easier to debug because when the application is in debug mode, internet explorer object is still interactive with client. Also we can clear cookies and resstart with internet explorer object. We can do ie.quit, then set ie=new internetexplorer then ie.visible=true
In vb.net internet explorer object becomes webbrowser control and I have no way to do that? How can I delete cookies and then restart webbrowser control? How can I tell webbrowser control to "quit" or destroy it self? That sort of thing.
If Class X is within the scope of Class Y, is X a subclass of Y?If Class A is a sub Class of B, then is Class B considered a super class of A?if Class C inherits Class D is Class D a superclass or parent of Class C?if Class E extends Class F then we can consider Class E a child of F?if Class G inherits Class H and is within the scope of Class I then who is the parent of Class G? Classes that inherits Class J and classes that are within Class J are all sub classes of Class J?
View 1 RepliesI have put this code in the global form Inherits System.Windows.Forms.Form. And then in the form that will inherit this from the global Inherits MenuStrip. "MenuStrip" is what the global form is called. But keep getting this error: Error1Base class 'MenuStrip' specified for class 'Lesson2' cannot be different from the base class 'System.Windows.Forms.Form' of one of its other partial types.
View 5 RepliesI have a class (see below)
Imports Microsoft.VisualBasic
Imports System.Data.SqlClient
Public Class ClientProfile
#Region "Variables"
[CODE]...
It is in the file ClientProfile I have placed in both App_Code and also App_Code/Models
In my code behind I have the following
[CODE]...
The last word, "ClientProfile" has the scary squiggly red line below it. It is not recognizing my class.Even the Intellisense is not picking up te class. Do I have to register the class file in any way?
I created a function (MakeDST(byval SQLstring as string)) to return a dataset. In my app, I need about 5 datasets.
[Code]...
Dim a as Type=GetType(className) would gimme the type. But I have only the name of the class as string. I want something like GetType("class1") which would return the type.
View 2 RepliesI can't make difference between public class and private class and friend and protected friend class.
View 1 RepliesI can do this without problem.
Class A
End Class
Class B : Inherit A
End Class
Dim Obj1 As A = New B
so I used to mess around with C#, just a little. And someone had helped me make a class for Visual C# that was supposed to do the math parts for "internal structure" - which the program used for a part of its calculations and screen... Basically there were 2 options. Endo-Steel and Standard. The user would use a updownbox to determine weight of the machine and then internal structure was a % of that total. If it was standard then it was 10% of the overall weight, if it was Endo-Steel then it was 50% of standard (so 5% of total weight) rounded to next 0.5 (so .25 was .5, 1.25 was 1.5, 1.75 was 2.0, etc). I have the code for the C# class file for it, but want to make it in VB.
[Code]...
I need to create unit testing project for my current website. The currentw ebsite si written in VB. All unit testing examples are using interface to create mock object. My current VB class does not implment any interface. Can I add interface and implement it to my current class and functions without affecting or changing codes to any pages in my website that call the functions? For examples my current class is like:
[Code]...
I've been creating short test apps repeatedly to try to understand some of the concepts in VB.NET.For the most part it has been illuminating.I read Bucky's .NET knowlegebase tutorial on passing objects as parameters to newly created forms. He shows how to create a new class that inherits from the base form class and define a New() method with parameters Extending the concept I thought about doing the same thing with a form that was created at design-time (In this case Form2).
[Code]...