|
AfxGetMainWnd()->PostMessage (WM_SYSCOMMAND, SC_MINIMIZE);
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I wonder how i can enable the frontpage extension for a website on IIS by coding. (i don't care what kind of language the code is written in)
I can't find any help from google about this.
I appreciate if you can help.
Thanks.
|
|
|
|
|
I want to ask something about WinSock. I use it to make connection-Oriented program, I make "PREPARING" for the client and server socket: socket(); setsockopt(SO_RCVTIMEO); set IP address and port for the socket; and finally bind();
For the client, connect(); send(); and there is no SOCKET_ERROR.
Then, for the server, I make listen(); and then the following code:
while(TRUE)
{
iRet=0;
iRet = select(2,&serverReadFD,NULL,NULL,&selectTimeout);
if(iRet == SOCKET_ERROR)
{
AfxMessageBox("ERROR SOCKET SELECT");
closesocket(serverSocket);
return 0;
}
else if(iRet >0)
{
if(FD_ISSET(serverSocket,&serverReadFD))
{
int addrLength=sizeof(sockaddr);
clientConnection = accept(serverSocket,
(struct sockaddr*)&connectionInfo,&addrLength);
if(clientConnection == INVALID_SOCKET)
{
AfxMessageBox("ERROR SOCKET ACCEPT");
closesocket(clientConnection);
closesocket(serverSocket);
return 0;
}
FD_SET(clientConnection,&mainReadFD);
}
else
{
//
iRet = recv(clientConnection,msgData,sizeof(msgData),0);
if(iRet == SOCKET_ERROR)
{
AfxMessageBox("ERROR SOCKET RECEIVE");
closesocket(clientConnection);
closesocket(serverSocket);
return 0;
}
else if(iRet >0)
{
//AfxMessageBox("IN SOCKET RECEIVE");
CString tmp;
tmp.Format("%d",_T(msgData));
::PostMessage(data->mainHandler,WM_DATA_MSG,
(WPARAM)AllocBuffer(tmp),0);
tmp.Insert(0,"REPLAY: ");
iRet = send(clientConnection,(const char*)tmp.GetString(),
tmp.GetLength(),0);
if(iRet == SOCKET_ERROR)
{
AfxMessageBox("ERROR SOCKET SEND");
closesocket(clientConnection);
closesocket(serverSocket);
return 0;
}
memset(msgData,'\0',sizeof(msgData));
}//END RECV CONNECTION
}
}// END SELECT SUCCESS
FD_ZERO(&serverReadFD);
serverReadFD=mainReadFD;
}//while(TRUE)
There is no SOCKET_ERROR either, but the server infinitly receive the Client message "There is no problem in the accept() function".
By debug, I saw that select() return every time the socket that make the connection with the client is ready to receive data.
about the send() functin code in the client thread, here is the code:
while(TRUE)
{
::PeekMessage(&threadMsg,NULL, WM_USER, WM_APP, PM_REMOVE);
if(threadMsg.message == WM_SEND_MSG)
{
iRet = send(clientSocket, (const char*)threadMsg.wParam,
sizeof(threadMsg.wParam), 0);
if( iRet == SOCKET_ERROR )
{
AfxMessageBox("ERROR SOCKET SEND FROM CLIENT");
errorMsgHandler(data->mainHandler, WSAGetLastError());
closesocket(clientSocket);
return 0;
}
}
}//END WHILE (TRUE)
HELP ME PLEASE . . . .
ABO OSAMA
|
|
|
|
|
I downloaded the original Quake II game source code from:
ftp://ftp.idsoftware.com/idstuff/source/quake2.zip
which was released open-source by id software under the GNU public
license:
http://www.fsf.org/copyleft/gpl.html
The game was rewritten in C language. I'm trying to re-compile
it in VS.Net 2003 from ground-up.
When I open the VS.Net 2003, I chose "new project", then in Visual C++
project, I chose "Win 32 project", then selected "window application"
and "empty project".
However, I don't know what's next. I have tried to open the soluation
file in the original quake 2 source, and see what's inside. I was there
are six projects under the soluation. ctf, game, quake2, ref_gl, ref_soft.
The reason I want to try to re-compile it again from "ground-up" is because I
want to know how a big project is managed in VS.Net. Please, would anyone
please help me?
Thanks.
|
|
|
|
|
|
Thanks for your reply. I have both original version and
.Net version. When I say I want to re-compile it again
from ground, I mean not opening the soluation file, but
to build a new project, then copy the files to my newly-
created project.
Anyone?
|
|
|
|
|
Is there anyone that have source code to make interface like norton commander/total commander ?
Norton commander has two panels,drag & drop for both panels, and syncronization between them.
|
|
|
|
|
tom182 wrote:
Norton commander has two panels,drag & drop for both panels, and syncronization between them.
This sounds like a job for...a splitter window with two frames. See the many MSDN examples and here at CP.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Is there any way to display the actual characters in the debugger windows when using wchar_t characters and strings? Right now, I can only get it to display the unsigned short values.
Man Learns from History that he never learns from History
|
|
|
|
|
Select Tools | Options from the menu, and pick the Debug tab. Make sure 'Display unicode strings' is checked.
|
|
|
|
|
Thanks!!
Man Learns from History that he never learns from History
|
|
|
|
|
Hey all,
I asked this question two days ago but did not get an answer. Maybe the previous question was too vague or it just got buried too fast. So I will attempt to reword it more clearly with more infomation and hopefully I can get an answer.
I have an app that is designed to automatically fire off emails at a user specified time or time interval. What it does is start a seperate worker thread for each message. The thread will gather the information it needs, build the message, then attempt to send it.
I have a thread manager class that keeps track of all the message threads running. The first thread to get to the point where an internet connection is needed will enter a critical section, and all subsequent threads will have to wait. In the critical section I call InternetGetConnectedState() to see if the computer is already connected to the internet. If it is connected the thread will let the manager class know, and it will clear the critical section and let all the other threads continue. If it is not connected, I call InternetAttemptConnect() to invoke the dialup dialog. At this point all subsequent message threads are stuck waiting for the critical section. If the user presses the cancel button on the dialup dialog, the thread will inform the manager class that there is no connection and the thread will terminate. But the next thread will again repeat the process of attempting to make a connection. So if there are many threads waiting to send, and the user wants to cancel them all, they will have to hit the cancel button once for each thread.
What I want to do is have my main GUI thread popup a modeless dialog with a status panel and a cancel button on it. When the user presses that cancel button, I want to stop all the message threads, and remove the dialup dialog if it is present.
So my question is:
How can I programatically remove or cancel the dialup dialog that is created using the InternetAttemptConnect() function.
Any pointers or suggestions (even telling me if it possible or not) would be appreciated. I am sure I could call TerminateThread() on the message thread that is hung waiting for the dialup dialog, but I do not want to do that as it will make my app unstable.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Don't know how to do that. can't even get the dialog to open on my systems. I expect because i have a lan or wireless connection on all my systems. I could guess wildly that you might be able to use FindWindow() and then send it a message like maybe WM_CLOSE ??
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
|
Thanks for the link to your blog Nish. I think I will implement your idea. Your blog looks very interesting, I will have to take some time and explore it some more.
I think I will have to take some time and rethink how I am approaching my problem. I will take your idea of the flag into consideration, as well as palbano's idea of using FindWindow (even though I do not really care for that idea, but FindWindow may be needed here.)
Thanks.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi PJ,
Tis early monday morning here and I've only had one cup of coffee.;) How about one thread that looks after the dialip etc. and it has a flag along the lines Nish mentioned. Other threads would query a flag back in the main app thread to test if the dialup is active.
TerminateThread() is bad as you indicate. Peter Hancock's article "An exception safe OO thread-pool framework" http://www.codeproject.com/threads/threadlibrary.asp[^] uses a neat trick of raising an exception in the thread to kill it. The thread pool itself is very good IMO.
Instead of a separate thread for each email, how about a single thread with a queue. Once an email has been successfully sent it would be removed from the queue. Iterate the queue untill all emails have been sent.
Hope that helps.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Thanks for the ideas, Neville.
This gives me some differnt ideas that I will have to think about.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I'm looking for a good built in bug tracker/reporter that can ship with the released product. It would give me detailed information on where the crashed happened (source level) and why, something like a C++ stack trace. Does anything like this exist ?
thanks
|
|
|
|
|
|
|
|
hi
i wrote an active x control with the microsoft visual studio .net
it handles the output from my webcam and lets it start and stop.
everything works fine, but just if I run the control on my computer.
on another maschine (also win xp) the control doesnt start in the
browser. (security settings allow it) i suppose i need to pack
some dlls into a cab file.
how do i find out which dll i need to pack into the cab file?
and how do i write the inf document.
beside the standard imports from an atl control project i just
added #include <Vfw.h> for the webcam functinality
these are the standard imports:
#include <afxctl.h> // MFC support for ActiveX Controls
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Comon Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
// Delete the two includes below if you do not wish to use the MFC
// database classes
#include <afxdb.h> // MFC database classes
#include <afxdao.h> // MFC DAO database classes
#include <windows.h>
|
|
|
|
|
Use Depends.Exe to see which other DLL you might need.
If you can not find Depends.Exe, then you can use Process Explorer from www.sysinternals.com to watch your program while it is running. Youc an see which DLL the EXE has loaded.
I am not sure about the INF document.
|
|
|
|
|
I am working on one project .for that i want to use different color and different size of static text on dailog box how can use such a customisez text on dailog box ?
|
|
|
|
|