-2

I am tring to make a DLL

My Exe Program calls the functions of DLL

In a certain function, i create a thread. The thread will take 30-40 minutes to finish

Meanwhile i have other things to do in Exe

enter image description here

We cannot do anything with the exe program. Actually it is a game server, which has the option to load plugins(dlls) and squirrel embedded so that we can call functions of dlls from script of game server.

habi
  • 125
  • 8
  • Maybe you need to have a look at [this](http://www.cplusplus.com/reference/thread/thread/). And it seems that you need some good C++ [books](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list). – Zheng Qu May 09 '20 at 10:06
  • The problem is either i have to wait for the thread to finish, which is not possible. Or i have to declare the thread somewhere outside and initialize inside the function. so that it will not loose scope. But not working – habi May 09 '20 at 10:10
  • I don't get your point. Please add a minimal reproducible example. – Zheng Qu May 09 '20 at 10:44
  • supplied the main question with a picture. – habi May 09 '20 at 11:04
  • Just make function1 returning immediately after starting the thread, and the exe will be able to do whatever it wants. Your question is not clear. – manuell May 11 '20 at 14:28

1 Answers1

0

I used winapi's CreateThread function and i got what was wanted.

habi
  • 125
  • 8