|
WhiteSky wrote: see MSDN for UpdateData
In MSDN:
"CWnd::UpdateData
This method initializes data in a dialog box, or retrieves and validates dialog data."
how we could set the data?
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
I think his question is independent from main question
whitesky
|
|
|
|
|
|
Desmo16 wrote: 3) what should i do to save a file instead of loading it.
use
CFileDialog fd(FALSE, NULL, str, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY);
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
Hi people
I belive I have seen a WIN32 funtion that you can use to know the type of a Handle.
I need to know if a handle references a file, a file map or another thing.
Does anybody knows how I can do that? I tried at msdn.com but I can't find anything
Thanks in advance
|
|
|
|
|
|
hi
i want to make a button in mfc so that when i click on it
all open windows are minimized plz tell me the example for this
Ashish Dogra
MCA
Noida
|
|
|
|
|
I am not going to write any code for the same.
you just google for it.
steps.
1. Enumerate Windows (top level windows)
2. On enumeration, you will get handle of each window. decide, it's a top level window or not.
3. Call ShowWindow(hWnd,SW_MINIMIZE);
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
plz tell me
i have made an sdi application now i want that wheni run this application the menu on it in which i add an item show so that when i click on show it open again same window as mainframe
but in sdi how i can gofrom menu to window
Ashish Dogra
MCA
Noida
|
|
|
|
|
|
|
I'm creating DOMDocument in the following way:
CoCreateInstance(CLSID_DOMDocument40, NULL, CLSCTX_ALL, IID_IXMLDOMDocument2, (LPVOID*)&m_pXmlDoc)
This works well when the code is compiled as usual console application. But when the code runs as windows service CoCreateInstance fails with E_OUTOFMEMORY error.
This only happens on some machines...
Thank you,
Andriy
|
|
|
|
|
I have CDialog with several edit box controls on it. On closing the dialog, how to find which edit box has the focus?
thanks.
|
|
|
|
|
use from GetFocus()
whitesky
|
|
|
|
|
|
|
If you have a server listening on a particular port, the OS will automatically 'accept' all connections coming in on that port. There's no way (using BSD sockets anyway) to reject a particular connection; all you can do is close the socket() once you've accept()ed it. What are you trying to achieve? If you want to allow connections from a particular address only, then you can accept(), check the peer adddress, then close() the socket if it's not the connection you wish to accept.
If you're just trying to allow one connection in, denying all others after a successful connection, then you can close the listening socket after accept()ing.
If you really need to give a 'connection refused' message to a subset of people, you should consider using a firewall instead.
Matt Godbolt
Engineer, ProFactor Software
StyleManager project
|
|
|
|
|
Matt Godbolt wrote: If you're just trying to allow one connection in, denying all others after a successful connection, then you can close the listening socket after accept()ing.
If you really need to give a 'connection refused' message to a subset of people, you should consider using a firewall instead.
I want to do the first thing you specified.
but want to display the message of second one.
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
In that instance then, once you've accept()ed the first connection, you can close the socket you created to listen on. Any further connection attempts will be rejected with 'connection refused'. Something like:
SOCKET listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
bind(listenSocket, localAddress);
listen(listenSocket, 1);
sockaddr_in connectingAddress;
int connectingAddressSize = sizeof(connectingAddress);
SOCKET incomingConnection = accept(listenSocket, &connectingAddress, &connectingAddressSize);
closesocket(listenSocket);
closesocket(incomingConnection);
NB this code is totally off the top of my head, so apologies if there's any compile issues, hopefully you get the idea!
Matt Godbolt
Engineer, ProFactor Software
StyleManager project
|
|
|
|
|
Yea I was using this method. but this way could not convince me
anyway till I get another solution. this is my solution.
Thanks alot for your reply
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
The Wireless adapters are to be disabled, if any wired interfaces are found and enabled if no wired interfaces are found or if the cable is disconnected.
This functionality shall work for any wireless adapters types like PCI, PCMCIA or USB interfaces.
|
|
|
|
|
Hi all,
I am using Visual studio 6.0. I need to read and store a .gif file in binary format in vc++.Please help me
thanks
vinod
vinsankar
-- modified at 7:31 Tuesday 4th July, 2006
|
|
|
|
|
is your source is a file?
sample code to read and write using CFIle.
CFile file;
if(file.Open("source.gif",CFile::modeRead|CFile::typeBinary))
int nLength = file.GetLength();
if(nLength >0)
{
byte* pBuffer = new byte[nLength];
file.Read(pBuffer,nLength);
CFile fileWrite;
if(fileWrite.Open("destination.gif",CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
fileWrite.Read(pBuffer,nLength);
fileWrite.Close();
}
file.Close();
}
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
AFAIK you can read a file using the binary format
ifstream is( "myFile.gif", ios::binary );
char Data;
if( !is ) {
cerr << "Error opening file" << endl;
return false;
}
else
printf("file opened successfully");
while( is.read( (char*) &Data, sizeof(char) ) ) {
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have a byte array, which contains the data of a bitmap.
how can I set these information to a HIBITMAP?
I used SetBitmapBits function. But it's failed.
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|