Click here to Skip to main content
15,902,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Problem in Value of Radio button? Pin
Rajkumar R9-May-08 22:12
Rajkumar R9-May-08 22:12 
QuestionHow to PostMessage from dll to Win32 appication Window procedure Pin
Abhijit A9-May-08 21:13
Abhijit A9-May-08 21:13 
AnswerRe: How to PostMessage from dll to Win32 appication Window procedure Pin
alex7869-May-08 21:23
alex7869-May-08 21:23 
GeneralRe: How to PostMessage from dll to Win32 appication Window procedure Pin
Abhijit A9-May-08 21:41
Abhijit A9-May-08 21:41 
QuestionRe: How to PostMessage from dll to Win32 appication Window procedure Pin
Rajkumar R9-May-08 21:56
Rajkumar R9-May-08 21:56 
AnswerRe: How to PostMessage from dll to Win32 appication Window procedure Pin
Abhijit A9-May-08 22:07
Abhijit A9-May-08 22:07 
GeneralRe: How to PostMessage from dll to Win32 appication Window procedure Pin
Rajkumar R10-May-08 0:33
Rajkumar R10-May-08 0:33 
GeneralRe: How to PostMessage from dll to Win32 appication Window procedure Pin
Abhijit A10-May-08 0:59
Abhijit A10-May-08 0:59 
yaa I am also able to PostMessage inside Init fuction but i want to PostMessage by
see below
#include "Work.h"

CWORK *pObj=NULL;
HWND hMyWnd;

MYAPI int CALLBACK Init(HWND hWnd)
{
hMyWnd=hWnd;
pObj=new CWORK();
}

in WORK.h

#define WM_MYMSG WM_APP+10001
class CWork
{
public:
CWORK();
~CWORK();
Initialize();
}

In WORK.cpp

UINT ThreadMyProc(LPVOID lpObject);
HANDLE hThread=NULL;
extern HWND hMyWnd;

void CWORK::Initialize()
{

hThread = CreateThread(
NULL, // default security attributes
0, // use default stack size
ThreadMyProc, // thread function
(LPVOID)this, // argument to thread function
0, // use default creation flags
dwThreadId); // returns the thread identifier
}


}

UINT ThreadMyProc(LPVOID lpObject)
{
CWORK pWork=(CWORK*)lpObject;

while(true)
{
some conditions...

then I use
PostMessage(hMyWnd,WM_MYMSG,0,0x002);

}
return 0;
}

so as shown above when I PostMessage from ThreadMyProc it shows error in main application

Please check and give me suggestion anything wrong in this code and if possible givw solution that how we can post message from thread to main application.

abhi

GeneralRe: How to PostMessage from dll to Win32 appication Window procedure Pin
Rajkumar R10-May-08 1:46
Rajkumar R10-May-08 1:46 
GeneralRe: How to PostMessage from dll to Win32 appication Window procedure Pin
Abhijit A10-May-08 1:57
Abhijit A10-May-08 1:57 
GeneralRe: How to PostMessage from dll to Win32 appication Window procedure Pin
Rajkumar R10-May-08 2:47
Rajkumar R10-May-08 2:47 
QuestionDynamic menus related problem Pin
ritz12349-May-08 20:52
ritz12349-May-08 20:52 
AnswerRe: Dynamic menus related problem [modified] Pin
Rajkumar R9-May-08 21:06
Rajkumar R9-May-08 21:06 
Questionthe application has failed to start because its side by side configuration is incorrect. Please see the application event log for more details Pin
Le@rner9-May-08 18:48
Le@rner9-May-08 18:48 
AnswerRe: the application has failed to start because its side by side configuration is incorrect. Please see the application event log for more details Pin
Rajkumar R9-May-08 20:45
Rajkumar R9-May-08 20:45 
GeneralRe: the application has failed to start because its side by side configuration is incorrect. Please see the application event log for more details Pin
Le@rner9-May-08 23:03
Le@rner9-May-08 23:03 
QuestionNeed your help Pin
Hungry Developer9-May-08 18:33
Hungry Developer9-May-08 18:33 
AnswerRe: Need your help [modified] Pin
Mukesh Kumar9-May-08 19:40
Mukesh Kumar9-May-08 19:40 
AnswerRe: Need your help Pin
CPallini9-May-08 20:42
mveCPallini9-May-08 20:42 
AnswerRe: Need your help Pin
Rajkumar R9-May-08 21:52
Rajkumar R9-May-08 21:52 
QuestionRegistry Pin
capint9-May-08 17:32
capint9-May-08 17:32 
AnswerRe: Registry Pin
CPallini9-May-08 20:31
mveCPallini9-May-08 20:31 
AnswerRe: Registry Pin
Hamid_RT9-May-08 20:32
Hamid_RT9-May-08 20:32 
AnswerRe: Registry Pin
capint9-May-08 21:02
capint9-May-08 21:02 
QuestionRe: Registry Pin
David Crow10-May-08 6:17
David Crow10-May-08 6:17 

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.