Build A Useful Class And Implement It In An Application?
Apr 16, 2009
I am trying to build a class. I am having a difficult time conceptualizing how a class is built and how it works. I want to be able to build a USEFUL class and implement it in an application.
View 1 Replies
ADVERTISEMENT
Nov 17, 2011
so my question is relatively simple, can I create VB6 application that references a class in a dll, and then substitute that dll for another at runtime?Now my intial guess is... no chance in VB6.
So my thoughts turned to a VB.net interop dll. Could I do it in here, and then call the interop dll from the VB? but I'd be happy if someone knew differently.The only thing that I think would actually work would be DI in .Net, but I'm limited to .net 2, or 3.5 at a big push, so I dont know if that is possible.
I have a dll that a specific site uses, but we dont want to ship that out to everyone. Instead, we want to build a clone dll which just has the interfaces setup so that the VB6 build will complete.When it gets to the site that needs it, they want to replace the dummy dll, and drop in their version instead.
Note: We do use RegFreeCOM when its gets installed, so I do have the manifest files that I could play around with if needed.
View 2 Replies
Mar 3, 2010
I'm trying to build an application to monitor a site to build statistics from the data being read. This HTML looks like this.
<div id="history">
<h4>HISTORY</h4>
<table border="0" cellspacing="0" cellpadding="0">
[code]...
Now I can read the html and put the text anywhere, I just don't how to read specific parts so I can separate the data out.
View 17 Replies
Mar 7, 2009
I just created a simple application. I Builded that using build->build myapp. I got .exe of that application. i runned. all went fine. but when i closed that app, even after closing it is in memory. it is still running. how to deploy it properly?
View 12 Replies
Mar 1, 2010
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]...
View 2 Replies
Jun 10, 2011
Suppose I have piece of code like this:
Public Interface ISomething
....
End Interface
[code]....
View 2 Replies
Feb 19, 2010
I am working on a general helper class to sort ListView SubItems. I wrote a base class that has much of the code I need. It includes a MustOverride for the Compare method so that the various inherited classes can implment their own comparisons based upon their type. For the value types, I end up with very similar code such as the following, where x and y are ListViewItems: Public Overloads Overrides Function Compare(ByVal x As Object, ByVal y As Object, ByVal sortColumnIndex As Integer, ByVal sortOrder As System.Windows.Forms.SortOrder) As Integer [code]
View 3 Replies
Jun 18, 2009
class inherit from another class and implement an interface?
View 4 Replies
Jul 19, 2010
I just would like to know how to implement class constructor in this language.
View 2 Replies
Nov 21, 2009
I want to modify the base Array class by creating a new class called "FileArray".I have some text files that are read into a string array. Each element in the array is a line from the text file. I want to update the GetValue method by overloading it or overriding it so that it will update some value that will give an indication to what the last line was. I have a couple of ideas on how I can do this:
1) Use a public integer, like intLine, that gets updated everytime GetValue is called.
2) Create a new property of Array, such as "LastLine" that would return the last line number (which would basically be the last index value +1) and then use a public array to store the files (though this is less desirable as the array may be used by several different functions)
An easier way would be to be able to determine the last element that was returned, which is basically what I think I am describing above.
View 2 Replies
Dec 23, 2009
Say I want to know more about a class mshtml.htmlinputelement for example.Say I want to know. What is his parent classes? What interface the class implement? How do I do so through object browser?
View 1 Replies
Nov 18, 2009
Implement singleton in a parent class.Infact what I want is that All the childs etc. should use same instance of the parent.
I have implemented singleton, Changed the scope of parent class's constructor to "Protected". But in the application when ever the new child's constructor is called i.e. "Dim abc as New Ch1()" the constructor of Parent is called (as it is Proctected and can be access from child).
View 2 Replies
Mar 16, 2009
I've never actually used Reflection, but I've been warned in the past that using it may cause slow performance. My question is what part(s) of it is/are slow.
I'm thinking about creating a board game and I wanted to implement the player class through plug-ins. That way there could be several different player classes (i.e. human players, and several configurable AI classes). If implemented this way, where should I expect performance hits? Only when initializing the player class? When passing arguments to methods in the player class? In the entirety of execution of methods from the player class? Or is it going to affect the whole application?
The reason I ask is that the AI will be extremely processor intensive. Through testing it seems like it may take around 1-30 seconds to determine a move on my quad core (Core 2 Q6600) processor, depending on the effort spent to optimize the move and testing different branches on separate threads.
My concern is that if I implement the AI via a plug-in, the move determination would slow down considerably to the point where it wasn't playable on lesser hardware.
View 2 Replies
Nov 22, 2011
I have several similar classes but only want to instantiate one of these classes dependant on a selection from my main form.
View 4 Replies
Jan 10, 2010
If we make a class and implement tostring, should we support some interface?
View 5 Replies
Mar 15, 2012
i cant seem to find an answer to, i recently decide to start using class libraries, but cant seem to figure them out. I need to be able to assign the class details to fields within my texboxes and controls found in the Tab, i have placed an image with a basic layout of the controls on the tab. My question is: 1stly how do i make it so that the class library performs the function within the tab without having to create a seperate form for it with its own controls(or do i need to do that?)Secondly: In the next tab, can i create a seperate class library for it if it performs another task such as issue? how to create and place them as refferences, i just cant figure out how to marry the controls?
View 14 Replies
Nov 5, 2011
Im getting the following error on the code I transleted from C# to VB.NET below (original code can be found here:
Class 'QueryParameterComparer' must implement 'Function Compare(x As oAuthBase2.QueryParameter, y As oAuthBase2.QueryParameter) As Integer' for interface 'System.Collections.Generic.IComparer(Of QueryParameter)'.
[code]......
View 1 Replies
Feb 24, 2009
How does one implement something as Public ReadOnly Property within a class.
CODE:
View 3 Replies
Oct 18, 2009
Can I create my own class library, possibly to be sold commercially, in VB.NET?
View 2 Replies
Jul 27, 2010
link that implements DES algorithm with CBC. if I want to use an existing class to implement the standard DES (using ECB) to encrypt file, how do i do? I want to use this class because it implements each step of the algorithm.
View 4 Replies
Sep 7, 2010
I am trying to build a class that works with a form, but I keep getting the dreaded "Object reference not set to an instance of an object" Error.The form basically collects test grades and assigns them to a collection.My class code is as follows:
Public Class Scores
Private colScoreCollection As New Collection
Public mintSum As Integer
Public mdecAverage As Decimal
Public mintMinimum As Integer
[Code]...
I had a similar project I was working on that had a collection in it, but now that one is giving me the same error. It there something with my version of Visual Studio that is causing this error possibly?
View 7 Replies
Dec 17, 2009
I've now properly started implementing OO into my system (which I probably should have done from the start) but I just want to clear some best practices.So let's say I have a class called Job which contains information such as Description, Project Manager (Employee class), Value etc. at the moment, if I initialise the Job class it will initialise all the information held within it, even if I only want the job description. Is it best practice to do this or is it better to implement the class and access the database for values as and when they're needed? Or is it just better in those cases to just access the database directly?
View 1 Replies
Nov 8, 2009
I have this application that users can make exams that contain exercises of different ... whatever. Anyway when student takes the exam he chooses it from a list and then all exercises are loaded from database. I wanted to make loading process faster by loading only first exercise data and putting others in background thread.
Actually in other parts of this application something like that is done but not by me. Basicaly an api class is built around BackgroudWorker and i can use this class to put certain functions of objects to be executed in background. The idea sounds great but in real life there are some problems with it. For example for historical reasons this application uses global functions and reader and uses global connection to Access database which means if in background something is being fectched from data base and you try to fetch from database in main thread then a „reader is already open" error occurs. To avoid this error if im doing something in main thread and want to fetch some data i have to move my function from main thread into background worker function list. And basically this in my opinion stinks cuz you end up with many delegātes, invoked checking and thre result... I was just thinking that there maybe is another way to allow (maybe with events) not put everything in background in case something is happening in bakcground but rather allow bgworker to finsih current thing, then do my thing and then resume bgWorker and not create havoc in code.
Basically i have to classes - exam and exercise that each implement many interfaces (like IExercise, IExerciseResult, IExerciseYesNo, IExerciseMultipleChoise etc.)And then i have DataBase classes like ExerciseDB, ExerciseResult etc. That have functions that preparē the sql params and call sqlHelper functions.And for example when i load up exam i go throug all exercises and call LoadData function that in turn calls ExerciseDB function selectData and then i put the returned data in Exercise object. And this type of thing of course would producē error if i at the same time would try to register the answer in database for another exercise. Ofcourse i could always check and put this in background... but as i said i'd rather want to work with database from both threads.
View 13 Replies
Nov 18, 2009
I'd like to build a class where I always have a button at the bottom of a form.Then when I drag and drop the button, It has to make a copy of that button called "button1", if I drag and drop the button again I'll have another button called "button2" and so on.But If I drag and drop the "button1" or "button2" they shouldn't duplicate as the original. And this is the problem I can't sort out.
This is my class:
Imports System.Windows.Forms
Imports System.Drawing
Public Class frmTablesEditor
Inherits Form
[code].....
View 1 Replies
Jul 29, 2010
how variables declared with protected access in a base class are used to implement inheritance.
View 1 Replies
Nov 22, 2010
I created an interface - TermsService.vb and defined the following method : Function GetTermsList() As List (Of Terms)
how do I modify my TermsDB class to implement the TermsService interface I've just created? Here is my code: Have I implemented it correctly?
Imports System.Data.SqlClient
Friend Class TermsDB
Implements TermsService
[Code].....
View 1 Replies
Feb 14, 2009
Two.JPG
I have build a Car class as follows:
Code:
Public Class Car Dim CarState As Integer Dim CarPicture As New PictureBox
Public Sub DriveIn() 'This sub to drive in the car to the lot. CarState = 1 Dim x As Integer For x = 1 To 45 If x <= 12 Then CarPicture.Top -= 3 Threading.Thread.Sleep(100)
[CODE]...
Then i tried to instanciate many objects of this calss to move more than one car as follows:Public Class Form1
Private Sub btnDrive_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDrive.Click 'Dim objCar As New Car() Dim objCar As Car objCar = New Car objCar.DriveIn() End Sub
[CODE]...
But unfortunately no car moved.
View 10 Replies
Mar 22, 2012
I am working on a VB NET project and had the strangest thing happen.I created a class file(just like a dozen or so I have already created). I wrote in the code to access it. The autocomplete found the class, filled it in and colored it blue, just as it should.But, when I run the app, I get a type is undefined error.
There is nothing in the class yet. And there is really no code to post..it is as straight forward as I described.I tried restarting VS; Deleting and recreating the class; Deleting the class and creating a new one with a different name.
Is there something in the VB NET configuration I can check to see if it is not being added somewhere?
I found the problem. I have 2 projects in one solution. They both share some classes that were trying to use my new classes. When I hit F5, both projects are compiled, and since I hadn't shared the classes with the second project, it errored.
So, now my question is changed; How do I specify to only build the specified Startup Project when debugging?
View 1 Replies
Mar 3, 2012
Is there a way I can have my VB application run Flash in my VB window and communicate with like the variables, objects, and other stuff in the Flash movie? Such as if I wanted to get a variable or set a variable in the Flash window.
View 2 Replies
Sep 29, 2010
I am Newbie in XMPP . I want to create chat application in VB.net using XMPP .i am having ejabberd serverin my pc.i dont know how to intract with ejabberd server via VB.net.
View 1 Replies