4 Replies - 5315 Views - Last Post: 14 August 2012 - 01:03 PM Rate Topic: -----

#1 Criel  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 128
  • Joined: 11-March 11

Can you pass values between two different projects?

Posted 13 August 2012 - 09:05 AM

Hi,

Passing data between two forms in the same project isn't an issue but is it possible to do it between two different projects? I need to have an option on one form where if it's checked it will alter what the code does on another project. Is this at all possible?
Is This A Good Question/Topic? 0
  • +

Replies To: Can you pass values between two different projects?

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4332
  • View blog
  • Posts: 12,127
  • Joined: 18-April 07

Re: Can you pass values between two different projects?

Posted 13 August 2012 - 09:47 AM

Are the two projects in the same solution? If they are in the same solution you should be able to reference one another given their namespaces. Just add a "using" directive in one project that brings in the namespace in the other project and you should be able to access code in the other project.

If they are in different solutions, you can of course use all the usual things like a database, file etc. You can even put your shared code into its own DLL or project and reference that by adding a link to it from both solutions.

Normally I would try and put both projects in the same solution so people working on the project can see there may be some referencing going on.

Hope that answers the question. :)
Was This Post Helpful? 0
  • +
  • -

#3 Criel  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 128
  • Joined: 11-March 11

Re: Can you pass values between two different projects?

Posted 14 August 2012 - 11:44 AM

Thanks for the reply.

I have been looking into this and have referenced the dll between the two projects however I'm not able to techincally 'pass' it between the two forms. I can see the variable I set from the first project in the second project however the value is always 'nothing'. Am I not passing it correct? What could be the reason the boolean value isn't sticking when I pass it?
Was This Post Helpful? 0
  • +
  • -

#4 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 448
  • View blog
  • Posts: 3,103
  • Joined: 12-January 10

Re: Can you pass values between two different projects?

Posted 14 August 2012 - 12:50 PM

are you calling it correctly?

like perhaps

class1 variableName

call to this class
class2

class1.variableName

Was This Post Helpful? 0
  • +
  • -

#5 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2256
  • View blog
  • Posts: 9,444
  • Joined: 29-May 08

Re: Can you pass values between two different projects?

Posted 14 August 2012 - 01:03 PM

The following tutorial maybe helpful in show you how utilise different projects.
Tutorial: Guessing Game
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1