It isn't clear if there is a real business problem here but mixed mode programming can often be tricky. So it is easier to just not do it. Instead 1. Create a executable of the targeted functionality. 2. Provide an management API for that: sockets, files or std io. 3. Use the client application to manage a "process" to run the above executable. 4. The client application uses the management api to produce the desired functionality. The advantage to this is that both pieces, with care, can be tested independently and debugged independently as well. And the target functionality cannot take done the client application should it fail in a catastrophic way.
The answer given in that question is correct. There is no C++ keyword equivalent to using() from C# because C++/CLI has deterministic finalization. When the object goes out of scope and there are no more references, it will be disposed.
i have tried what u have done . that GetFocus function is retirning is NULL when iam calling in thread. so, that i tried one more function GetForegroundWindow(); this also returns HWND.
CWnd \*wnd=NULL;
HWND hWnd = NULL;
CString strwndName;
while (1)
{
hWnd=::GetFocus();
if(hWnd==NULL)
hWnd=GetForegroundWindow();
GetWindowText(hWnd,strwndName.GetBuffer(),20);
//displaying in edit box.
dlg->m\_ed1.SetWindowText(strwndName);
}
just try it.. it will be work...
Regards, Srinivas
I want to find out which item has been selected . If it was a SysListview32 , I could have SendMessage and used the HWND of the SyslistView32 . But as it is a DirectUIHWND, I dont see how to get the list view out of that. There is no documentation of DirectUIHWND . One way maybe to get the COM interface, I am thinking of that way. Any help would be appreciated. Thanks, Sujay