I have a question about C++

Asked 2 years ago, Updated 2 years ago, 101 views

There are programs 1 and 2.

Importing and using the same dll/lib However, after changing the value of the variable in dll in program 1, run program 2.

I want to use the dll value changed in program 2, but only the initial value comes out

do the changed value can come from?

c++ dll

2022-09-21 19:16

1 Answers

Data cannot be shared because different programs (processes) have different address spaces in memory (called separate process address spaces). For Windows, WM_COPYDATA message to transfer data between processes.
There are many other mechanisms. You can choose the most comfortable one according to the situation.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx#base.using_the_clipboard_for_ipc


2022-09-21 19:16

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.