Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Global variable's scope through a solution

Global variable's scope through a solution

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharphardwarehelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Albert Jann
    wrote on last edited by
    #1

    I've got VC++ .NET solution with more than 3 projects. I'd like to add another (proved as working) project, which mainly producing strings (stimulated by an external hardware equipment connected to com1). Let's call the added hardware project as "Har" and to existing DLG project to whom I'd like to transfer the strings as "MDlg". My problem is to "transfer" generated strings from Har to MDlg in the solution scope. In the project scope I have no problem to do that by: 1) Declare in one cpp file a string variable and declare it in other cpp files as extern, works - no problem. 2) Define base class with static string variable and inherit other relevant cpp files from this base class, works - no problem. Problem is that above 2 technics aren't working in the solution scope and generating link errors :confused:. How can I solve the problem (please don't suggest me to incorporate Har into MDlg, not in my lifetime :-O)

    N 1 Reply Last reply
    0
    • A Albert Jann

      I've got VC++ .NET solution with more than 3 projects. I'd like to add another (proved as working) project, which mainly producing strings (stimulated by an external hardware equipment connected to com1). Let's call the added hardware project as "Har" and to existing DLG project to whom I'd like to transfer the strings as "MDlg". My problem is to "transfer" generated strings from Har to MDlg in the solution scope. In the project scope I have no problem to do that by: 1) Declare in one cpp file a string variable and declare it in other cpp files as extern, works - no problem. 2) Define base class with static string variable and inherit other relevant cpp files from this base class, works - no problem. Problem is that above 2 technics aren't working in the solution scope and generating link errors :confused:. How can I solve the problem (please don't suggest me to incorporate Har into MDlg, not in my lifetime :-O)

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      WM_COPYDATA is your friend here :-) Look it up on MSDN Nish


      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups