Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Creating Thread (Read 2185 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Creating Thread

Hi,
I'm trying to create a thread and pass to it a metadb_handle_ptr:
Code: [Select]
virtual void on_playback_new_track(metadb_handle_ptr p_track) {
            
        if(cfg_zw_enabled)        
        {            
            if(hThread)            
                WaitForSingleObject(hThread, INFINITE);
            hThread = CreateThread(NULL, 0, ThreadProc, p_track, 0, &dwThreadId);            
        }

But im always get an error saying "can't convert to "LPVOID" from "metadb_handle_ptr". I tried casting and even p_track.get_ptr() but i get nothing. Can anyone help me ?

Creating Thread

Reply #1
Suggestions:

How about a cast in combination with get_ptr()?

Code: [Select]
hThread = CreateThread(NULL, 0, ThreadProc,
  reinterpret_cast<void*>(p_track.get_ptr()), 0, &dwThreadId);


Sorry, I'm not too familiar with how CreateThread works (I'm more of a _beginthreadex person).