How to implement a Singleton in an application with DLL

前端 未结 3 1427
闹比i
闹比i 2021-01-22 05:14

I have an application (in MS Visual Studio) that contains 3 projects:

  • main (the one that contains the main function)
3条回答
  •  粉色の甜心
    2021-01-22 05:50

    When I ran into this same problem I solved it by creating another DLL whose sole purpose is to manage the singleton instance. All attempts to get a pointer to the singleton call the function inside this new DLL.

提交回复
热议问题