|
Hi All,
Is there any way we can check if a certain directory has been modified????
thanks
Dilshad
|
|
|
|
|
|
Another solution is FindCloseChangeNotification() and FindFirstChangeNotification().
Kuphryn
|
|
|
|
|
Thank you Micheal and Kuphryn for your help. The code works perfectly.
Thanks
|
|
|
|
|
I have a problem with CBitmaps. I want to copy one bitmap into another, which wouldn’t be a problem if I didn’t use multithreading. My situation is this:
I made a program which calculates the Mandelbrot fractal. I have a bitmap in which the picture is saved and which is used to make it display in the window. The function calculating the fractal creates a temporary bitmap and after it has finished, I want to copy the temporary image to the main image which is used to display but I receive either an assertion error or the bitmap becomes blank (white).
The problem only occurs when I run the function in a separate thread but if I don’t use multithreading, all works fine…
I tried a lot of things (for example using the BitBlt-function or working with pointers to the bitmaps) but none really helps. The weird thing is, that even if I get the assertion error, the program displays the bitmap correctly (only on some comps!). I gave it to a friend to test it (he has the same OS as me, Win2000 Professional) but it didn’t show the image (only a white window). It also seems to work correctly under WinXP.
I’m running out of ideas, so please give me some suggestions what to do
|
|
|
|
|
I don't know the exact deatils but you might want to try pDC->SelectObject(&bm); It may need a device context to do what you want it to do. Threads share memory space within a process, so I don't see how that would affect it.
|
|
|
|
|
hi!
When you saved the temp file , I think you didnot make the properly bitmap header which is a struct "BITMAPINFO". so it displayed blank picture.
good luck
dupengfei
|
|
|
|
|
I presume, you are having problems with multi-threading. 'A thread is supposed to access only those objects which it has created'. If you are trying to copy the new bitmap from the processing thread( not the main thread ) to the Bitmap object created by your main thread, then you have a problem. A workaround would be, to use user-defined windows messages after you are finished with your processing, and thereby notifying your main thread, to copy the newly created bitmap to the original one.
Hope this helps!!!
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
I thought of what you mentioned but I found another way to get the program nearly working as I want. I use the PeekMessage-function in the calculation function. This works properly but if you click in the menu, the calculation will stop until you leave it. But I'm statisfied how it works now.
And of course thanks to all who posted suggestions
|
|
|
|
|
Hi all,
i have a DTP control. i want to enter hours, and minutes and not show the seconds at all..... how can i do that?
thanks in advanced
Yaron
|
|
|
|
|
|
Hi,
I have a tree view control in a dialog-based app (non-MFC) and I want to use VK_RETURN and VK_ESCAPE to send the TVM_ENDEDITLABELNOW message to end label editing. This is fairly difficult, because the dialog traps all key messages (I think).
There is an article on MSDN that covers the basics of how to solve this here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;130691
Unfortunately I'm relatively new to coding C++, and I don't know how to go about implementing the advice given in that article.
From the article:
"To work around this problem, subclass the edit control in response to the TVN_BEGINLABELEDIT notification that is sent by the tree view control when the tree view is about to start label editing for an item. To obtain the edit control's window handle, send the tree view control a TVM_GETEDITCONTROL message.
The subclass procedure should handle the WM_GETDLGCODE message by returning DLGC_WANTALLKEYS. This allows the tree view's subclass procedure to handle ESC and ENTER keystrokes."
Could someone explain to me how to subclass the tree view control in this way to get this working, or point me to some examples (non-MFC)?
Many thanks to anyone who can help,
KB
|
|
|
|
|
Take a look at the SetWindowLong function in the Microsoft SDK documentation. This function will allow you to set a new wndproc (GWL_WNDPROC) which is what is meant by subclassing. When you change the wndproc all messages will come to your new wndproc...messages you do not handle should be sent to the original wndproc. You should probably be able to find actual example code by searching msdn as well as information regarding subclassing...there is an article called 'Safe subclassing in Win32' that may get you started
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_subclas3.asp
|
|
|
|
|
I want to develop a WLL. For that i need Word Developers Kit. It seems like it no longer available from Microsoft Site/Press... Can any one please help me to get the kit ( The files need to develop a WLL)...
As Word 97 cannot support the COM Add-Ins, i need to develop a WLL. I want my AddIn to work with Word 97 also.
Can u please help me?
Thanx in advance...
Mahesh
|
|
|
|
|
hello
I have writen a winsock client in visual c++,my aim is to connect to a irc channel so i can chat using my own irc client.
before i can join a channel i must register with the irc server,i understand to do this i must first send the following commands (USER & NICK)both theese commands take parameters and i dont know how to write them to the server.my winsock send(); & recv(); functions are working corectly so i must be sending the login data incorrectly.
if any 1 could help me with this subject i would apreciate it.
CString login1;
login1 = "USER chris";
send(Socket,login1,strlen(login1),0);
CString login2;
login2 = "NICK thes3cr3t1";
send(Socket,login2,strlen(login2),0);
here is how im trying to send the login data i have no idia if it is correct i have read the irc rfc and i think im sending the correct data also im unsure of how to seperate the command USER from the Parameter chris.
ahh well thanks
thes3cr3t:(1
|
|
|
|
|
This is how I do it:
CString NickCommand = "NICK " + m_Nick + "\r\n";
CString UserCommand = "USER " + m_Nick + " 0 * :MN\r\n";
Send(NickCommand, NickCommand.GetLength());
Send(UserCommand, UserCommand.GetLength());
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thank you for your fast response,i have edited your code to suit my app and its definatley getting better,however now i am reciving an error message saying im not giving enough parameters for NICK
CString m_Nick;
CString NickCommand = "NICK " + m_Nick + "\r\n";
CString UserCommand = "USER " + m_Nick + " 0 * :MN\r\n";
send(Socket,NickCommand,strlen(NickCommand),0);
send(Socket,UserCommand,strlen(UserCommand),0);
any further assistance with this would be great thank you!;)
|
|
|
|
|
Where does the error occur? What line? Also make sure m_Nick is not empty, this would make no sense.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
your right thank you very much,just as i got a e-mail notifying me that u left another message in the forum i was editing my last post to inform you that i have sorted the problem.and yes as you said m_Nick was empty,sorry for that little inconvinience my mistake.
you have been a great help!
regards chris
|
|
|
|
|
You're welcome!
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
sorry to be such a nuisance to ya'll,i have spent a good few hours now trying to get this irc server to accept my connection registration attempts however im having no luck,i wonder if any 1 can maybe spot my error.i think the error might lie within the nick command but im unsure.
CString m_User;
CString m_Nick;
CString m_Channel;
CString m_Pass;
m_Pass = "airplane";
m_Nick = "secret";
m_User = "secret na www.baka-baka.com :chris shread";
m_Channel = "#projectx";
CString PassCommand = "PASS " + m_Pass + "\r\n";
CString NickCommand = "NICK " + m_Nick + "\r\n";
CString UserCommand = "USER " + m_User + "\r\n";
CString JoinCommand = "JOIN " + m_Channel + "\r\n";
send(Socket,PassCommand,strlen(PassCommand),0);
send(Socket,NickCommand,strlen(NickCommand),0);
send(Socket,UserCommand,strlen(UserCommand),0);
send(Socket,JoinCommand,strlen(JoinCommand),0);
it all compiles nicely,when the last send(); is executed i am greeted with a error saying i have to register before i can join a channel,so i know thats where the problemb lies
thanx
chris
|
|
|
|
|
Hi
Make sure you use the USER command the same way I did:
CString UserCommand = "USER " + m_Nick + " 0 * :MN\r\n";
And don't forget to react on PING?-requests from the server in order to not time out.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hmm its no good just dosent seem to want to register i have tried different variations of code and i have also used ur code agsactly as shown,i realy cant understand how the problemb is occuring.
also a quick question,has my code got to wait 4 a NICK or USER verification before it can proceed with the next command,i thought maybe im sending all the info to quickly for the server.
thanks again for your time,and excelent responses.
chris
uk
|
|
|
|
|
I don't know exactly what really causes your problem, sorry
But I have a suggestion for you: When I began (and never finished) building my own IRC client, I first took a look at the built-in client in the filesharing tool "eMule". It is open source. I learned quite a lot from this source about how the IRC protocol actually works
You can download the latest source here:
http://prdownloads.sourceforge.net/emule/eMule0.30a-Sources_complete.zip?download
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thank you,im sure that will be a great help to me ill d/l the source now and "get stuck in". cheers mate u have been a great help
|
|
|
|