|
Basically your question is, if the operating system reuses socket handles?
Yes, I would guess that with a long running server application there is no other way for the operating system. On Windows this definitely happens, see Winsock Programmer's FAQ[^]. In my networking applications I separate session/user handling from low-level networking, which means every user gets a unique ID assigned. There are many ways to create an ID, for example use the current UTC time paired with a random value. Alternatively, if you just need an unique internal reference, you could use this pointer of your C++ object.
Not sure if this answered your question?
M
|
|
|
|
|
I need to synchronise contacts from our DB with user profiles in an exchange server. Can anyone suggest which API / SDK to use to achieve this from a C++ application? The idea is users can flag contacts in our application as being one they want synchonised with their mobile phone eg. each account manager will want contact details for their customer accounts.
|
|
|
|
|
Hi,
This is not exactly a programming Q.
I have wireless HP mouse.
It has two side button for backward / forward page.
I want to map one of the key as ESC.
How I can do it?
BT
|
|
|
|
|
a.k.a BT wrote: This is not exactly a programming Q.
So why put it in a forum reserved for C/C++/MFC?
It's time for a new signature.
|
|
|
|
|
if by programming it can be done.
I think its possible. Thats why I posted.
BT
|
|
|
|
|
VK_BROWSER_BACK and VK_BROWSER_FORWARD ,
How to capture these events and through ESC key event globally?
BT
|
|
|
|
|
a.k.a BT wrote: if by programming it can be done.
I think its possible. Thats why I posted.
But your first message said :
a.k.a BT wrote: This is not exactly a programming Q.
It's time for a new signature.
|
|
|
|
|
|
what I am looking...
want to capture two mouse event globally....and throw ESC key event.
BT
|
|
|
|
|
A mouse hook[^] might be the way to go.
Steve
|
|
|
|
|
I have a derived CModeless Class form CDialog class which is used for creating modeless dialogs. I have derived 2 new dialog classes from the CModeless. I have opened the two dialogs since they are modeless. After OnOK of the dialog i must create the dialog again, for both the dialogs. but i am unable to see the dialog when OnOk button until the other dialog is closed.
Can any one tell me the solution for the problem.
sreenivas003@yahoo.co.in
|
|
|
|
|
Why you can't send WM_CLOSE message to the other dialog before recreating it?
BTW, why it's necessary to have CDialog->CModelessDialog>CXXXDailog/CYYYDialog?
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
Hi,
How can I make a modeless dialog as child to another dialog using code.
I tried ModifyStyle(0,WS_CHILD) in initdialog but not worked..
How to do that?
|
|
|
|
|
Usually you Create() the modeless dialog using the other window as its parent, setting window sizes and such.
|
|
|
|
|
|
Is there any easy way to print text like this:
http://www.ruthtechnology.com/hollow_20.jpg
The numbers have a black trim, but nothing inside.
Please any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina
|
|
|
|
|
You can create a path of the text and then stroke it. You'd do this by -i assume you are using the CDC class- something like:
CDC dc;
...
dc.BeginPath();
dc.TextOut(0, 0, _T("Hollow text"));
dc.EndPath();
dc.StrokePath();
...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers are evil, EVIL i tell you!! <
|
|
|
|
|
I want to be able to recognize when some pane of the statusbar is clicked. I need to know this in my View class which is derived from CView.
One person on this forum suggested subclassing, but didn't know how to go about doing that.
Any ideas?
Thanks
|
|
|
|
|
I am getting valid HWND of another SDI application using FindWindow and sending message "WM_COPYDATA". But OnCopyData is not called at the receiving application. What could be the reason for WM_COPYDATA not received?
Regards
--
"Programming is an art that fights back!"
|
|
|
|
|
The first question to resolve is...
- what window are you sending the WM_COPYDATA to?
If you do a FindWindow on an MFC SDI application by windows title you will find you've got the handle of the CMainFrame derived window, not the view window where generally all the interesting I/O happens.
One really clean way of using WM_COPYDATA is to create a "data copy target" window who's sole job is to recieve and process WM_COPYDATA. This window will be invisible and/or off screen so no one can interact with it.
Cheers,
Ash
|
|
|
|
|
Thanks for the help!!
I've resolved the problem, I forget to give the size of data to be sent:
cpds.cbData = _tcslen(csData) + 1; .
Also if the receiving application runs in IDE(Running as Admin), and the sending application launched externally(Normal mode), then sending copydata message failed and GetLastError() returns "Access denied".
So the sending application must have same or higher credentials as the receiving application.
Regards
--
"Programming is an art that fights back!"
|
|
|
|
|
Hi,
It seems that in Windows 7 there are some "File Permitions" system.
When my program creates a file on the hard disk, while user A is logged, when user B loggs into widows 7 and runs my program, my program can't get write access to the file which was created by user A.
When I right-click on the problematic file, go to "Properties" , and go to the security tab, I see a list of users that can access the file.
But I need to enable ALL users to be able to access the file.
Any Ideas?
Thanks!
modified on Tuesday, June 1, 2010 9:40 AM
|
|
|
|
|
I hope this code works
Instead of using SHGetSpecialFolderPath
use this code:
TCHAR szCOMMON_APPDATAPath[MAX_PATH];
SHGetFolderPath(0,CSIDL_COMMON_APPDATA,NULL,0,szCOMMON_APPDATAPath);
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
modified on Tuesday, June 1, 2010 8:25 AM
|
|
|
|
|
Sorry, it didn't help.
Still can't access a file that was created by my program when it was first ran under other user.
Any other ideas?
|
|
|
|
|
Thanks for the link, it was very helpful!
Seems the "User access Control" is a very complicated thing ...
I have a 200,000 lines of code project using many libraries like TinyXML, which create files without using "User access Control" but just doing fopen().
I turned off "User access Control" in Windows 7 and everything works fine.
Hope our customers won't mind to turn UAC as well ...
Those Microsoft guys ... they have nothing to do but to destroy the good Windows XP with stupid features in windows 7 like UAC.
|
|
|
|