|
Assuming it has one, try VerQueryValue() , GetFileVersionInfo() , and related functions.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
So inorder to get the version I have to use all three of those functions listed in the MSDN? There's no easier way?
By the way is the answer 2?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote:
So inorder to get the version I have to use all three of those functions listed in the MSDN?
Yes, you'll need to call GetFileVersionInfoSize() , GetFileVersionInfo() , and VerQueryValue() , in that order.
Tom Wright wrote:
There's no easier way?
It's easy once you've done it a few times. Now if you have no interest in how it all works, you can always skip to this class.
Tom Wright wrote:
By the way is the answer 2?
No.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The application lost the toolbar tooltips after the SetState statement
m_wndToolBar.GetToolBarCtrl().SetState(ID_INBOX, TBSTATE_HIDDEN)
If I comment this line out, the tooltips comes back.
I tried to get the tooltips back by adding the following line
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS)
But this does not work. The tooltips are not showing up at the toolbar.
Elizabeth
|
|
|
|
|
Hi!
I am building a chat application and I'd like the main chat window to scroll down (such that the last message is at the bottom of my CRichEditCtrl) when the user enters a message.
I have not been yet able to do this. I know about LineScroll, but how many lines should I scroll with it? (Because the user can move the scroll bar upwards whenever he wants.)
Thanks!
|
|
|
|
|
How about this:
long lPos = GetRichEditCtrl().GetTextLength( );<br />
GetRichEditCtrl().SetSel( lPos, lPos );
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
This doesn't work.
From SetSel()'s help:
"This function does not scroll the contents of the CRichEditCtrl so that the caret is visible."
Other ideas?
|
|
|
|
|
Yes, you are right, SetSel function does not scroll the contents...
However, I think that the user will be annoyed if he decides to scroll up and see for example history of messages and at that time another message arrives and your code will scroll down. I think it's not right.
So, think about it: maybe you don't have to scroll. Just append new message to the end. In that case SetSel helps.
Not insisting of course:
void CChatView::AddString(LPCSTR lpszStr, COLORREF color )<br />
{<br />
LONG nStart, nEnd;<br />
GetRichEditCtrl().GetSel( nStart, nEnd );
LONG nLength = GetTextLength( );<br />
<br />
long lPos = GetRichEditCtrl().GetTextLength( );<br />
GetRichEditCtrl().SetSel( lPos, lPos );
<br />
GetCharFormatSelection();<br />
m_charformat.dwMask = CFM_COLOR;<br />
m_charformat.dwEffects = NULL;<br />
m_charformat.crTextColor = color;<br />
GetRichEditCtrl().SetSelectionCharFormat(m_charformat);<br />
Edit_ReplaceSel(m_hWnd, lpszStr);<br />
<br />
if((nStart != nEnd)&&<br />
(nLength > nEnd + 10))<br />
GetRichEditCtrl().SetSel( nStart, nEnd );
}
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
The user won't be annoyed, because I want this scrolling to take place only when HE enters the message (and not his chat partner), so that he doesn't have to scroll down to the last line and then enter his message.
Thanks anyway!
|
|
|
|
|
This doesn't work.
From SetSel()'s help:
"This function does not scroll the contents of the CRichEditCtrl so that the caret is visible."
Other ideas?
|
|
|
|
|
Here's a really late response for you, and I understand that you will probably already have a solution. But my searching around on the net didn't find much more than your question and a lack of an answer. Hope this helps someone else.
This works for me:
CRichEditCtrl results(myEditBoxHWND);
LONG lLen = results.GetWindowTextLength();
results.SetSel(lLen, lLen);
results.ReplaceSel(_T("My new bit of text\n"));
int nFirstVisible = results.GetFirstVisibleLine();
int nTotalLines = results.GetLineCount();
results.LineScroll(nTotalLines - nFirstVisible); Phil
--
All things considered, you can't really consider all things ...
|
|
|
|
|
When I select various items in a CListCtrl they are obviously selected because the background colour changes.
However, when the CListCtrl looses focus, the items are not obviously in focus. Is there anyway I can change this so it behaves more like Windows Explorer and leaves the selected items selected, but a different colour when the window is out of focus.
Many thanks,
Alan Dugdall
|
|
|
|
|
Check the list control's "Show selection always" property in the resource editor. You can also set this style programatically by doing:
DWORD dwStyle = ListView_GetExtendedListViewStyle (m_listCtrl.GetSafeHwnd());
dwStyle |= LVS_SHOWSELALWAYS;
ListView_SetExtendedListViewStyle (m_listCtrl.GetSafeHwnd(), dwStyle);
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I need a way to make my app (a dialogproject in VC++) to bee maximized at startup when running my app.
Thanks
APe
|
|
|
|
|
Add this in your OnInitDialog():
ShowWindow (SW_MAXIMIZED);
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello, all,
I am working on a project which needs to capture the mouse movement in IE browser window. How can I do it?
I think I can create a class and use SubclassWindow of IE. Is that right?
I this case, which class should my new class derive from?
And how can I get the HWnd of IE.
Or there is other ways to do it?
Thanks a lot.
bin
|
|
|
|
|
You can't subclass a window in another process without injecting code into that process.
You can however use a Windows hook. See SetWindowsHookEx in the Platform SDK documentation. You probably want one of WH_CALLWNDPROC , WH_CALLWNDPROCRET or WH_GETMESSAGE .
|
|
|
|
|
It sounds like you need to do soenthing limilar to what this article describes:
Mouse gestures in IE[^]
I have not read it, but it probably does something like you need.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Hi
Can i do so that my MFC dialog launch from WinAPI dll.
Or i can to do it only in MFC dll project????
Actually i do this but after loading of my dialog AfxGetThread()->PumpMessage was invoked from MFC code and application failed.AfxGetThread return NULL,but in my code i set AFX_MANAGE_STATE(AfxGetStaticModuleState()) and change _WINDLL to _AFXDLL macro.
Thank.
|
|
|
|
|
Hi
I recently ran into a strange problem. I used the new function myDoublePtr = new double[some_number]. However, I used 570000000. The compiler gave me an array too big error. I have 1 gig of ram. Is it a compiler thing? Or maybe the language. Thanks
|
|
|
|
|
The computer did not have 570,000,000 bytes of contiguous RAM to offer.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
You cant expect 570000000*sizeof(double) = 4.56x10^9 bytes = 4.2 GB from the heap.
If you really need that much memory (I doubt it! Revise your algorithms), you probably need to look into memory mapped files.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Nothing strange about it.
The most the memory manger can allocate for one buffer is around 1 gig not 4 gig. Look up virtual memory management in the MSDN library for more info..
You should be breaking up your storage requirments into multiple smaller buffer, how many and how small is up to you. You could use GlobalAlloc() to allocate the individual buffers, but now days the MSDN recommends using the heap allocation management routines instead.
INTP
|
|
|
|
|
I know that it can be a silly question but I would use a function to pass from text string "1234" to float 1234.
thanks in advance
|
|
|
|
|
atof or sscanf .
If you're using the Standard C++ Library, you could also use a stringstream and extract the data out using the >> operator.
Finally, you could consider Boost's lexical_cast[^] template.
|
|
|
|