Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
A

a_du

@a_du
About
Posts
19
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to set image DPI
    A a_du

    I have created a bmp file. Using CImage can load the file and save as a another file format like tiff, but how can i set the DPI of the image. Please help, thanks.

    C / C++ / MFC help tutorial question

  • About printing margin
    A a_du

    When using laser printer to print, there is always a margin on the paper. How to get the size of the margin? How to ignore the margin, i mean, make my print CDC full scaled to the paper. In other way, which function in MFC printing is to set the printing CDC size. Thanks!

    C / C++ / MFC c++ tutorial question

  • CView: Change background color
    A a_du

    I called setBKColor in on draw function but nothing happend, why? how to use setBKColor function and how to change the background color of the view. any one knows please tell me. thanx a lot.

    C / C++ / MFC tutorial question

  • barcode library
    A a_du

    some one can recommend a free MFC library that can generate barcodes with types: code-39, code-128, code-2 of 5, EAN-8 and EAN-13 Thanks a lot.

    C / C++ / MFC c++

  • Codebar library
    A a_du

    some one can recommend a free library that can generate codebars.

    C / C++ / MFC

  • Use Thread to update UI
    A a_du

    my boss told me that user created thread cannot be used for updating the UI data. i am wondering wheather it is true as i never see this in MSDN. timer works properly. i think the other way is to use event, but i have tried this way

    C / C++ / MFC design tutorial question announcement

  • Use Thread to update UI
    A a_du

    i want to create a status dlg which can display the status of a process, for example transfer files. i find that use user created thread to control UI often causes crashes or make system hung. so i have to change to using timer. is user created thread not allowed to control UI display?

    C / C++ / MFC design tutorial question announcement

  • 1KB/S problem
    A a_du

    I create several worker threads which using CFtpConnection to atuomatically upload a batch of files to a ftp server. the strange thing is that: even i test on my local ftp server i still find some files get 1KB/S transfer speed.and this is not because of the file as i find the files get this speed is random. why this happend? Thanx.

    C / C++ / MFC sysadmin performance help question lounge

  • CCriticalSection problem. Pls help!
    A a_du

    I have a dialog which contains a CListCtrl to dislplay some information. two cwinthreads from other dlg keep updating the data of the CListCtrl. the CListCtrl's handle is passed to the threads and there is a Shared CriticalSection among these 3 objects. when i close the dlg, i want to set a flg to inform the two threads that the list is destroyed. so i call in the exit event of the dlg: lock.Lock(); destroyFlg = true; // the threads will check this flg before access the list //and access to the list is protected by lock & unlock lock.UnLock(); what happend is that , the dlg is hung. i traced and find it hung at lock.Lock(); there is only one crictical section and i am sure i have paired each lock() with a unlock(). why this still happend? Some one knows please help me. thanx a lot. :(

    C / C++ / MFC help question

  • CFile---reda write
    A a_du

    Hey, i want to read and write a .csv file using CFile. the records are like the following: 1.tif,Transferred,12:00-12:10,10KB/S 2.tif,Transferred,12:30-12:40,10KB/S 3.tif,Transferred,13:00-13:10,10KB/S how can i load the contents into a CString and how can i read content line by line into a CString by using CFile class? CFile::GetLength resturns the length of the file. but, if i define a buffer[length] to load the data, i found that the last few chars of the array are mass things.How does this come? Thanks a lot!:^)

    C / C++ / MFC question data-structures

  • How to Terminate a CWinThread
    A a_du

    :-DThank you very much. I have fixed my problem. I have a question about the GetExitCodeThread function. if AfxEndThread fucntion is called inside my thread, what value i can get use GetExitCodeThread function. dose AfxEndThread function really can deallocate all stack of hold by the thread. Thank you.

    C / C++ / MFC question help tutorial

  • How to Terminate a CWinThread
    A a_du

    Using Pointer really can change access the data have been passed into the thread. thanx a lot. One more question is that is there any potential problem if uing this method. i mean , if the thread loop is reading the status while outside fuction change the status at same time.

    C / C++ / MFC question help tutorial

  • How to Terminate a CWinThread
    A a_du

    en. Thanx. i try it now.

    C / C++ / MFC question help tutorial

  • How to Terminate a CWinThread
    A a_du

    Can you give me a sample of this mechanism. by calling PostThreadMessage( ) how can i implement the CWinThread so that it can catch the message? i have ever tried this way: threadRoute() { GetMessage(.....) } but is not what i want, because i need a loop inside the thread fucntion. it is keep looping until i want to terminate. Thanx!

    C / C++ / MFC question help tutorial

  • How to Terminate a CWinThread
    A a_du

    but for CWinThread, the thread process funtion is a static fucntion. the parameters are passed into thread fucntion by the "LPVOID param" argument. How can i pass a class member attribute into the thread function? Thanx.

    C / C++ / MFC question help tutorial

  • How to Terminate a CWinThread
    A a_du

    Actually i am not sur :( i create a dlg which has a control list. when this dlg is created by calling domodal(), a CWinThread is created in OnInit funtion. The thread will keep reading the log files and display the contents on the control list. User will click cancel of the dlg to exit the dlg. problem is if i don't kill the Thread, it may still hold the handle to the log file. so further writing to the log file will cause problem.

    C / C++ / MFC question help tutorial

  • How to Terminate a CWinThread
    A a_du

    I use AfxBeginThread to create a thread in which, there is loop keep reading a log file and display the contents. This thread is a memeber of a dialog. when i exit the dialog by click "Cancel" button. how can i terminate the thread when i click the "cancel" button? I see some one said can use PostThreadMessage, but how can i catch the message as the thread process is a loop fuction. Pls Help.

    C / C++ / MFC question help tutorial

  • About <b>FindFirstChangeNotification</b> and <b>ReadDirectoryChangeW</b>
    A a_du

    Thanx alot. I have solved that problem by using multithread. BTW, can some one tell me the differences between these two functions and whether it is possible to retrieve file name informations from the FindFirstChangeNotification approach.

    C / C++ / MFC help c++ data-structures

  • About <b>FindFirstChangeNotification</b> and <b>ReadDirectoryChangeW</b>
    A a_du

    hi, i am developing a folder watching application. i want to use the fuction FindFirstChangeNotification and ReadDirectoryChangeW. The problem here is when i create a MFC project using Dialog approach i inlcude the sample code MSDN provide in a button handler function, and if i run it, the application will hung and i have to use task manager to close it. the same thing happen if i use ReadDirectoryChangeW. however if i put the same code in a win32 application project( using MFC shared .dll ), it can works well. Pls help, thanks, the msdn sample code is below: DWORD dwWaitStatus; HANDLE dwChangeHandles[2]; // Watch the C:\WINDOWS directory for file creation and // deletion. dwChangeHandles[0] = FindFirstChangeNotification( "C:\\WINDOWS", // directory to watch FALSE, // do not watch the subtree FILE_NOTIFY_CHANGE_FILE_NAME); // watch file name changes if (dwChangeHandles[0] == INVALID_HANDLE_VALUE) ExitProcess(GetLastError()); // Watch the C:\ subtree for directory creation and // deletion. dwChangeHandles[1] = FindFirstChangeNotification( "C:\\", // directory to watch TRUE, // watch the subtree FILE_NOTIFY_CHANGE_DIR_NAME); // watch dir. name changes if (dwChangeHandles[1] == INVALID_HANDLE_VALUE) ExitProcess(GetLastError()); // Change notification is set. Now wait on both notification // handles and refresh accordingly. while (TRUE) { // Wait for notification. dwWaitStatus = WaitForMultipleObjects(2, dwChangeHandles, FALSE, INFINITE); switch (dwWaitStatus) { case WAIT_OBJECT_0: // A file was created or deleted in C:\WINDOWS. // Refresh this directory and restart the // change notification. RefreshDirectory is an // application-defined function. RefreshDirectory("C:\\WINDOWS") if ( FindNextChangeNotification( dwChangeHandles[0]) == FALSE ) ExitProcess(GetLastError()); break; case WAIT_OBJECT_0 + 1: // A directory was created or deleted in C:\. // Refresh the directory tree and restart the // change notification. RefreshTree is an // application-defined function. RefreshTree("C:\\"); if (FindNextChangeNotification( dwChangeHandles[1]) == F

    C / C++ / MFC help c++ data-structures
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups