Sharing Data Between Multiple Projects In Single Application?
Jun 11, 2011
I have a windows forms application with one exe and several dlls(Class libraries) in a single solution. The application uses common data that is used across all the dlls. I would like to load the data when the application is starting up and use the loaded data at various points in the dlls so that I do not have to load the common data again and again. How can I share the data loaded in main EXE across the DLLs?
View 2 Replies
ADVERTISEMENT
Apr 19, 2008
I originally developed a simple application software [VB.Net + MS Access] (Lets call this project A) but now I want to include more functionality in it. I have an encryption/ decryption software utility (Lets call this project B ) and a Text to speech generation utility(Lets call this project C) . That is, I want to add Projects B and C to project A. [Such that clicking on the main form of project A calls a form from project B or C as desired].In solution explorer, I right clicked--Add Existing Project--and added both the above mentioned projects 1 by 1. (Added B and C to the solution explorer with the already present A).As the application software's (Project A's) main form is the main form of my project, I want to have a menu option on the main form (Of Project A) so that a user could click on one of the menu options and the main form of my other projects ( Project B or Project C or Encrypt/Decrypt or Voice Generation) should open by him doing so. To this effect, I tried the following:
1. I dragged the form simply from one of the projects (From B or C ) into the folder of my Application Software (Project A).This generated a lot of Build errors and the Voice Generation utility (Prj. C) would not work like this.
2. Tried to reference a dll, however the authors of Projects B and C did not include a dll in their projects.
3. Now I came to know that to call a form residing in another project folder or even another folder within the same project, you have to give a path for the form. HOW DO WE DO THIS?
As you can understand, I cannot copy the entire code of the 3 projects here....I will try attaching my project here though..Here it is: http: rapidshare.co...MY_Prj.zip.html[Dear Administrator: The downloading option on the webpage does not allow files bigger than I mb, thts why I used an external link]As I said, in the application, Project A is TMS.NET ; Project B is EncryptFile and Project is C.I encountered a problem while adding project C [spoken word], so the project contains only projects B and A. I will try to attach project C seperately.That is, TMS contains proj A+B and Speech contains C.
View 4 Replies
Jun 17, 2009
I've developed a couple of different stand-alone projects, myRibbonRTF and myRibbonCalendar and have them functioning well. I want to tie these together with other projects in a single solution called myMain. When I add these projects to the solution, their forms are not accessible in myMain (e.g. myRibbonRTF.frmMain.Show()). I've searched high and low for the last week trying to solve this and the only nearby solution is to turn the other projects into .dlls and access them in myMain that way.
View 7 Replies
Jul 7, 2011
I know a little about threading and delegates, as well as socket programming. I'm working with a VB.NET-compatible SDK called TrueVision3D to create a small online game for me and my friends. The problem is that I cannot for the life of me figure out how to pass data from one thread to another. I've created 2 seperate threads on seperate forms.
The first thread is created on a form titled FrmLogin, and it contains all the socket code. I need to be able to update variables in the second thread, which mainly consists of a render loop. The second thread is created on a form titled FrmMain. I'm not quite sure if it matters what forms the threads are created on, I'm just trying to give as much information about the issue as I can. I've tried using delegates and events to pass information from the thread back to the form it was created on, which works fine, but how do I pass data to the second thread from the first?
View 1 Replies
Sep 13, 2011
My question is in two parts:
1) I am writing an application for a touchscreen which will have several different Forms - each of which will be full-screen. What is the best way to achieve this? Hide/show each Form as the user navigates between screens? MDI Parent with multiple Child Forms becoming visible 'on top'? Or is there a more elegant solution?
2) I would also like a 'banner' on the top of each Form (or always visible on the top of the MDI Parent, etc) similar to a 'navigation frame' on a website. This banner will display a clock with the current time, and the current GPS location (meaning that a Timer will be used to get/set these values every 1000 milliseconds). I thought of using a UserControl for the banner - but if this is used on multiple Forms then I will end-up with multiple Timers all waiting 1000 milliseconds to update essentially the same information.
Is there a best practice for this type of scenario? - my thoughts so far are using the "Main" Form for Global Timers, etc - but then how do I update all Form clocks each second? (without iterating through all visible Forms... which seems messy).
View 5 Replies
Dec 2, 2010
How can I have code-sharing between two projects without making a dll?
The issue is: I have a tool that syncs users & groups from LDAP to a database.
Now the tool is a windows service, but testing it as such is very difficult and time consuming.
Which is why I made a console application where I can test the LDAP syncing, and then just copy the respective sourcecode-files over to the service project.
But... keeping the common files in sync is a bit of a problem. I don't want to make a dll, because this probably creates me a problem with the 3rd project, a windows installer (for the service) where I have to use ExecutingAssembly path...
Is there a way to share the code without making a separate dll? Automagic statical linking, so to say ?
View 6 Replies
Jun 21, 2009
I have written a few different applications in the past few years, all of which are related in that they help users creating maps/levels for a certain game. I would like to 'bundle' all these applications together, into one application (and will later add more functionality to that). In it's most basic form, it would simply be one single Form with buttons, where each button opens the corresponding application.
[Code]...
View 8 Replies
Jul 22, 2009
I am working on a solution that contains 2 projects one to be built as an exe and the other as a service. Both projects will share a class for certian functions and properties. I would like to have both projects use the same physical file so when I make a change in one of the projects it is also made in the other.
This was simple to do in VB6 but as of yet I see no way to do it under dot net. It seems to want to make a copy of the file and place it into the project folder for the second project resulting in the need to either copy after every change or manually make the changes twice.
Anyone know if there is a way to have common files area for a solution so that any project within the solution has access to the actual file rather than a copy of it?
View 2 Replies
Jul 12, 2011
I want to use a form in two project.
I have developed it in one project, I now want to make it available to another project.
I have removed it from the project and moved the .vb & *.resx files to a directory for common modules.
I then go into my project select Add Existing item, select the .vb project and say Add as Link.
But now my form is missing - I just have the code.
I have two classes MyPanel & MyForm. MyForm was first, MyPanel second. It says they should be the other way round. When I swap them I get the message "to add componets to your class, drag them from the toolbox...."
View 1 Replies
Nov 23, 2011
I am currently developing a Windows service and I am am looking to use MEF to compose all of the services components at run time. The data access module (project) is using Entity Framework 4.1 and a Domain Service Class to perform CRUD operations on the entity model.
The problem I have is how to share the models outside the DAL project when composing the DAL into the worker class in the main project.
For exmaple this is one of the methods in the DAL contract interface
Function GetInspectionFaults() As IQueryable(Of InspectionFault)
This interface is currently in the DAL project (not the shared/referenced project containing the other contract interfaces) as it needs references to the entity model for the POCO types.
How do I shared these POCO types?
View 1 Replies
Jul 28, 2010
I have a solution with two projects. The main project connects to the second project via a reference, and the reference path is local to my machine. It looks like it references the .exe file.So when I publish the main project (ClickOnce), i get the following error:
Application validation did not succeed. Unable to continue.In the log file, under Error Details, it says
System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
- Reference in the manifest does not match the identity of the download assembly Project2.exe
- Source: System.Deployment
How can I include this second project? Should I publish it, then reference the published files? What do i reference? The .application file?Is there a way to just include this second project, so when I do publish the main project, the second one just goes along with it?
View 3 Replies
Mar 16, 2012
In VB.NET I would like to create a complicated data structure with multiple types of data stored in an array like format (see below). I am trying to create a data structure that would look something like this: [Name; xLoc; yLoc; zLoc; [Jagged Array]] Note: Name needs to be dimensioned as a string, xLoc and so forth as integers. The Jagged Array would look like this:
[Code]...
View 1 Replies
Dec 13, 2008
I have set the "Make single instance application" check box.And when my application version is 1.0.0.0 for example, it is OK and won't load multiple instances.But when I create a new version, for example 1.0.0.1, then I can run 2 instances of my application, when the 1st instance is 1.0.0.0 and the second instance is 1.0.0.1.What should I do to prevent this?
View 2 Replies
Apr 30, 2009
What I'm trying to do - VB 2005 express and sql 2005 express editions - Trying to set up just a basic hardware/software inventory program. As is I've got separate tables for computer and software licenses...with ComputerID and LicenseID primary keys respectively...where I'm bumping into walls is that I wanted to be able to link them together with a foreign key, for example the computer record would have a foreign key for LicenseID and when a license would get installed the ID would go in and there'd be a nice pretty link. However I run into scenarios where a computer might not have any software installed...or might have more than 1 software item. Or a single software item may be installed on 1 computer, multiple computers, or nowhere. It possible to have that single foreign key field link to multiple records from the opposite table?
What was originally suggested to me was to have a 3rd table called Installations. It'd have 3 rows...one named InstallationID as the primary key, and 2 foreign key rows named ComputerID and LicenseID that linked to the other tables, so that when a license was installed, a record would be added to the Installations table, and later on when we wanted to see where all a particular license was installed or what licenses a single computer had, the table could be filtered by computer ID or license ID and all matching records could be displayed. When I tried that out though I'm having a heck of a time getting the correct items to display.
Just as a basic test i set up a new form and dragged the tables onto it from the Data Sources window using "Details" view for each of them, so that it set up the table adapters and binding sources and navigator for me. I got rid of the auto-added labels + textboxes on the form and added just a couple new textboxes, 1 linked to the licenseID and one to another row i had in that table for productkey...tested it and it moves through the records fine and the correct data shows up in each box to correspond with the other. now though I'd like to add another control to display each of the ComputerIDs that are linked to the particular license being displayed in the other controls via the foreign keys routing through the Installations table, but I'm not having much luck.
View 1 Replies
Jun 9, 2011
is it possible to have a single report from two different tables? Because I have been reading articles that are saying that it is not possible and a subreport should be implemented? Can anyone clarify this for me?
I've been retrieving the fields that I need for my report with inner join sql statement and setting it as the data source of the report that I had created but it doesn't show up when the crystal report viewer is loaded. I had the correct syntax based on testing on what is retrieved by the statement, the only problem is how should it be shown in a single report.
View 3 Replies
Jan 2, 2010
a checkboxlist control on my page and each item relates to a boolean value column in a flat table on my sql server. I've worked out how to transpire checked listitems into the table ok, but I'm having problems auto populating the checkboxlist with the boolean (selected or not) columns.
View 5 Replies
Oct 17, 2011
I'm working on a program that is interacting with a simple Access database. When the form loads there need to be multiple text boxes that are bound to the same table and field in the database, Inventory_Table.Quantity, to display the quantity of the inventory. From there, orders are read into the system adjusting the inventory as necessary.
I need to specify what row these are each supposed to be bound to, because right now it is binding them all to row 0, which makes sense but is not what I want. Is this possible? Heres the code I have to bind currently.
txtTopQuantity.DataBindings.Add(New Binding("Text", myDS, "Inventory_Table.QUANTITY"))
txtLegQuantity.DataBindings.Add(New Binding("Text", myDS, "Inventory_Table.QUANTITY"))
txtFastenerQuantity.DataBindings.Add(New Binding("Text", myDS, "Inventory_Table.QUANTITY"))
txtShortQuantity.DataBindings.Add(New Binding("Text", myDS, "Inventory_Table.QUANTITY"))
txtLongQuantity.DataBindings.Add(New Binding("Text", myDS, "Inventory_Table.QUANTITY"))
txtWheelQuantity.DataBindings.Add(New Binding("Text", myDS, "Inventory_Table.QUANTITY"))
View 1 Replies
Feb 10, 2010
I have a winforms app access a database with 6 tables. Out of 6, I am showing 3 tables on three different tabs on my Form. However, I want to do it using a single binding navigator that will use / change the respective binding source dynamically, depending on the tab that is activated by the user. I have separate binding source for each of the three tables.
View 3 Replies
Dec 9, 2010
I am currently having a headache on how to solve this problem that i am facing.here is the situation:I have a combobox and a list box on the main form. The combobox will get the data from the ms access database.In the database, i have the details of a person's IC, Name and DOB say for eg on one entry I have D215311523C,SHAWN,13/04/1987
So now, my combobox on form load will show the list of dates in the database to allow the user to search base on the date itself by clicking on the selected date. So when the user clicks on the particular date say 13/04/1987, people in the database whose birthday is 13/04/1987 will be shown on the listbox.Meaning to say if i have 3 entries whose dates are the same 13/04/1987, 3 entries will appear. If there is only two entry, then two results will be shown.
[Code]...
View 1 Replies
Apr 19, 2012
I want to combine two projects into one i.e. image and audio steganography with a single .sln file. How do I connect them? I'm using Visual Studio 2008.
View 2 Replies
Dec 23, 2009
Say I have a code with 3 methods that do some pretty intensive work. Would executing these methods on 3 seperate threads be faster then executing them one after the other on a single core cpu? And what if it's a dual core or HT?
View 8 Replies
May 26, 2009
In vb.net 2.0 is it possible to declare a variable globally so that it is visible to all projects of a single solution?
View 1 Replies
Dec 4, 2009
I am a fairly rookie programmer who is trying to learn the basics of n-layered architecture (DAL, BLL, UI). The application I am programming is a single tier, 3-layer application written in VB.NET (.Net 3.5). Layers as follows:
DAL
BLL
UI
COMMON - contains DTO's right now.
I am having trouble determining what to pass between my BLL and UI. My instinct tells me that I should only pass data to the UI, and not the full business object from the BLL. Consider two scenarios:
1) Pass the BO directly from BLL to UI. This exposes BO methods and allows the UI direct access to the BO, which seems bad.
2) Pass only the pertinent data from the BO to the UI. For instance, a customer has a Name and Address. This data is really what we want to show/edit in the UI, so we would only return that data to the UI instead of the full BO. The UI would then call to the BLL to update a specific BO.
I am inclined to use #2, but I don't know the best way to implement it. The way I have it programmed now, if I only return data from the BLL, all references to my BO's will be lost and the GC will claim them. Based on this, I have some questions:
1) Should I keep business objects alive between calls to the BLL? The alternative is to re-create them every time I pass data through the BLL, which seems wrong.
2) What is the best way to keep a BO alive in a single tier architecture (how to hold a reference if we dont pass it to the UI?)
3) How do n-tier applications do this? Do they keep the BO's alive in the BLL and wait for an update from the UI? Doesn't this require a lot of "book keeping" in the BLL to make sure BO's are released when they are no longer needed?
View 2 Replies
Aug 4, 2010
I have an application that needs to perform a series of different actions at specific points in time.To do this I have a timer with various actions that occur in its tick event.One possible action is to send out a few messages via a serial port and then wait (between 1- 300 mins typically) for the next timer tick.Another possible action is to continuously toggle one of the control lines on the serial port until the next tick (again 1-300 mins).
In most instances, i'm happy for everything to run on the main thread, but in the case of toggling the line endlessly, I thought it better to give it its own thread.My problem is that for the new thread to use the Serial Port, it must open the port. Likewise, it must close it before the main thread can have it back.
Here are 2 code snippets
Private Sub activityTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles activityTimer.Tick
Dim some variables here
activityTimer.Stop()
If speedThread.ThreadState = ThreadState.Running Then
[code]....
View 4 Replies
Sep 7, 2010
I'm starting to put in a database into my application, however I'm drawing a blank on how to share a database connection among the dozen or so different forms in my MDI application. I'm assuming this has to do with interfaces or something but I can't find any relevant examples anywhere. Can someone help me out? Ideally what I'd like is when the app is loaded up there is a call to a function in the forms loading area which establishes a single connection to the mdb, that I can then call via any form so I don't always have to open/close connections everytime I need to update the db?
Here's a basic example of the mdb database access code I've got working:
Dim dt As DataTable = New DataTable()
Dim OleDbTran As OleDbTransaction = Nothing
Using connJET As OleDbConnection = New OleDbConnection("connection string here...")
[code]....
View 1 Replies
Nov 10, 2010
I have the following code... in an MDI application. [code] Various lines of code which put data into the Myinstance and then save the instance into the ArrayList.I have buttons which run procedures and functions in the formchild and also in the Class1. I need it so you can jump between formchild instances, and when you do so and click a button on that form, it will run the Class1 code but using the data in the arraylist and myinstance that was set previously by the selected formchild. Then if you switch to another child it uses data from this form. Can this be done by declaring the arraylist with more dimensions and then refer to the records with the index of the selected form instance, e.g.Selected Child is index(3)
View 1 Replies
Nov 6, 2010
I have created an MDIparent form and a MDIchild. There is a button on the parent which makes multiple 'clones' of the child form, each time its clicked.I also want (maybe with a module) a set of variables, and array of a structure but these are available to each copy of the child, but each copy's variables, arraylist etc contain its own data?Therefore if you select child1 the variables and array will have different data to child2, child3...etc...
View 3 Replies
Jun 30, 2009
I am writing a program in VB.net (vs 2008) that requires that only one instance of the executable be running at a time. Naturally I went for the simple solution by selecting the "Make single instance application" checkbox in the Project properties. Unfortunately, this option does not seem to work across multiple users that are logged into a single XP machine, thereby causing the same issues for my program as if I were able to run multiple instances on one single user. Granted this is a corner case, that someone would switch users while my program is running, but I'd like to understand the limitations. So my question is whether the "Make single instance application" property is supposed to work across multiple users? or is it limited to only one-instance-per-user.
Here are the steps the recreate the issue (prereqs: computer with XP pro installed, 2 user accounts (not on a Windows Domain), and a dummy "single instance" program created using the property mentioned above):
1) Log in with user1, start up the single instance program
2) Switch to user2 (StartMenu -> LogOff -> Switch User)
3) Start up the single instance program using user2
*After step 3, the program launches without complaint even though another instance is running on user1. Is this a glitch? or by design?
View 2 Replies
Dec 18, 2006
I would like to build an application in vb.net which is some what similar to old net meeting and one of main feature I would like to implement is application sharing. I tried the netmeeting sdk provided by microsoft but it is very complicated (I'm new to vb.net and samples are in c++). developing this application or whether there is any third party sdks available for the same.
View 3 Replies
Apr 14, 2010
I am using Synclock to prevent multiple threads from logging text messages to the same file at the same time, but this doesn't seem to work:I get frequent sharing errors on the logfile, within the synclock block.The Synclock is using the variable holding the filename, because it exists all the time and because it is always the same object, whatever class instance or thread I'm in.[code]Despite using Synclock and a Using block around the code, I keep getting this error in the sw.WriteLine(Msg) line:System.IO.IOException: The process cannot access the file '(filename)' because it is being used by another process.Should I use some other type of object than a string to synchronize on?I cannot use a user interface object (button or so) because it is a windows service project.It was written and compiled in Visual Studio 2008, but targeting the 2.0 framework because it has to be able to run on some old Win2000 machines.
View 12 Replies