|
Maybe, but would you be happy to rewrite 50,000 lines of code due to this one bug, appearing only on very weak machines | win9x | fast LAN (at least 100mbps) ???
I think admin should be mor0n when running FTP server on such a sh*t...
|
|
|
|
|
eh - too fast? how can it be too fast? resources memory usage? have you tired other ftp sever versions maybe find one that is less resource hungry.
easier way change the network card to a 10mbps only one
Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|
|
However it may sound strange, it's true. Yes, I've already tried other FTP servers - but they are much smaller than the our one. I think it's caused by that most of them is written in Delphi, whereas we wrote it in C++, and it's really difference...
I remark again - it only appears on VERY weak machines, ONLY on Win9x and ONLY on fast LANs( at least 100mbps).
|
|
|
|
|
Hi.
can anyone please help me find out why this code doesn't work:
char* nextWpName = "mypic.jpg"
SystemParametersInfo (SPI_SETDESKWALLPAPER,0,nextWpName,SPIF_UPDATEINIFILE);
my wallpaper simply disappears and goes blank.
help...
|
|
|
|
|
You need to pass the full path to the file.
Software Zen: delete this;
|
|
|
|
|
Ofcourse I'm doing that...
The code was only an example...
try running it and see if it works for you
|
|
|
|
|
Lior Shoval wrote:
try running it and see if it works for you
It didn't worked for me. I tested it on WinME and it didn't change to anything...
hm.. weird... GetLastError returned 0 so... I don't know!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I think that you can only set a BMP wallpaper with that API. To use a JPG you need to turn on ActiveDesktop and use the IActiveDesktop interface to set a wallpaper.
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi,
why doesn't this code work :
CListCtrl& listCtrl = GetListCtrl();
listCtrl.SetView(LV_VIEW_DETAILS);
??
When I try to compile, it says "SetView is not a member of CListCtrl".
Thanks
|
|
|
|
|
Anonymous wrote:
When I try to compile, it says "SetView is not a member of CListCtrl".
Thats your problem.
I think what your trying to do is change a style bit and I think you can use CWnd::ModifyStyle() to accomplish this.
Cheers
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Which version of MFC and VC++ are you using?
SetView is not documented in my MSDN October 2001 for CListCtrl but is documented in the help that comes with VC7.
The windows message (LVM_SETVIEW) that the function wraps is marked as a Windows XP only message.
Looking through the MFC source, SetView is wrapped by the following pre-processor line
#if (_WIN32_WINNT >= 0x0501)
You'll have to set you app to target that version of windows if you want to make use of the extended XP common control functionality.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
What exactly does this mean and how would I add this functionality to my own controls?
For instance i have a Listview control and I would like to bind a database to it, would I basically just add a function called Bind() with parameters required to query database and have this function fill in the fields on the list control?
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Is this safe to do???
I have Add and Delete buttons which operate on a database and fill combobxes accordingly. The comboboxes are all filled with data inside OnInitDialog() so instead of rewritting code to populate the combo's on each and and remove I simply flush all combobox content and recall OnInitDialog() directly. I suppose I could have wrote functions like FillContactsCombo() and call them inside OnInitDialog and Add/Remove buttons, but I didn't so I would like to know if calling OnInitDialog is safe???
Thanks for your input
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
It would only take a couple of minutes to cut and paste your code from OnInitDialog into a FillContactsCombo function. Having a seperate function is the correct way to code this.
A quick look through the base level CDialog::OnInitDialog shows a code that loads and locks resources as well as sending off other WM_x to the dialog controls. I'd say it isn't safe to do it and also a very poor and lazy programming style.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
Michael P Butler wrote:
lazy programming style.
Yup, but it's just an app i'm building for myself and I use the waterfall (i think??) approach to designing apps. I don't really create much of a design doc (cuz well I don't know what one looks like to be honest) I just kind of start building...take away what i've learned and rebuild correcting and optimizing as I go...over and over again
Thanks
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
I've been programming for a long time, it is now second nature for me to write my code in small functions rather than putting everything into one function. I very often don't have a design document but you soon learn to get into the habit of writing structured code - if only to make your own life easier.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
I'd move the code to seperate functions to be on the safe side. I don't think it would be safe to constantly call OnInitDialog.
Regards,
Brian Dela
|
|
|
|
|
I was going to, but when I tried it with calling OnInitDialog() it worked so I left it, but then thought i'd get some opinions on CP.
Cheers!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
when i resize my CFormVIew based window my controls donot resize accrodinfg to it.. how can i resize my controls placed on the dialog attached to CFormView when i maximize the window???
Shoaib Khan
sbk_one@yahoo.com
|
|
|
|
|
WM_SIZE I would think should work.
I would just resize/reposition each control inside OnSize()
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I am Korean.
I English not very well.
please!
I don't know how to do FTP file status find a way. ^.^
|
|
|
|
|
I don't know what you mean, but did you take a look at this?
regards
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi All
I appreciate greatly a quick response. Thank you.
I am using unicast sockets (sync) where i bind the socket in one thread and keep accept() new calls in another thread. and Closesocket() in another.
When I closesocket(), the program terminates. and if i remove closesocket(), it does not allow me to bind() again.
I forgot to mention that I need to close and connect again without terminating the application (reuse the socket). Is there any way to do this or what am i doing wrong?
int UnicastConnect()
{
printf("Establishing the listener...");
WORD version = MAKEWORD(1,1);
WSADATA wsaData;
WSAStartup(version, &wsaData);
// Next, create the socket itself
listeningSocket = socket(AF_INET, SOCK_STREAM,IPPROTO_TCP);
if (listeningSocket == INVALID_SOCKET) {
AfxMessageBox("Error at socket()");
WSACleanup();
return 0;
}
// Use SOCKADDR_IN to fill in address information
SOCKADDR_IN saServer;
saServer.sin_family = AF_INET;
saServer.sin_addr.s_addr = INADDR_ANY; saServer.sin_port = htons(g_InetPort);
/*
setsockopt( listeningSocket, SOL_SOCKET, SO_REUSEADDR, NULL, NULL );
*/
// Bind the socket to our local server address
nRet = bind(listeningSocket, (LPSOCKADDR)&saServer, sizeof(struct sockaddr));
if (nRet == SOCKET_ERROR) {
AfxMessageBox("Error Binding Socket");
WSACleanup();
return 0;
}
// Make the socket listen
nRet = listen(listeningSocket, MAX_CLIENTS);
if (nRet == SOCKET_ERROR) {
WSACleanup();
return 0;
}
if (listeningSocket == INVALID_SOCKET) {
return false;
}
CreateThread(0, 0, AcceptConnections, (void *)
listeningSocket, 0, NULL);
}
DWORD WINAPI AcceptConnections(void *ListeningSocket)
{
sockaddr_in sinRemote;
int nAddrSize = sizeof(sinRemote);
while (1) {
SOCKET sd = accept((SOCKET) ListeningSocket, (sockaddr*)&sinRemote,&nAddrSize);
*p = 1 ;
ioctlsocket(sd, FIONBIO, p); // Sets the Non-Blocking Mode of Socket.
if (sd != INVALID_SOCKET) {
AfxMessageBox ("BeaconSender::Accepted Unicast connection from ");
}
else {
AfxMessageBox ("Closed");
return false;
}
}
}
void stop(){
shutdownsocket(listeningsocket)
closesocket(listeningsocket); //Gives an error
wsacleanup();
}
Thanks for your help.
Yogi
|
|
|
|
|
Consider WSASocket().
listeningsocket = ::WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, 0);
::closesocket(listeningsocket);
Kuphryn
|
|
|
|
|
Thanks for the suggestion.
I forgot to mention that all the code is built inside an ActiveX. Does that cause a problem??
CloseSocket() was terminating the application. Then if i remove the closesocket(), the binding to the IP/Port does not occur (obviously).
WSASocket() is showing as undeclared identifier with ws2_32.lib included.
Best Regards
Yogi
|
|
|
|