Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Have two projects 'talk'

Posted on 2006-06-02
12
Medium Priority
?
180 Views
Last Modified: 2010-04-23
I've written one app that scans a remote share and creates an excel spreadsheet of the findings.
In my other app, I'd like to 'paste' the other app's form class and pass the value of my primary form's txtShare to txtShare of the 'imported' form.  I'm not quite sure if it's as simple as 'loading' it (which I've yet to learn how to do in .net) and then assigning the value of that form's text box to the primary's?
0
Comment
Question by:sirbounty
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 800 total points
ID: 16820703
1) You can link a class from one project to another:

   https://filedb.experts-exchange.com/incoming/ee-stuff/162-Add-Existing-Item---Link-File.PNG

2) I don't think that is what you are going to want.

3) You use Windows API functions to get the text from the TextBox control on the other form

Bob
0
 
LVL 67

Author Comment

by:sirbounty
ID: 16820721
I just added existing into my project.  Is that the 'wrong' way to do it?

I was trying this in my main form's 'leave' routine:

       frmScan.txtShare.Text = Me.txtShare.Text
But I'd then need to generate a keydown...how?
0
 
LVL 67

Author Comment

by:sirbounty
ID: 16820724
Or I guess I could hide a button and make it my form's "accept"...?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 96

Expert Comment

by:Bob Learned
ID: 16820757
1) .NET version?

2) What type of project is #1

3) What type of project is #2

4) Are you looking to have project #1 do all the scanning for project #2?

Bob
0
 
LVL 7

Expert Comment

by:5thcav
ID: 16820791
Sounds like he just needs a shared string in a modual
0
 
LVL 5

Assisted Solution

by:mydasx
mydasx earned 200 total points
ID: 16821097
old school way:  write to a file then have the other app look for changes in the file
new school way: write to an xml file while the other app polls the xml file
new school way: windows message queue
0
 
LVL 5

Expert Comment

by:mydasx
ID: 16821099
note:  file locking will be needed for either the xml or flat file approach.
0
 
LVL 67

Author Comment

by:sirbounty
ID: 16824414
Sorry - cable has been out...

1) .NET version?  = 2005

2) What type of project is #1  
3) What type of project is #2

I'm not sure these really matter now?  I've combined the two - and it's 'working'

4) Are you looking to have project #1 do all the scanning for project #2?

How to answer this... Um - I just used the 'leave' routine for the related text box to kick off the 'accept' routine of the other form (I went ahead and made the hidden button).  

But...is there a 'better' way?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16824460
I don't really understand what you have described, so it is difficult to suggest a "better" way.  A better way of doing what?  You probably can't see where I am not getting it, huh?  ;)

Bob
0
 
LVL 67

Author Comment

by:sirbounty
ID: 16824478
Sorry 'bout that - let me detail what I'm doing now.

On (we'll call it Form1), I have txtShare.

On Form2 - I have another txtShare.  Now this form was actually just 'imported' into this project.  By itself, it has the text box that when a share name is entered, it scans that share for different file types and creates an output report in Excel.

So, after importing it, I needed Form1 to call that same function from Form2.
So, I just created the following to do just that (though I'll probably make this into a button or check box to initiate it, since it should be up to the user if they want to scan now or not)...

    Private Sub txtShare_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtShare.Leave
        frmScan.txtShare.Text = Me.txtShare.Text
        frmScan.AcceptButton.PerformClick()
    End Sub

But as far as the method I'm using (the 'AcceptButton.PerformClick') - that an okay 'solution' for me here, or am I forcing a square peg into a round hole?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16824649
If it is OK with you, I can't see a better way.  

If you get a big hammer, you can always get a square peg in a round hole, BTW *LOL.

Bob

0
 
LVL 67

Author Comment

by:sirbounty
ID: 16824664
;^)
Cool...just wanted another opinion.
Thanx Bob.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question