|
|
Thanks! Actually I just stumbled upon this a couple of minutes ago and was able to send out an email using MAPI. The problem is that the user still has no access to their address book from which they can pick email names.
What I would really need to do is pop up the email composition window of the default email program. Is this possible through mapi?
Thanks!
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Ooops nevermind, I found the MAPI_DIALOG flag .
cheers!
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
MAPI works nicely.
Shog9
------
If you really what to get shitfacde tell a crowded bar that is is yourt borthday and hife your wallet. you ka will many more friends.
- David Wulff, Brithday selebrations, 9/19/02
|
|
|
|
|
Thanks! Actually I just stumbled upon this a couple of minutes ago and was able to send out an email using MAPI. The problem is that the user still has no access to their address book from which they can pick email names.
What I would really need to do is pop up the email composition window of the default email program. Is this possible through mapi?
Thanks!
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Ooops nevermind, I found the MAPI_DIALOG flag .
cheers!
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
if i hava a class
class a
{
int a;
CString str;
};
i want to write its object into a file and send that file through a network to different computer and i want to recive that object again if i have the same class there.
may i read the same object on network from a file?
any body can explain my idea into code like
how to write object into file ?
how to read object on the network (having same class there) from file ?
r00d0034@yahoo.com
|
|
|
|
|
See Serialize (u must thus derive ur class from CObject)
archives and using archives with sockets!
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi.
I am working on a simple client-based winsock Windows program. The program works well under the current software design. However, I discovered a huge resource problem.
The program support multiple simultaneous connections. I use the WSAAsyncSelect() I/O model to handle I/O. Everything works well. I implemented two worker threads. One thread sends data. The second thread receives data. WSAAsyncSelect() sends messages via Windows queue and update the program on FD_WRITE, FD_READ, etc. Again, the program works as planned.
I discover a huge resource problem. The program takes up all CPU resource as it makes more and more socket connnections. In other works, the program stalls if the user attemps to makes ten or more connections. CPU usage is 100%.
I re-read Network Programming for Microsoft Windows, Second Edition by Anthony Jones and Jim Ohmund. If I am not mistaken, you do not need workers thread for winsock if you use a non-blocking I/O such as WSAAsyncSelect().
I would like to know if there is a flaw in the program design. My thought right now is that this design will not work because of the worker threads. There is no way Windows can handle too many worker threads. However, let say I implemented WSASend() and WSARecv() solutions directly in the primary thread (main applications), I believe that will lock up Windows or at least the program. For example, if I implement a while loop that calls WSARecv() until it returns 0, that will lock up the program. Is that right?
Thanks,
Kuphryn
|
|
|
|
|
is there a while ( true ) loop somewhere??
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Yes, the problem definitely resulted from a while-loop. I am in the process of implementing a different approach to the algorithm.
I am debug a weird problem. For some reason, I cannot close an event handle. For example,
-----
HANDLE mEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
...
// This code crashes the program.
// Visual C++ debug says the error has something to do with an invalid
// handle.
::CloseHandle(mEvent);
-----
Kuphryn
|
|
|
|
|
Did you check that your handle was valid before trying to close it?
Signature space for rent. Apply by email to....
|
|
|
|
|
is the event being created??
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I think your best way of implementing this is to make new threads for each client connection.
Then, within the read thread, you can have a loop similar to this, which consumes negligible CPU time:-
WSAEVENT event;
WSANETWORKEVENTS netevents;
event = WSACreateEvent();
WSAEventSelect(s, event, FD_READ | FD_CLOSE);
DWORD result, lIdleTimeout;
lIdleTimeout=0
while (TRUE)
{
result = WSAWaitForMultipleEvents(1, &event, FALSE, 100, FALSE);
if (result == WSA_WAIT_TIMEOUT)
{
if (++lIdleTimeout > IDLE_CONNECTION_TIMEOUT)
{
closesocket(s);
return FALSE;
}
continue;
}
lIdleTimeout=0;
WSAEnumNetworkEvents(s, event, &netevents);
if (netevents.lNetworkEvents & FD_CLOSE) {
printf ("socket closed\n");
return TRUE;
}
if (netevents.lNetworkEvents & FD_READ) {
continue;
}
}
The key here is that WSAWaitForMultipleEvents() is very very lightweight. This example was for a connection thread for a server type socket, but implementing a similar theory in a client socket is simple.
Signature space for rent. Apply by email to....
|
|
|
|
|
Thanks.
The wait function (single) I use works well. I am just having a problem closing the handle of the event object.
Kuphryn
|
|
|
|
|
What is the message that a dialog receives when you bring another application on top of it?
|
|
|
|
|
There are most likely several; use Spy++ to find the ones you want. If the dialog was previously active, you'll most likely get WM_KILLFOCUS , WM_ACTIVATE , and possibly WM_ACTIVATEAPP .
Shog9
------
If you really what to get shitfacde tell a crowded bar that is is yourt borthday and hife your wallet. you ka will many more friends.
- David Wulff, Brithday selebrations, 9/19/02
|
|
|
|
|
Hello friends,
i would like to catch the WM_SET_TEXT message in an CEdit derived class.
My Function "OnSetText" is called (by Win/framework), but now is my problem: how can i set
the text of the control myself in my function?
When i use SetWindowText, i "call" my own function recursive..!
Thank you very much for your help!
Fiffi
|
|
|
|
|
um....set a flag when you start the recursion and if flag is set then don't recurse and clear the flag??? that's a guess
or on the OnSetText in your class, start a timer (perhaps using flag approach above) and then set the text on the timer call??
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Hello RedZenBird,
I don't would like to call the function recursive!
The command SetWindowText send the WM_SET_TEXT message to windowses to set her text. I would like to catch that message in my CEdit derived class/control (That part is done and OK).
But i would like to the the text in my WM_SET_TEXT-message-handler-function.
When i use SetWindowText my function calls recursive herself!
My question: How can i set the window text without SetWindowText/WM_SET_TEXT ?
(Sorry for my bad english!)
Fiffi
|
|
|
|
|
The point RedZenBird was trying to make is that you need to have a situation where OnSetText can do nothing if not appropriate:-
class CYourEditCtrl
{
protected:
BOOL bTextSet;
.....
}
void CYourEditCtrl::OnSetText( ... )
{
if (bTextSet) {
bTextSet = FALSE;
return;
}
bTextSet=TRUE;
SetText(....);
return;
}
Signature space for rent. Apply by email to....
|
|
|
|
|
Have you tried calling Default()?
Do you need to trap WM_SETTEXT, or would one of the EN_ messages do what you want?
Steve S
[This signature space available for rent]
|
|
|
|
|
You've subclassed an Edit control, and are receiving the WM_SETTEXT message. This message is sent to the control in order to change the text; it is the only (safe) way to accomplish this for an Edit control. So, you simply need to call the original window procedure.
If you are not modifying the text specified in the message, you can just call CEdit:OnSetText() or CWnd::Default() - both of these will call the origial Edit control procedure with the original message parameters.
If you *are* modifying the text, you will need to call CWnd::DefWindowProc() and pass in WM_SETTEXT for the message parameter, 0 for the second parameter (wparam), and a pointer to the string as the last parameter (lparam). Note that this method is not the same as ::DefWindowProc() , as it will call the original window procedure if the window was subclassed.
Have fun!
Shog9
------
If you really what to get shitfacde tell a crowded bar that is is yourt borthday and hife your wallet. you ka will many more friends.
- David Wulff, Brithday selebrations, 9/19/02
|
|
|
|
|
Hello friends,
Thank you very much for you help!
I begin with try/test...
Fiffi
|
|
|
|
|
I'm trying to change the value of a transfer var in a drop down list. The value that is selected is 10 off as my indexs start at 10 and go up instead of 0. So I have been trying to add 10 to this variable but it just won't take.
Help@!
|
|
|
|