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
ADVERTISEMENT
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
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
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
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
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
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
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
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
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
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
Jul 28, 2011
create a COM dll in Visual Basic. [URL]I now want to use this dll in a C++ project. I used OLE/COM Viewer to create an .idl file as is described in the second half this tutorial.[URL]I compiled the .idl with the midl compiler and included the .h file that was created in my c++ project.Here is my Visual Basic Code
<ComClass(MyComClass.ClassId, MyComClass.InterfaceId, MyComClass.EventsId)> _
Public Class MyComClass
#Region "COM GUIDs"
[code]....
I receive the following errors when I compile my c++ project
error LNK2001: unresolved external symbol _CLSID_MyComClass
error LNK2001: unresolved external symbol IID_MyComClass
View 1 Replies
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
Nov 12, 2010
I am creating a project that will execute DOS command, for example a have a Button and by clicking it it will execute the command in cmd.
For example I want to execute this simple command " ping google.com -t". how to do it?
View 1 Replies
Jan 11, 2011
I believe one or more versions of VB.Net did away with "default instances" for Forms.
1) Was it in the 2003 or 2005 version(s)?
2) With the more recent 2008 and 2010 verions, is it possible to use a template or
change one of the files in the project so that default Form instances are not created?
I was recently looking at some of the other .Vb files in VB.Net 2008 Express Edition.
By the way, just so you know I could install a full version of Visual Studio if need be from;
2203, 2005, 2008 or 2010
View 5 Replies
Apr 25, 2012
figuring out which multithreading approach to utilize in my current work project. Since I've never written a multithreaded app in my life, this is all confusing and very overwhelming.I've been assigned to take over work on a control application for a piece of test equipment in my companies R&D lab. The program has to be able to send and receive serial communications with three different devices semi-concurrently. The original program was written in VB 6 (no multithreading) and I did plan on just modding it to work with the newer products that need to be tested until it posed a safety hazard when the UI locked up due to excessive serial communications during a test. This resulted in part of the tester hardware blowing up, so I decided to try rewriting the app in VB.Net as I'm more comfortable with it to begin with and because I thought multithreading might help solve this problem.
My plan was to send commands to the other pieces of equipment from the main app thread and spin the receiving ends off into their own threads so that the main thread wouldn't lock up when timing is critical. However, I've yet to come to terms with my options. To add to my problems, I need to display the received communications in separate rich text boxes as they're received while the data from one particular device needs to be parsed by the main program, but only the text that results from the most current test (I need the text box to contain all received data though).
So far, I've investigated delegates, handling the threads myself, and just began looking into BackgroundWorkers. I tried to use delegates earlier today, but couldn't figure out a way to update the text boxes. Would I need to use a call back function to do this since I can't do it in the body of the delegate function itself? The problem I see with handling threads myself is figuring out how to pass data back and forth between the thread and the rest of the program. BackgroundWorkers, as I said, I just started investigating so I'm not sure what to think about them yet.
View 1 Replies
May 5, 2010
For reasons that are beyond my control, I have three Projects. Projects A and B reference project C. Project A references project B so that it can open a large form in project B. I now need to open that large form from project C, but VB won't allow me to add a reference from C to B because that would create a circular dependency. I found a way around it, though. I created a Timer in A, and when I opened C from A, I passed in that timer. When the user performs a certain action, I enable the Timer from A, and this causes C to open B for me.
View 2 Replies
Jun 8, 2010
what is the right way of Multithreading in visual studio 2008.
View 1 Replies
Aug 10, 2010
I m making a project in which it check website about there status (Online / Offline) through there status code and when project is in processing it hang's until the whole line of code complete
[Code]...
View 5 Replies
Nov 15, 2010
i was developing Voice Chat Application in visual Basic .NET 2008 i try a lot methods to make installer for it :
1- i add Project Setup Project for my Project for Visual Studio 2008 Deploy & setup Type Projects and make it with output option and detect dependices
2- i try make it with Setup Factory 8.2.1
3- i try with MSI Factory 2.0
4 i try with Setup Factory 6.0
and after making installer copying it to my test virtual Machine or my friend lap and install it i get this error when try to run my application :
[Code]...
View 3 Replies
Oct 4, 2009
I am programming a chat like application using Tcp. Now I have a probem. I am going to have loads and loads of data being transferred so I will have to use 4 seperate ports.[code...]
My problem is for me to use a maximum of 4 ports all together transferring data from the client(s) to the server(s) I will need 4 clients and 4 servers. I need to open 4 instances of 4 clients. I was going to put a client in a form and then when the client is running it creates 4 instances of that form but than there would be too much confusion going on. I think there my be a way to use Classes instead of forms.
[code...]
View 6 Replies
Feb 6, 2010
My ultimate goal is to get a list of PIDs and have a user select 1 of them.For example: the process image name is program.exe. The application name varies for each instance the program.exe is run, and therefor each application name has its own PID associated with it. By application name I mean the Task name under the Applications tab of Windows Task Manager. Another issue I face is that some systems run x64, so the name is no longer program.exe but program.exe*32
So my issue is, how do I search for program.exe, or on x64 platforms program.exe*32, and if there are multiple instances of program.exe/program.exe*32 running, how can I get a list of PIDs for each and associated them with the application name as the Task name under the Applications tab of Windows Task Manager.that might sound a bit confusing! So if it is, please let me know and I will try to explain more. Any reference guides or example code would be greatly appriciated as I have only used the "System.Diagnostics" but once.
View 2 Replies
Dec 18, 2010
I want to download some imagefile from a multilinetextbox and right now i m using this code
Multiline textbox contains :
http://sitename.com/image/1.jpg
http://sitename.com/image/2.jpg
http://sitename.com/image/3.jpg
http://sitename.com/image/4.jpg
[Code]...
View 4 Replies
Dec 28, 2009
Im trying to put in a list of urls, start 2 new threads and in each thread dynamically add a webbrowser that will navigate to the url.Here is the code ive got so far:
This is after I click 'start'
[Code]...
View 4 Replies
Dec 23, 2009
I am using RaiseEvent in a thread and I pass a value to it and try to set a control's text to the value. Except I get a cross-thread error which is expected. I could invoke the control, but I don't want to have to do that.
My question is, is there a way to invoke/delegate the RaiseEvent itself so it will work on the ui thread without doing anything else?
View 4 Replies
Aug 18, 2009
What's the best way to prevent opening of two instances (or more) of the application?
View 6 Replies
Dec 7, 2011
i have a small prog to test the instances when i run another instance then i want to count it, ex. i open sample.exe this should be 1 in label and i open another instance of sample.exe this should be 2 in label how can i do this
i try this code but the instances count are not working
Dim count As Integer = My.Application.OpenForms.Count()
Label1.Text = count
View 9 Replies
Apr 14, 2011
I have created a background worker using a tutorial. I understand some basic stuff like how to update a label or a progress bar from inside of it. The purpose of this background worker is setup a bunch of variables that are going to be used by several other background workers later. The variables i am setting up are 6 different lists and a multi-dimensional array. The code looks like this for the background worker at the moment.
Private Sub My_BgWorker_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles My_BgWorker.DoWork
For i As Integer = 0 To m_CountTo
[code]....
I would normally use the persons.add to add something to the list, but I'm having a really hard time wrapping my brain around an easy way inside of the backgroundworker to add new values to several different lists(which are going to vary in amount of data values). Is there an easy way to do this? I'm used to just having invokes at the top of a sub to do this but those don't seem to work inside of a dowork sub.
View 1 Replies
Aug 26, 2010
I have a function which has multiple arguments, but takes around 30 seconds to complete. Is it at all possible to put it under a thread?
VB.NET
Private Overloads Function XLSParse(ByVal WorkBook As String, ByVal CellFrom As String, ByVal CellTo As String) As Boolean
[Code].....
And it runs fine because it doesn't have any arguments. So is it possible to run a function on a seperate thread if it has arguments?
View 2 Replies
Oct 2, 2009
I'm working on a class that has multithreading in it, this class has events that are being raised (raiseevent) in a new created threads within the class, for example:
[Code]...
Now when I load this example application an error is raised up saying that there is a cross thread error (Cross-Thread operation not valid control 'Text1' accessed from a thread other than the thread it was created on.) Now I don't want to handle this error within my form (editing the code in the form) what I want to do is to fix this problem within the class (I guess something with invoke?)
View 12 Replies