|
I have a server and a client app. I want to send some data from server to client without a request from client. How could the client get the data from server with only a event ?
I know I can get if the server use PostMessage function, but only using a wparam (16 bits) and lparam (32 bits).
Thanks,
Cristiano.
|
|
|
|
|
|
Hi. My problem is this:
I create a window using CreateWindowEx(). Then I create other windows[tool windows, document window etc...] All these are in non-MFC. The problem is that, if the user clicks on one of the tool windows, the mother window and all others lose focus[The title bars of those windows become gray]. And similarly if any window is clicked all others lose focus. I hear you saying "so what?". Here is the problem: When I start a DialogBox() only the spawning window is blocked, other windows are not. But I want them all blocked until the DialogBox returns.
I tried an MDI program generated by Visual C++ 6.0's wizard. What I want is exactly that(all windows titles are always highlighted!) but in a non-MFC way.
I tried different combinations of OVERLAPPED, CHILD, POPUP etc. but couldnt get it right. Can anybody help me?
Thanks
Oztan
PS: By the way I think being highlighted is my problem that is why I am talking about it. Actually I dont care which windows are highlighted and which are not, I just want the DialogBox() to block them all.
|
|
|
|
|
I guess one way you may do this is:
1. Disable (or Hide) all child popup window (or dialog #32770) that existed. To do that, you
may call EnumChildWindows.
BOOL CALLBACK gfnEnumChildProc(HWND hWnd, LPARAM lParam)
{
TCHAR szClass[CLASSNAME_LEN];
::GetClassName(hWnd, szClass, sizeof(szClass)/sizeof(TCHAR));
DWORD dwStyle = ::GetWindowLong(hWnd, GWL_STYLE);
DWORD dwExStyle = ::GetWindowLong(hWnd, GWL_EXSTYLE);
if (_tcsicmp(szClass, _T("#32770")) == 0)
{
}
if (dwExStyle & WS_EX_TOOLWINDOW)
{
}
}
2. I just re-read your post and I think you could get away with it by creating your dialog inside
of your main window. or why is this not an option?
|
|
|
|
|
Hmm, your answer is more tricky than I expected.
"I think you could get away with it by creating your dialog inside
of your main window"
Ok. Here is the situation.
I have the main window.
Main window creates two toolwindows. [One is for document, other is for interfacing with user]
The interface tool starts a DialogBox. I want this dialog box to pause everything [stop user interaction between main window and the documetn toolwindow] But while the dialogbox is running I can still use the other tool and the main window! Only the dialog that spawned this dialog is paused.
I hope the problem is clearer now. I believe I can solve it with proper ownership and window styles but I just can't figure out which is the correct one.
Thanks
Oztan
|
|
|
|
|
Yes, that's what I meant! Is there any reason why you can't create (start) this dialog
from the main window instead from the interface? Your interface is modeless and how you
create the DialogBox (which is modal) will affect only its parent. Can you post some code,
how you create your 'DialogBox' (constructor) before you call DoModal()?
As my daughter would say, "... Whatever!"
|
|
|
|
|
I need to know how I can retrieve data from my database if its stored as as bytes.
So far to get strings out I have been doing a _bstr_t cast to the value received from rs->fields->getItem->Value . However somewhere I read about
rs->fields->getItem->Value.iVal
and
rs->fields->getItem->Value.bVal
but cannot find any info on it.
Thanks for your help,
ns
|
|
|
|
|
__variant_t derives from VARIANT. iVal, bVal, fltVal and others are defined in VARIANT stuct.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Look in MSDN. VARIANT is a union and can hold many types of data. In fact you can look here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcemfc/htm/struct_32.asp
|
|
|
|
|
Hello,
I'm trying to make a personal app. that will organize my MP3 collection in a particular way. Is there any code out there that can parse MP3 header tags to get the particular text fields (e.g., title, album, artist, etc.)?
Thanks!
JennyP
|
|
|
|
|
|
Actually it is very easy to parse ID3V1 tags. Simply seek the file pointer of an mp3 file to the end minus 128 bytes. You can then read the 128 from this pointer until the EOF (End of file).
If the first three bytes equal "ID3" you know that there is an ID3V1 tag at the end.
However, I don't know how ID3V2 tags work
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
oops, my fault.
It a long time ago I worked with ID3 tags
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I wrote something a while ago that uses filenames for song names and folder names for artist and album. ID3V1 is a doddle, it's just sitting on the end of the mp3 ( which is why if you're *ahem* downloading an mp3 and don't get it all, there's no id3 info ). ID3V2 is compressed though, I used a class I found on the net ( and fixed, as I recall ) to do it. If you have no joy and want ID3V2, just LMK and I'll send you the class. I can't post it to CP as I did not actually originally write it.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
|
|
|
|
|
Hi Christian,
I would love to get that ID3V2 class you spoke of! I always use V2, so V1 won't work for me. I don't plan on selling (or widely distributing) this application.
Thanks!!!
JennyP
|
|
|
|
|
Could you please send me this class per mail?
E-Mail is foxhunter@hlla.net
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hello,
When clicking on a CEdit box, I would like the entire contents of the box to be selected (so that the user can simply overwrite existing text instead of manually backspacing over the existing contents). I have searched and didn't find anything on MSDN help. When a user tabs to the CEdit box, the entire contents are selected--the exact behavior I want for a user mouse-click. Any suggestions?
Thanks!
JennyP
|
|
|
|
|
override OnSetFocus (handle EN_SETFOCUS) for your edit control, and then call m_myEdit.SetSel(0,-1);
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Hi Chris,
I've done just that, and no dice. I verified that it gets called with TRACE but the edit box still puts the insert cursor where the mouse was when I clicked on it. Do I need to call more items from the function? Here's the function....
void CDiagGoalSched::OnSetfocusEditDue() <br />
{<br />
TRACE0("SET FOCUS...");<br />
m_CtrlEditDue.SetSel(0, -1);<br />
}
Thanks!
JennyP
|
|
|
|
|
try this:
::PostMessage(m_edit.m_hWnd, EM_SETSEL, 0, -1);
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Bingo! Why does this work and not the first one? Is it the order of window messages in the queue? (I.e., the m_EditCtrl.SetSel() was before the Edit's translation from mouse position to cursor position?)
Thanks!
JennyP
|
|
|
|
|
yep, i think you explained it. by posting the message (instead of Sending as SetSel does), you give Windows a chance to finish the Focus Change message (which probably ends with the edit control clearing the selection) before you change the selection manually.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Hi !!
I am designing a chat server these days. The server is designed in a manner to scale upto thousands of connections.
But i want one advice. The message from one client to another is protocol specific. Server decodes the message and find out information regarding target connection. Here lies the problem. What information i include in the message so that server easily find the target socket???
Infact whenever new connection established, i keep its pointer in std::vector data structure and send the position of that socket in vector to all other authorized buddies. But this is not a good approach. If one buddy disconnects, the position of others in vector is disturbed. So i want advice in this regard.
Kashif Mehmood
|
|
|
|
|
Kashif Mehmood wrote:
i keep its pointer in std::vector data structure and send the position of that socket in vector to all other authorized buddies.
std::map with GUID as a key?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|