|
I checked the code (had to do some corrections). And found that it displays same as that we can see in the Memory window at the time of debug. But you are expecting something different? Can you explain?
- NS -
|
|
|
|
|
You cannot change these types in memory, because int and double have different sizes in memory.
Else you could have changed your type in memory like this:
int nTst = 2;
double dTmp = (double) nTst;
double* pTst = (double*)&nTst;
*pTst = dTmp;
Is this what you meant?
|
|
|
|
|
hai ashish,
can you explain exactly what you want, as Cedric Moonen said, may be we will be able to help.
|
|
|
|
|
I want to make a particular item in listview bold after it is inserted, based on specific condition.
Below is the code that i am trying. But its not working. Can someone suggest me a way to do it
HFONT hDlgFont = (HFONT)SendMessage(get_Dialog(), WM_GETFONT, 0, 0L);
if (NULL != hDlgFont)
{
LOGFONT lFont;
if (GetObject(hDlgFont, sizeof(LOGFONT), (LPSTR)&lFont))
{
lFont.lfWeight = FW_BOLD;
hBoldFont = CreateFontIndirect(&lFont);
}
}
HWND hList;
LVITEM item;
ListView_InsertItem(hList, &item);
if (<condition>)
SendMessage(GetDlgItem(hList,item.iItem), WM_SETFONT, (WPARAM)hBoldFont, 0L);
|
|
|
|
|
You have to use CustomDraw
- NS -
|
|
|
|
|
You cannot change a perticular item of list control bold. If you want to do so, you have customdraw the list control. check this[^] for details of using the customdraw
|
|
|
|
|
|
For the sake of debug -- is there a way to determine that this thread is a UI thread (one based on CWinThread)?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
|
IsGUIThread(...) is not an MFC function, and is only available on WinXP (and above).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James R. Twine wrote: IsGUIThread(...) is not an MFC function
Cant he use this API in an MFC application?
|
|
|
|
|
What is a "GUI thread?"
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think a thread that has some user interface with the user is called GUI thread. I mean a thread that has a window or message loop some thing like that... What do you think?
|
|
|
|
|
Naveen.R wrote: What do you think?
I was just asking for clarification. I've always referred to a "GUI thread" as one with a message loop, whereas a "worker thread" as one without a message loop. In reality, the latter can also interact with UI components but not trivially.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
After you asked me the question I tried to call the function IsGUIThread() function from a thread which was created using AfxBeginThread() and CreateThread(). the behavior I found was that the IsGUIThread() function return true when called from a thread created using AfxBeginThread() where as it retured FALSE when called from a thread created using CreateThread(). after checking the MFC code, I found that When we call the AfxBeginThread the Entry point is actually _AfxThreadEntry and inside that function a SetWindowsHookEx() is called. Thats why the IsGUIThread() function returned TRUE when called from such threads. But I didnt understand why..
|
|
|
|
|
Thank you very much -- I will investigate!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
I know it look stupid.. do you have control over source code!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
huh?
The reason I asked the question:
I have these objects -- with entrypoints....
They affect UI and work much better when called from a UI thread -- threads with a message queue attached.
I just wanted to put some assertions in to make sure the API's were used correctly.
I'll take a look at IsGUIThread
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
FYI
In VS 2008, the threads window now has a category column that shows the main thread, worker threads, UI threads, and RPC threads.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hello,
I wanted to create a new table in access through a code in VC++.
Can I use CRecordSet to create a new table in access?
Prithaa
|
|
|
|
|
You can use CDatabase for this. Also, Google for "CREATE TABLE."
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
I just wanted to know that when we a make a dialog based application where are dialogs saved on disk as we have bmps saved in our res folder.
Thanks in advance
|
|
|
|
|
Do you mean dialog creation ?
Please refer here[^] for more information.
Regards,
Paresh.
|
|
|
|
|
Dialogs are on the RC files.Is this your answer?
|
|
|
|
|
Actually i m asking this thing because i have a dialog based application in a disk, when i copy same application on to another disk, size remains same but i am unable to get my dialog box in my newly copied application. I have opened resource file also, but definations are also not available there. Now i dont know how to get my previous dialog boxes.
|
|
|
|