Click here to Skip to main content
15,886,806 members

Comments by Philippe Mori (Top 200 by date)

Philippe Mori 25-Jun-17 7:45am View    
Standard auto_ptr class has known problems... so your code based on its implementation. If you have a modern C++ compiler, better to use unique_ptr or shared_ptr instead.
Philippe Mori 25-Jun-17 7:42am View    
PostThreadMessage is one mean of communication amoung others... Usually, it means that the receiving thread is the UI thread although you can also create an invisible window for that purpose. However, in your case maybe another mean of communication might be more appropriate but we cannot know without having an idea of what kind of interaction is need between those threads.
Philippe Mori 25-Jun-17 7:38am View    
Don't use C style cast. Here you should use static_cast.
Philippe Mori 25-Jun-17 7:28am View    
Learn C++ and multithreading. You have to understand the lifetime of an object. For example, your Create function timer is local to the function. Without such basic knowledge, you should not attempt to do multithreading... as you need to understand what you do first....
Philippe Mori 23-Jun-17 10:17am View    
Your question is not clear... If you want to translate the code to C# code then Solution 1 is the way to go. If the code above is what you have tried so far to interop between C# and C++, then you need to explain your problem. Also, in practice the best solution depends a lot on the actual C++ code as you many options (port code to C#, P/Invoke and mixed-mode C++ to name a few).