MEF Import Is Creating Two Instances Of Every Part

Nov 25, 2011

I am using MEF to compose a number of components at run time but when I use a metadata attribute it double the number of parts in the collection.

When checking the container.ComposeParts I can see that the dll containing the 11 implementation of IStages is loaded once and only the 11 part required appear but when it resolves the Private Property Stages As IEnumerable(Of Lazy(Of IStages, IStagesMetadata)) the number of instances is doubled to 22. Looping through the collections I can see that they are duplicated by the ID in the metadata.[code]...

View 1 Replies


ADVERTISEMENT

Creating Instances Of An Object?

Nov 21, 2006

I'm trying to create 3 instances of the the Workshop selector form for the 3 individuals that I have inthe listbox to appear when I first run the program.

View 4 Replies

Creating Instances Of Own Class At Runtime?

Sep 3, 2011

info on creating instances of my own class at runtime. Simple project for family recipes but would like the option to add new recipes with new instances of my own food Item class at runtime. Creating my own class,no problem. Storing the data in an XML file, OK on that as well. My issue is creating new instances of different food item class as I use this program over time

View 13 Replies

Creating Multiple Instances Of A Form?

Aug 12, 2009

I have a form (form1) and I havea button on form1 (button1) that will start a second form (form2).How can I make it create multiple instances of form2 when button1 is clicked?i tried a process module that the studio comes as standard but it does not allow me to start multiple instances...how can i do this?

View 14 Replies

Creating Object Instances Globally?

Nov 19, 2009

this is probably something I should know, but I'm puzzled by this.I'm trying to create some objects and being able to access and modify these globally. I tried to create a Public Module and declare a few objects in this.I am able to access these from another sub, but I get an exception error when after building and runing the process and trying to modify these object. The same thing happens if I declare the object in the Public Class Form1. For example like this:

Public Class Form1
Public appWord = New Microsoft.Office.Interop.Word.Application
Public wordDoc as Microsoft.Office.Interop.Word.Document

[code]....

View 1 Replies

Creating Instances Of A Class That Has Several Readonly Properties?

May 24, 2011

What is an elegant way to create and initialise instances of a class that has several readonly properties? Passing all values in a constructor would not be very convenient.

The purpose is that instances are immutable after initialisation. However if the constructor is not used for initialising all the property values, then how can the readonly properties be changed from another class?

View 2 Replies

Creating Multiple Form Instances In A Subroutine?

Aug 23, 2010

I am trying to create a subroutine that creates multiple instances of a specific form.

Here is my code:Public Sub NewFormInstance(ByVal FormName As Form)

Dim FormInstance As New FormName
FormName.Show()
End Sub

View 3 Replies

Creating New Instances Of Form1 With Variable Properties

May 13, 2009

I'm trying to elaberate on some basic examples of .Net programming in using VB. The basic example of creating a new instance of Form1 is:
Dim x as New Form1
x.Show
I've added some OptionButtons to set the StartPosition of the Next Instance of Form1 as well as some Labels that display the Top, Left, Width and Height properties when the new instance of Form1 is Shown.

This is the code I'm using.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As New Form1
If Me.RadioButton1.Checked = True Then
x.Top = 0
x.Left = 0
[Code] ......

View 1 Replies

VS 2008 - Creating Instances Of Controls On Form?

Sep 14, 2010

Is it possible to create instances of controls on a form ? Of course I mean visually , not just by code. After all, these languages define themselves as "Visual" so they should provide that possibility. It is important for the instances to be visible during design time because otherwise we could only guess where those controls might "land". Nevertheless , I have the feeling this is not possible in VB .NET but still I thought I should ask first ...

View 11 Replies

VS 2008 Multithreading Or Creating Project Instances

Feb 15, 2011

I have been trying to create good multithreading programs and it is not working well considering the use of global variables, local variables etc and thread safe controls. I have not found a good way of doing it since it seemed to be not as efficient as just running it on a single thread.

The program accesses facebook and twitter api, parses etc. and I am wondering if I can just create new tasks and map the program project file and fire new instances of the project. Someone this using the taskfactory in 2010 but I thought this was just the same as the threadpool. on this: create windows services and set them to run on task scheduler??

View 2 Replies

VS 2010 - Creating Multiple Instances Of Subs

Jul 31, 2011

I'm creating a twitter account manager using the Twitter API. I have multiple accounts, over 10 of them. I want to automate all 10 of these accounts to do certain things, now the way I started to code the program was so that it would accommodate only one account, and all the codes worked perfectly and were managed by individual timers for individual processes that I wanted done. i could tweet between certain intervals, follow people who tweet certain things without me being on top of it.

Now the problem is that I've been trying to create new instances of subs that I've already created so that I dont have to create 10 new subs with the exact same procedures. I'm pretty sure it's impossible to create copies of subs dynamically or within a loop but it didn't stop me from trying. So question is how can I edit a program that was designed to accommodate and automate only one account, to potentially accommodate over a 100? I don't need codes or anything I need ideas so I can try them, but right now I'm completely blank.

View 2 Replies

