Thanks for your reply. 1. Yes, CComManager is mine. In my code it returns the HWND of the (login) dialog that called the working thread. The (login) dialog was intialized by the main thread. The working thread needs to post a message to this dialog. But all the messages sent by the working thread are lost. 2. It's a win32 application. How do i get the Main window handle? Thanks again for your help. Snir_ya.
snir_ya
Posts
-
PostMessage to a different thread's messageQueue -
PostMessage to a different thread's messageQueueMore Clarifications: The calling thread returns right after initializing the working thread. The working thread should notify the main thread asynchly when his job was done. The notification message (::PostThreadMessage(...)) isn't caught in the main thread message proc. Thanks again. Snir_ya
-
PostMessage to a different thread's messageQueueHere's the relevant code:
void RunAuthenticate(LPVOID pThreadId); //decleration void MyClass::Authenticate(std::string userName, std::string password, int *balance, HWND hwnd) { //working thread initialization m_threadNum++; HANDLE hThrd = (HANDLE)_beginthread(RunAuthenticate, 0, &m_threadNum); } //Global function void RunAuthenticate(LPVOID pThreadId) { HWND hwnd = CComManager::GetInstance()->GetCallingWnd(pThreadId); //return the calling window hwnd long proc; DWORD hThread = ::GetWindowThreadProcessId(hwnd,(LPDWORD)&proc); if(hThread != NULL) ::PostThreadMessage((DWORD) hThread,(UINT)THREAD_FINISHED, (WPARAM)status, NULL); }
Thanks. -
PostMessage to a different thread's messageQueueHi, In my win32 application i open a working thread using _beginThread(...). This thread preforms a certain work and when it's done it has to notify the main application thread. I'm implementing this by having the working thread to post a message (that will be processed by the main thread) and commit suicide (_endthread()). For some reason the posted messages of the working thread are not received in the other threads message proc. Does anyone have an idea? Thanks in advance. Snir Yarom.
-
CRT Dependencies Detection - App DeploymentThanks for your reply. My release version runs smoothly from within VS. Problems like those you describe would have prevented it from initializing properly even from within VS. Hence my guess that it has to do with the enveloping CRT environment. Running the exe from outside VS fails! Even on a computer that has a full VS installed. Snir.
-
CRT Dependencies Detection - App DeploymentHi, I'm using VS 2005 to create a win32 application. Now that i have my exe running i'd like to deploy my application and make it run on a dev-free environment. Does anyone have an idea how to detect the exe dependencies? Of course i've used the dependency walker and i've got a list of dlls that need to sit in the app dir beside my exe. But still, my exe won't run outside visual studio and i get "abnormal program termination". I'd highly appriciate your help. Thanks. Snir.
-
asp:CreateUserWizard background imageHi, We're trying to set the appearance of an asp:CreateUserWizard control to have a custom background image but without success. We tried to work with this object's style->background property but the images cannot be seen. Does anybody have a clue? Thanks in advance. Snir_ya
-
Create win32 modal child windowThank you so much Mark. You're answer is prudent and accurate. I must say that I have begun to doubt my coherency during this thread. There's an obvious correlation between one's willingness to help and his understanding of the question.
-
Create win32 modal child windowIntresring - i've followed each and every commandment stated in Chris Maunder's "How to get an answer to your question" and yet i'm being bullyied by a clown. Cheers mate. Chris - please revoke Mike's code project ribon.
-
Create win32 modal child window(-: "Best" as the most "lean and mean". No body guarentees anythings nowadays. Sheer advise, my friend. Sheer advise.
-
Create win32 modal child windowHi, What is the best way to implement a modal child window in win32? Thanks in advance. Snir Yarom.
-
Game loopCheers Jeremy and Mark - Happy new year to ya too.
-
Game loopHi all, I'm writing a game application with a main lobby where players can select a game which opens in a different frame window. Players can open several games at a time so actually there's only one view that needs to be rendered at a time. The game loop should respond to key and mouse events using directInput (directX). My question is where do i place the game loop? Should it be in the main application's run method? Should it answer onpaint messages on the currently active view? Thanks in advnace. Snir_ya.
-
Creating views in Top Level MDIExcellent. Using the the document as the bearer of the game type solves the problem. Thakns a lot. Snir_ya.
-
Creating views in Top Level MDIyes it can. Then?
-
Creating views in Top Level MDIHi, I have a Top Level MDI windows application. From the main frame users can choose a game. The game should open in a new frame window. This frame window should have a different view each time - according the game the user has selected. How do i intervene with the creation of the views of the frame windows? I have only one MainFrm class and one CView-derived class, which is enough. All i have to do is tell the view to draw a different backgournd each time (according to the selected game). Thanks a lot in advance guys. Snir_ya.
-
DirectX + (MFC or managed) C++Great. It's all clear now. Many thanks ;) Snir_ya.
-
DirectX + (MFC or managed) C++Thanks again Mark. You're very helpful.
Mark Salsbery wrote:
In windowed mode, then the same issues as above apply. In fullscreen mode, you don't have to worry much about windows. If you want your game to work in both modes, then you'll need windows.
What do you mean by "windowed mode"? we do intend to give the users the option to play in full/partial screen mode. So by "you'll need windows" are you refering to the obligation to use the doc/view windows architecture? Snir_ya.
-
DirectX + (MFC or managed) C++Thanks for your answer Mark. I'm developing a casino application with a lobby as the main win. Selecting a game from the lobby menu opens the game in another window. You're saying i can open the game in a dialog. Does that make sense? Besides, i'm still perplexed by which windows architecture i should use. View/Document (MDI) or dialog based. These are critical issus that i'm facing right now. The directX requirement complicates things even further. I'll appriciate your advise. Thanks. Snir_ya.
-
DirectX + (MFX or Managed) c++ - an advise needed!Hi, We're currently implementing a game application using directX with MFC. We have came across the option to use windows forms (in C++) which will simplify the GUI dev. Since one of the requirements is to support Win2000 clients (estimated around 5% of the global PC market!) the trade off is the CLR redist package that we'll have to bring along. My questions are: did anybody wrote windows forms in c++ with DirectX? If so, what are the cons and pros? And in general is it a good idea to use managed c++ with directX. I'll appriciate experienced answers. Thanks in advance. Snir_ya.