Click here to Skip to main content
16,007,885 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHelp with multi-column ListBox Pin
Eugene Pustovoyt17-Dec-01 1:23
Eugene Pustovoyt17-Dec-01 1:23 
GeneralRe: Help with multi-column ListBox Pin
17-Dec-01 2:23
suss17-Dec-01 2:23 
GeneralRe: Help with multi-column ListBox Pin
Eugene Pustovoyt17-Dec-01 2:50
Eugene Pustovoyt17-Dec-01 2:50 
GeneralRe: Help with multi-column ListBox Pin
Ernest Laurentin17-Dec-01 4:39
Ernest Laurentin17-Dec-01 4:39 
GeneralRe: Help with multi-column ListBox Pin
Eugene Pustovoyt17-Dec-01 8:17
Eugene Pustovoyt17-Dec-01 8:17 
GeneralTrackPopupMenu Fails in Thread Pin
17-Dec-01 1:14
suss17-Dec-01 1:14 
GeneralRe: TrackPopupMenu Fails in Thread Pin
Ernest Laurentin17-Dec-01 4:58
Ernest Laurentin17-Dec-01 4:58 
GeneralRe: TrackPopupMenu Fails in Thread Pin
17-Dec-01 8:49
suss17-Dec-01 8:49 
>> Why you want to create a popup menu from a worker thread?

Actually my real code does the opposite of my example. A worker thread gets sent a menu hierarchy via CORBA, creates a bunch of HMENUs and stores them in a table. Later on, when an item in a view is right-clicked, I look up the appropriate HMENU and create a popup.

When I started to debug this thing, I was sure that it was a threading issue and I thought that I couldn't share HMENUs across threads. I wrote a TestMenu app to check this theory out and I somehow flipped it so that the popups were being created inside the worker thread.

I've solved my problem though - a coding error in the worker thread was creating empty menus. Good HMENUs, but just no items. Still, in this instance and in my example code, when TrackPopupMenu was failing, it returns 0 and GetLastError is 0.

If TrackPopupMenu has its own message pump (as someone wrote in another post) and I pass a valid hWnd to TrackPopupMenu, why would it matter though if I called it from a non-UI (worker) thread?

thanks


GeneralCalculating sunrise and sunset times Pin
Prashanth Uppunda17-Dec-01 0:48
Prashanth Uppunda17-Dec-01 0:48 
GeneralRe: Calculating sunrise and sunset times Pin
Eugene Pustovoyt17-Dec-01 1:28
Eugene Pustovoyt17-Dec-01 1:28 
GeneralMultithread UDP Server using AsyncSocket Pin
dunkhong17-Dec-01 0:07
dunkhong17-Dec-01 0:07 
QuestionNIC information? Pin
16-Dec-01 22:59
suss16-Dec-01 22:59 
AnswerRe: NIC information? Pin
Joaquín M López Muñoz16-Dec-01 23:16
Joaquín M López Muñoz16-Dec-01 23:16 
Generalsecurity of .ocx Pin
marutis16-Dec-01 19:01
marutis16-Dec-01 19:01 
Generalstatic data member in MFC program Pin
Dave K Dosanjh16-Dec-01 16:28
Dave K Dosanjh16-Dec-01 16:28 
GeneralRe: static data member in MFC program Pin
Christian Graus16-Dec-01 16:47
protectorChristian Graus16-Dec-01 16:47 
QuestionHow can I print a bitmap file ? Pin
16-Dec-01 15:31
suss16-Dec-01 15:31 
AnswerRe: How can I print a bitmap file ? Pin
Christian Graus16-Dec-01 15:51
protectorChristian Graus16-Dec-01 15:51 
GeneralRe: How can I print a bitmap file ? Pin
Chambers17-Dec-01 7:56
Chambers17-Dec-01 7:56 
GeneralRe: How can I print a bitmap file ? Pin
Christian Graus17-Dec-01 10:15
protectorChristian Graus17-Dec-01 10:15 
GeneralRe: How can I print a bitmap file ? Pin
Chambers18-Dec-01 0:42
Chambers18-Dec-01 0:42 
GeneralRe: How can I print a bitmap file ? Pin
Christian Graus18-Dec-01 10:04
protectorChristian Graus18-Dec-01 10:04 
GeneralRe: How can I print a bitmap file ? Pin
manio18-Dec-01 18:32
manio18-Dec-01 18:32 
GeneralRe: How can I print a bitmap file ? Pin
Christian Graus18-Dec-01 18:50
protectorChristian Graus18-Dec-01 18:50 
GeneralRe: How can I print a bitmap file ? Pin
18-Dec-01 20:53
suss18-Dec-01 20:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.