|
Hi,
I've posted the same question in ATL/WTL section also, but did not get any response.. posting again.
I'm planning to implement a chat server + a chat client as a learning exercise for my ATL/COM/DCOM.
As part of that first I would implement a chat server which is a local server and a chat client. Please suggest if the following is possible, if true how.
Clients register their callbacks by using Advice() (Of course, I would do FindConnectionPoint(), before that ). My doubt is is there any way to send the notification from the server to all the clients? and also can the server select the client to which it has to send the notification.
For Example: User1, User2 are currently logged in. If user1 sends a message to User2 by using SendMsg(from, to, msg) of IChatServer, can the server alert client of User2.
Otherwise can server broadcast the event??
Thanks and regards,
Raja Pratap
|
|
|
|
|
Raj Prathap wrote: I've posted the same question in ATL/WTL section also, but did not get any response
Well if you are asking about using DCOM for remote communications maybe you should try the "COM" forum?
|
|
|
|
|
LTNS led mike!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hey Mark... was on the road for a few days and then playing catch up
|
|
|
|
|
ROTFLMAO
Five hours old but I just saw this[^].... nothing changed much in my absence eh?
"Code Project... best entertainment value on the Web!"
|
|
|
|
|
led mike wrote: "Code Project... best entertainment value on the Web!"
!!
I came close to opening that can of worms (the link)
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I want to disable and enable menu items depending on conditions. Say for eg.
if menu is
File Input Analysis Help
There are many items under each menu. If 1st item under File is clicked, Input menu has to be enabled.
|
|
|
|
|
There's two messages attached to a menu item. One is a click event, the other is a callback, which is called just before it is shown, you set those things there.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
This is the best way:
<br />
BEGIN_MESSAGE_MAP(CYourFrame, CMainFrame)<br />
ON_UPDATE_COMMAND_UI(ID_MENU_ITEM_1, OnUpdateMenuItem1)<br />
END_MESSAGE_MAP()<br />
<br />
void CYourFrame::OnUpdateMenuItem1(CCmdUI *pCmdUI)<br />
{<br />
pCmdUI->Enable([TRUE or FALSE here depending on condition]);<br />
}<br />
Hope it helps
|
|
|
|
|
Hello, I tried to use CFileDialog to choose a folder path in my program but it this way user has to select a file and then I have to use GetFolderPath() to get the path but it may not be very sensible to user to select an arbitary file within a directory to select that directory on the other hand the directory can be empty that creates an additional problem. How can I open a dialog so user can select a folder path? is it possible to select from a tree structure of directories?
Thanks
|
|
|
|
|
Electronic75 wrote: How can I open a dialog so user can select a folder path?
Did you have a look at SHBrowseForFolder API.
It returns a pointer to an item identifier list (PIDL) specifying the location of the selected folder relative to the root of the namespace.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks alot _AnShUmAn_, though I have programmed for more than four years with MFC I still do not know some APIs and when I looked in help with keywords: "choose folder" it returned nothing useful. you helped me a lot god bless you.
|
|
|
|
|
Electronic75 wrote: though I have programmed for more than four years with MFC I still do not know some APIs
FYI, SHBrowseForFolder is not MFC, it is part of the Windows API - Windows Shell programming, to be specific
|
|
|
|
|
My Pleasure
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Hello All,
Actually i am using in my application "PropertyPage and PropertySheet" so i have to set bitmap on PropertySheet header and footer for every page so for that i am trying as follows:
constructor of my propertysheet class
CMyPropertySheet::CMyPropertySheet(CWnd* pParentWnd,
UINT iSelectPage, HBITMAP hWatermark, HPALETTE hpalWatermark,
HBITMAP hHeader)
: CPropertySheet(what i have to give caption ID here, pParentWnd, iSelectPage, hWatermark, hpalWatermark, hHeader)
and i am calling that as follows:
Bitmap bmWatermark;
CBitmap bmHeader;
if(!bmWatermark.LoadBitmap(IDB_BITMAP1))
return FALSE;
if(!bmHeader.LoadBitmap(IDB_BITMAP1))
return FALSE;
CMyPropertySheet MyPropSheet(NULL, 0, bmWatermark, NULL, bmHeader);
for this i am only unable to understand what i have to caption id into CPropertySheet(....) constructor if i am giving some integer than it got crashed
so if anybody have idea please share with me..........
thanks
|
|
|
|
|
The ID would be a resource ID of the string resource to use as a caption.
There's also a constructor that takes a LPCTSTR so you could pass something like _T("My Caption").
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I have a class derived from CWinThread, which have a CWnd* member which would recieve message from the thread. In the class also has a socket member,it would send network message to the CWnd* member.
I use such class in a Dialog,it works well.But when the main dialog create a new child dialog and show it using DoModal() function, and I want to make the child dialog correspond to the thread message and network message. In the child dialog,I send data to somewhere,but the class does send the data when the child dialog closed. Why?
Thanks
Good Luck.
|
|
|
|
|
I don't completely understand what you're doing but...
The window used for socket notifications doesn't have to be a visible window that the user can
interact with. It does, however, need to be created on a thread that has a message loop (your
CWinThread will provide that). If you create the window/dialog on another thread than your
CWinThread then it's possibly not going to work.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am trying the example of this web quote: http://www.flounder.com/kb192570.htm[^]
It really works well.but wen I using the ClientThread in another dialog,such problem occur.
I do not know why
|
|
|
|
|
Does it work if the dialog is modeless?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
It works well when there only one dialog.
If create a model dialog,the data you sent in the new dialog did really be send when the new dialog was closed
|
|
|
|
|
I'm not sure if it will work in a modal dialog.
If you're using sockets notifications to a window then that should be in one place.
You should be able to leave it in your main window.dialog.
I'm not sure completely how Mr Newcomer implemented his socket notifications in the article
you referred to. It may not work in a modal dialog. In general, a modal dialog is a bad place
for this kind of thing.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I think the thread or the socket would be blocked during the second dialog is active,perhaps.
But,if it so,I want to know,if is a modeless dialog,the socket and the thread would not be blocked?
In fact,the socket was create and connect to the server in the initialize function of the thread.So,I want to using the same socket so that it would not be created and connect to server again.
Would you like to tell me,how to resolve my aim or such problem?
Thanks.
Best Wishes
|
|
|
|
|
Haha,because of your inspire,I change the second dialog to modeless,then,all the things go ahead well now.Thanks very much.It my pleaure to learn from you.
|
|
|
|