Global variable's scope through a solution
-
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)
-
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)
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]