|
Try erasing the class wizard file(your_project.clw file)
and try enter again to class wizard(ctrl + w).
Regards,
Eli
|
|
|
|
|
there is class wizard file
|
|
|
|
|
sorry there is no class wizard file.
|
|
|
|
|
Is this MFC project?
if so,try ctrl + W to create new class wizard file and
choose "Add all" button to add al classes to class wizard.
|
|
|
|
|
|
HI,
How can I determinate the mouse click position within an CListCtrl::OnColumnClick handler relative to the upper left corner of the headers column rectangle.
It seems that the NMLISTVIEW ptAction member is not used for this notification message ?
Thx.
|
|
|
|
|
Use GetMessagePos() to get the mouse position of the last message retrieved with GetMessage() . This should solve your problem.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello!
Suppose that we have a list of printer names and papers in CComboBox.
Is there a way to get the printer DC from these info or technically :
<br />
CDC* getPrinter(LPCTSTR printerName, LPCTSTR paper, int landscape=1);<br />
Your comments & ideas are really helpful.
Thanks
|
|
|
|
|
use CreateDC(...) and pass in a properly filled devmode.
Vipin - MVP
|
|
|
|
|
Thank you very much for your comments. It really works
Sovann.
|
|
|
|
|
Hello,
I'd like to have more information about Web-Style based GUI for MFC application. There is an article here at Codeproject. However, I need more information than it provides.
I'd be very pleased if you can give some sites or articles to read.
Thanks
Allad
|
|
|
|
|
The custom control is associated with a class derived from CScrollView,
works fine, but when I try to handle WM_CREATE in OnCreate, I found that OnCreate isn't called.
I don't know where to put the initial code after the control is created and before displayed.
Thanks for help.
|
|
|
|
|
You can try to call CView::OnInitialUpdate
It is called before the control is displayed.
Cheers,
Allad
|
|
|
|
|
It's not called either.
PreSubClassWindow is ok.
|
|
|
|
|
Because when your class is ready to handle messages, the control has already been created.
So you should insert your initlizing code in PreSubClassWindow().
|
|
|
|
|
If your custom control is on a dialog or form view (created from a dialog template) then your class's OnCreate() is never called. That is because the contol window is created when the dialog is created, and then your control subclasses the window. Use PreSubclassWindow to handle the code that you would normally handle in OnCreate .
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
I need a example for CopyFile() in MFC..
Anyone please....
|
|
|
|
|
in MSDN Samples, there s a sample pro named fibers, which copies a file frm a src dir, to a destn dir
the source filename, qualified with path and the destination path can be input as command line parameters..
hav a nice time copyin files
thanks,
-- ano
|
|
|
|
|
Hi all -
Here is the problem.
I need to create five worker threads in my win 32 dll and keep them alive throughout the host process life time. I need to call certain routines in these threads as per the host process's calls. I want to know what are the possible loopholes in this code. Is it correct or totally wrong? Your expert and experienced comments will be greatly appreciated..
The code looks like
HANDLE m_hThreadF1 = 0; //global thread handles
HANDLE m_hThreadF2 = 0;
HANDLE m_hThreadF3 = 0;
DLL::Function1() //this routine gets called by the host process
{
if (m_hThreadF1!=0)
ResumeThread(m_hThreadF1)
else
m_hThreadF1 = CreateThread(,,ThreadFuncF1,0); //not in
suspended mode
//Wait on the above thread to finish, then return, probably via an event
}
ThreadFuncF1() //thread handler
{
//do the intended processing
SuspendThread(m_hThreadF1)
}
|
|
|
|
|
Why do you call suspendthread? If you suspend the thread it will not exit and thus if you wait on the thread handle it will not ever be signaled. It's only signaled when the thread exits and unless you have another thread calling "ResumeTHread" that thread will just sit around.
Also, I know you didn't do this up there but never suspend a thread from another thread; it could be holding a lock and thus deadlock the process since you don't know what it's doing when you suspend it.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
See here for an interesting article about why you shouldn't (in general) call SuspendThread . If you want one thead to wait until another is finished try code like this:
WaitForSingleObject(m_hThreadF1, INFINITE);
A thread handle is a waitable object - It becomes signalled when the thread exist.
Steve
|
|
|
|
|
some tips, uh?
the method, WaitforSingleObject(threadhandle, waittime)
will return a value equal to WAIT_TIMEOUT if the thread is still alive (not in signalled state). instead of if(m_hThreadF1 != 0) try using this method with waittime as zero, as below:
if(WaitForSingleObject(m_hThread, 0)==WAIT_TIMEOUT)
// The thread s alive
else
// The thread s signalled, spawn new
make sure that the pThread's m_autodelete s set to false.
u mentioned, the thread s supposed to be alive till da end.
in this case, it seems, ur thread func has to make a slight modification. ResumeThread(handle), will resume a thread from the point it has been suspended, so, in ur case, when the ThreadFuncF1 resumes, it jst exits!!!
ThreadFuncF1()
{
do{
// do the intended processing
// Finished Processing, Notify parent
SuspendThread(m_hThreadF1)
}while(TRUE); // do processing again
}
hope thes'll help.
thanks,
-- 'whiz'
|
|
|
|
|
how can i change the background color of selected listctrl item i have set show selection allways property , it show only gray color but i want to change this color.
Bankey Khandelwal
Software Engineer
Solversa TechnologiesPvt.Ltd.
15,Yeshwant Nagar
Range Hill Road
Ganeshkhind,Pune-03
bankey.khandelwal@solversa.com
Mobile: +91-9850432990
Office : +91-20-25521888
|
|
|
|
|
There are probably lots of ways to do this - but one that springs to (my) mind is "Custom Draw". See here. Doing a search for "Custom Draw" on the The Code Project and Google will no doubt give many hits.
Steve
|
|
|
|