Creating An Array Of Instances Where Instance Could Be Base Or Sub Class?

Oct 31, 2011

I have a class structure and am attempting to create an array of object instances from the class some instances are parents and some are children Code snippets,

Parent Class object
Option Strict On
Option Explicit On
Public Class cTransportItem

[code]....

View 1 Replies

Creating Pictureboxes Programmatically (part 2)?

Sep 7, 2011

I have the following code that attempts to create a picturebox at a set of coordinates, then move to another set of coordinates and create another one. I have two questions, first, how do you programmatically create each picturebox with a different name than the last one. I've attempted to address this in my code but not sure if it's right. Second, I'm getting an error when running the code: "controls created on one thread cannot be parented to a control on another thread" - how do i get around this?

[Code]...

View 11 Replies

VS 2005 - DataDirectory Part Not Working While Creating A Connection?

Aug 2, 2009

I did this simple insertion

Data is inserted when i do this:

[code]...

why is the DataDirectory part not working?

View 1 Replies

Multi Form / Part Application Need To Make Part Protable For Transfer

Feb 22, 2011

im making an application in vb.net (duh!) anyway i have created and coded the whole project and it performs exactly as i want it to (i dont need code help). my problem lies with the fact that my project is 2-3 parts

1.a setup form that gathers inital data about the enviroment stores this data encrypted in a config file. after inital setup this form is not displayed again. but needs to be run on both computers

2. the second form is the real application form im in the process of turning this part in to a background service anyway this form is the one that establishes the connection between two nodes it works correctly

3. the config files

anyway here is my problem i want to make this application distributional with just one file the (.exe) and have this .exe make everything else happen. it runs the setup form and creates the first config file which it does then it needs to produce a copy of just the second form and the config file to transfer to workstation #2 that will run independtly without the whole application which i cant make happen then it needs to turn both workstations application on by only starting one on either computer and invoke the other computer to start its corrosponding app also no idea how to make this happen any ideas or suggestions as to where to look to try to find my answers.im thinking i might need to make two seperate applications (a setup app, and the running app) and include them both in a project and use the setup.exe to to package them together this is a little side project that im making for my self to use to make programming a little easier so i plan on giving it out to some fellow students to test and tell me what they think so im not really worried about ease of use or complicated procedures yet but if it turns out to work and actually be of use to anyone else i would be willing to rewrite it to distribute to the masses but for now i just want it to work for me.

View 4 Replies

Creating A Namespace To "import" A Database Class In .net 2005?

Oct 28, 2010

I need to create a namespace for my database class file, so I can call the database procedures within my webservice module. How can I create a namespace to call that Db class file?

View 1 Replies

Compare Only Day Part And Month Part?

Jan 12, 2012

my requirement is that i have to count occurrence of a certain date and between two months
suppose i have 10-jan-2012 now i have a date range 1-jan-2012 between 1-feb-2013 my requirement is that if i find 10-jan between 1-jan-2012 between 1-feb-2013 irrespective of year i know that 10-jan will come twice between 1-jan-2012 between 1-feb-2013 i am not understanding how to do this.i meanto say that i have to compare only day and month part of the date which will solve my problem

View 1 Replies

Read Text File - Read The Top Part First Then And Match The Line With Bottom Part

May 21, 2009

in my text file i have two part. Called bottom and top. So i need to read the Top part first then and match the line with bottom part. Its like this

[Code]...

View 5 Replies

Import Into Access Using Import Specification?

May 10, 2010

I want to write a program in vb2008 that can import a text file into a Access 2000 database, but using import specifications already in the access database.

View 2 Replies

Add "whole" Part Of A Number To "decimal" Part And Store In String Buf?

Sep 14, 2011

One number is represented with four hex values.First two hex parts are my "whole number" part, third and fouth hex numbers are my "decimal" part. I just wanted to store my complete number (whole and decimal) in an excel table.My problem is following when I am storing whole part and decimal part of my number separately, then it works fine am getting f.e. 3017 and 0,9445123 in my excel table, but when I am concatenate them, then I am getting following expression in my excel table f.e. 30,179,445,123 but I want 3017,9445123.

rx_str_buf(str_cnt) = CStr(Convert.ToInt64((Hex(rx_str_buf(Factor + 7)) & Hex(rx_str_buf(Factor + 8))), 16) +
(Convert.ToInt64((Hex(rx_str_buf(Factor + 9)) & Hex(rx_str_buf(Factor + 10))), 16) / 65536))

[code].....

View 12 Replies

DAO Program - New Instances

Oct 4, 2009

I wish to develop a program using DAO to access an .mdb database in a data navigational way and avoiding SQL. I have defined workspace, database and recordsets with a "DAO." prefix and referenced the Microsoft DAO Compatibility Library. When debugging, my statement setting the reference for the defined database name to the physical database, causes the following error - "Object reference not set to an instance of an object." It seems that the "New" keyword should be used to create an object instance but a statement such as "Public Db as New DAO.Database" is not allowed because DAO.Database is an interface not a class.

How do I create an instance of the object in this situation?

View 9 Replies

Accessing Instances Of Classes

Jul 25, 2011

I am trying to make a pretty complicated, layered program.I have my main form which creates an instance of another form (addValue and myAddValue). From myAddValue I then want to access a few other classes to do various verification and other bits of code.Here though I have a problem.With the form ContactDetails, it just can't seem to read myAddValue.txtName or the others.If I try and read AddValue normally it says about it not being able to access a non-shared member (Expected that this doesn't work, it was just an attempt at something different)How do I read myAddValue from a class which isn't the one that created and isn't the one that it is an instance of?

View 3 Replies

Connecting To Multiple SQL Instances?

Jan 3, 2011

Any best method of managing multiple SQL connections .net (VB). My application connects to four instances of SQL Server (2000, 2005, 2008, 2008R2) restoring databases, modifying data and taking backups. In addition to managing databases the app also has its own DB (on the 2008 instance) for storing various data. I'm using two methods to connect to the instances, SMO (For backups, restoring and retrieving information about the databases, size etc) and SqlClient for querying each database for many tasks such as updating fields and executing sql scripts.I have multiple forms for performing various tasks so there are many places I'm opening / closing connections.

Would it be best to maintain a persistent global connection to each instance from the application? (Two in total, one for SMO and the other for SqlClient) or open close a connection for each task I'm performing?) I'm not using LINK as I need the tasks to be as fast as possible. The connection string will differ on each connection (Based on Instance and Database being connected to) how would I manage this? A string in the config file for the applications database would make sense, as that would be static but the databases being worked on will vary with each connection. Currently I'm creating a connection for each instance within the main form:

Dim 2000Connection = New SqlConnection("Data Source=" & SQLServerName & _
"SQL2000;Initial Catalog=Master;User ID=sa;Password=P@ssw0rd;Pooling=True;")
Dim 2005Connection = New SqlConnection("Data Source=" & SQLServerName & _
"SQL2005;Initial Catalog=Master;User ID=sa;Password=P@ssw0rd;Pooling=True;")
Dim 2008Connection = New SqlConnection("Data Source=" & SQLServerName & _
"SQL2008;Initial Catalog=Master;User ID=sa;Password=P@ssw0rd;Pooling=True;")
[Code] .....

View 1 Replies

Counting Instances In Bindingsource?

Mar 7, 2012

Is bindingsource.count only used to give the total items in a list? I'm trying to prepare data for a pie chart, and need to count the instances of different items in a column (If there's a way that the Chart will do this itself, I've not been able to find it, it seems to need linked items and values). The bindingsource is already filtered and would prefer not to combine filters.Would it be best to loop through the rows of the column and count them 'manually' or is there a quicker way of doing this?Put it in a datagridview? Is it possible to use Aggregate Count on a bindingsource?

View 4 Replies

Counting The No Of Instances Of A Word

Jun 5, 2011

i need to count the no of instances of a word in a string using vb.net i can do the usual way as my problem is a little different for eg i need to count the no of occurrences of -> in tree_ptr->sub.another->valu=3;

View 9 Replies

Create Different Instances Of A Form?

May 1, 2011

The below Code is written inside the Timer Tick event. It works fine as long as the Time and Date are not same. When the Time and Date are same it only displays 1 message. How can I show multiple message for the same date and Time ? I think this can be done If I create different instances for a form. But I don't know how many same time and Date will be there in the database. So I can't do that.

Dim frm As New frmMessage
Dim nowDate As String = String.Format("{0:M/d/yyyy}", DateTime.Now)
Dim nowTime As String = String.Format("{0:h:mm tt}", DateTime.Now)

[Code]....

View 1 Replies

Get Track Of All New Instances Of Classes

Jul 26, 2011

when i create a class ( ie ahuman ), i declare a object (ahuman) , i give it properties and with the properties i also can set the property ahuman , by creating the property ahuman (new) and set its variables, and declare its variables by declaring properties like weight, lenght, female or not.the problem for me is that i have multiple forms multiple class files , i cant oversee how to get track of all the new instances of classes.it is much easier to use pulbic shared properties to use a method in another class.

View 1 Replies

Handling Instances Of A Form?

Aug 5, 2010

(simplified) I have a button in form1 that creates an instance of a form2, fills some data unique to that instance, and shows it. This data should be unique. Any attempt to create an identical form2 should fail, and instead bring to front the matching form 2, but if the form 2 is filled with different data (representing a different person) than it should be created.

View 3 Replies

How To Count Instances Of EXE On Server

Oct 15, 2009

I have an exe that runs from the server. The instances are shown on the server. So the questionis how can I get the following code to count the instances on the server.
HTML
Dim oProcess As Process
Dim nCount As Integer = 0
For Each oProcess In System.Diagnostics.Process.GetProcessesByName("MSTP")
nCount = nCount + 1
Next
(MSTP is the name of the application's exe.)

View 3 Replies

How To Create Instances Of Different Browsers

Feb 6, 2011

I am able to create internet explorer instance by using SHDocVw.InternetExplorer, how to create instances for google chrome / mozilla fire fox / opera browsers.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved