|
I think, even though u r calling DoModal() on modal dialog box, the main focus is present on the view and mainframe and the Menu is grayed may be because you may have attached the menu to the dialog box instead to the main window. Try attaching the menu to the main frame window.
Work hard and bit of luck is KEY to SUCCESS.
|
|
|
|
|
Thanks, but no menus involved. Just the form view calling a modal child dialog via a button and the form view call a modeless child dialog via another button.
|
|
|
|
|
I want to get the handle for the drop down button of a Combo Box control.
I tested the following code but the drop down button doesn't seem to be a child of the CComboBox:
...
CWnd* pChild = this->GetWindow(GW_CHILD);<br />
hwndChild=pChild->GetSafeHwnd();<br />
::GetClassName(hwndChild, szClassName, 256);<br />
if(!memcmp(szClassName, "Edit", sizeof("Edit")))<br />
{<br />
<br />
pChild = pChild->GetWindow(GW_HWNDNEXT);<br />
<br />
if(pChild)<br />
{<br />
hwndChild=pChild->GetSafeHwnd();<br />
::GetClassName(hwndChild, szClassName, 256);<br />
}<br />
}
...
Any ideas?
Thanks,
Lula Capixaba
|
|
|
|
|
lulacapixaba wrote:
the drop down button doesn't seem to be a child of the CComboBox
of course it isn't, otherwise how could it be itself a par of the conbobox ?
A ComboBox can be see as a set of 3 controls encapsulated into once : an editbox, a listbox and a button.
about accessing one of these parts, i really don't know how to do, and am waiting with interest for an answer too, but i think you should search for Owner Drawn control...
ps: just curious, what are you trying to do with this button ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I've just researched this problem; conclusion:
There is no button to get, the button is drawn by the control and is not a child window.
Where I looked: MSDN, PUI library code (see CP article) and I used spy to double check my conclusions.
I assume you want to control over how the button is drawn. In which case look at the PUI library code, plus other articles on drawing Win2000 and WinXP style minues a buttons.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Thanks John. I think you are right.
Lula Capixaba
|
|
|
|
|
I'm developing a network app with a listview that shows files that can either be cached locally or only on the server. I have implemented the listview as a drop source and it downloads files that are selected when initiating the drag.
Now to the problem. I'm setting the file paths in the drop object, however those files that does not exist locally must be downloaded before it can be physically copied to the drop target.
Is there a way to make the explorer drop target wait for my app to finish downloading it's files and then receiving all the paths ( So the user will get the little plus sign when dropping it on the explorer window ).
Any ideas would be most welcome!
|
|
|
|
|
How about delayed rendering in clipbord. I guess you can reuse same mechanizm?
|
|
|
|
|
Thanks for that information! That was just what I needed.
Found this useful article on CodeGuru:
http://www.codeguru.com/Cpp/W-P/clipboard/article.php/c3015/
|
|
|
|
|
|
Hello and thanks for looking at my problem,
I want to both select some text and set the caret postion in a edit control as if the user clicked the mouse at the end of the text and then draws the mouse pointer towards the beginning of the text. When doing so, the caret position is somewhere in the middle of the text and everything behind it is selected, like this:
this is |some text
where the bold stuff is selected and the caret is the "|".
EM_SETSEL always results in selected text with the caret at its end, like this:
this is some text|
but I need the caret at the beginning. Does anyone know how to do?
Thanks a lot...
Martin Hoppe
|
|
|
|
|
Reverse the starting and ending position arguments:
pCtrl->SendMessage(
EM_SETSEL, // message to send
(WPARAM) 10, // starting position
(LPARAM) 5 // ending position (caret postion)
);
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Thanks a lot for your answer, Andrew!
Unfortunately I already tried that, but does NOT work. But maybe this is because I am on Embedded C++ 4.0? At least I am sure it does NOT work in Embedded C++ 4.0, but I will have a look in C++ 6.0 too.
Do you or anyone have a solution for eMbedded C++, too?.
Thank you very much...
Martin
|
|
|
|
|
What about using EM_SETSEL with the beginning and the end at the same position?
Don't try it, just do it!
|
|
|
|
|
I am trying to use regular expressions in my application but I get these errors that I don't seem to be able to solve.
In the properties page of the Solution I have provided links to the Regex++ libraries and includes. My code is as follows (basically a copy of what is given as examples in the Regex documentation)
#include <boost/regex.hpp> <br />
<br />
using namespace boost; <br />
<br />
bool grep_callback(const match_results<wstring::const_iterator, regex::alloc_type>& result) <br />
{ <br />
return true;<br />
}
....
{ ...
wstring str_exp = L"[^\\\"]";
wstring expression = str_exp + *searchword + str_exp;
wregex e(expression);
wstring::const_iterator start = text.begin();
wstring::const_iterator end = text.end();
regex_grep(grep_callback, start, end, e, match_default);
}
Can anybody help me?
These are the errors I get:
c : \ B o o s t \ i n c l u d e \ b o o s t \ r e g e x \ v 4 \ r e g e x _ g r e p . h p p ( 5 2 ) : e r r o r C 2 6 6 4 : ' b o o l ( c o n s t b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r , A l l o c a t o r > & ) ' : c a n n o t c o n v e r t p a r a m e t e r 1 f r o m ' b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r > ' t o ' c o n s t b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r , A l l o c a t o r > & '
w i t h
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r ,
A l l o c a t o r = b o o s t : : r e g _ e x p r e s s i o n < c h a r > : : a l l o c _ t y p e
]
a n d
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r
]
a n d
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r ,
A l l o c a t o r = b o o s t : : r e g _ e x p r e s s i o n < c h a r > : : a l l o c _ t y p e
]
R e a s o n : c a n n o t c o n v e r t f r o m ' b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r > ' t o ' c o n s t b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r , A l l o c a t o r > '
w i t h
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r
]
a n d
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r,
A l l o c a t o r = b o o s t : : r e g _ e x p r e s s i o n < c h a r > : : a l l o c _ t y p e
]
N o c o n s t r u c t o r c o u l d t a k e t h e s o u r c e t y p e , o r c o n s t r u c t o r o v e r l o a d r e s o l u t i o n w a s a m b i g u o u s
c : \ C + + P r o g r a m s \ C C M e t r i c V i e w e r \ W o r d S e a r c h e r . c p p ( 1 0 8 ) : s e e r e f e r e n c e t o f u n c t i o n t e m p l a t e i n s t a n t i a t i o n ' u n s i g n e d i n t b o o s t : : r e g e x _ g r e p < b o o l ( _ _ c d e c l * ) ( c o n s t b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r , A l l o c a t o r > & ) , s t d : : b a s i c _ s t r i n g < _ E l e m , _ T r a i t s , _ A x > : : c o n s t _ i t e r a t o r , c h a r T , t r a i t s , s t d : : a l l o c a t o r < _ T y > > ( P r e d i c a t e , B i d i I t e r a t o r , B i d i I t e r a t o r , c o n s t b o o s t : : r e g _ e x p r e s s i o n < c h a r T , t r a i t s , s t d : : a l l o c a t o r < _ T y > > & , b o o s t : : r e g e x _ c o n s t a n t s : : m a t c h _ f l a g _ t y p e ) ' b e i n g c o m p i l e d
w i t h
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r ,
A l l o c a t o r = b o o s t : : r e g _ e x p r e s s i o n < c h a r > : : a l l o c _ t y p e ,
_ E l e m = w c h a r _ t ,
_ T r a i t s = s t d : : c h a r _ t r a i t s < w c h a r _ t > ,
_ A x = s t d : : a l l o c a t o r < w c h a r _ t >,
c h a r T = w c h a r _ t ,
t r a i t s = b o o s t : : r e g e x _ t r a i t s < w c h a r _ t > ,
_ T y = w c h a r _ t ,
P r e d i c a t e = b o o l ( _ _ c d e c l * ) ( c o n s t b o o s t : : m a t c h _ r e s u l t s < s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r , b o o s t : : r e g _ e x p r e s s i o n < c h a r > : : a l l o c _ t y p e > & )
]
c : \ B o o s t \ i n c l u d e \ b o o s t \ r e g e x \ v 4 \ r e g e x _ g r e p . h p p ( 6 7 ) : e r r o r C 2 6 6 4 : ' b o o l ( c o n s t b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r , A l l o c a t o r > & ) ' : c a n n o t c o n v e r t p a r a m e t e r 1 f r o m ' b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r > ' t o ' c o n s t b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r , A l l o c a t o r > & '
w i t h
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r ,
A l l o c a t o r = b o o s t : : r e g _ e x p r e s s i o n < c h a r > : : a l l o c _ t y p e
]
a n d
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r
]
a n d
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r ,
A l l o c a t o r = b o o s t : : r e g _ e x p r e s s i o n < c h a r > : : a l l o c _ t y p e
]
R e a s o n : c a n n o t c o n v e r t f r o m ' b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r > ' t o ' c o n s t b o o s t : : m a t c h _ r e s u l t s < B i d i I t e r a t o r , A l l o c a t o r > '
w i t h
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r
]
a n d
[
B i d i I t e r a t o r = s t d : : b a s i c _ s t r i n g < w c h a r _ t , s t d : : c h a r _ t r a i t s < w c h a r _ t > , s t d : : a l l o c a t o r < w c h a r _ t > > : : c o n s t _ i t e r a t o r ,
A l l o c a t o r = b o o s t : : r e g _ e x p r e s s i o n < c h a r > : : a l l o c _ t y p e
]
N o c o n s t r u c t o r c o u l d t a k e t h e s o u r c e t y p e , o r c o n s t r u c t o r o v e r l o a d r e s o l u t i o n w a s a m b i g u o u s
I am the handsome one in the crowd.
|
|
|
|
|
My application is based on the SDI with the splitter view.The left view is derived of a common class CView which is used to show the vector graphics and the right view is derived of a class CFormview.Now ,I want to show the full vector graphics in the left view but the full vector graphics is so large that canot be showed .So I think it may called "zoom the graphics". How can I do?
Also I donot plan to use the HScroll and VScroll th show the graphics.
Thank you.
|
|
|
|
|
Use StretchBlt() or use GDI mapping functions like SetViewportExt() and ScaleViewportExt().
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi there
I'm getting loads of link errors when trying to run this OpenGl with Glui program on Visual C++ .net 2003, but not in Visual Studio C++ 6.
error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator==(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &,char const *)" (__imp_??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z)
I've included all the necessary .lib files in the Linker tab of Project properties, opengl32.lib, glut32.lib, glu32.lib and glui32.lib. Also I've ticked include MFC in shared dll. My glut.h, glu.h and glui.h header files are in the PlatformSDK/include/gl directory and glut32.dll is in c:/Windows/system directroy so I don't know what the problem is. Can anyone help me?
Thanks
|
|
|
|
|
I have an app with a CFrameWnd (SDI), a CPropertySheet with several CPropertyPages in it. Any time the user switches to another app on the computer and returns to my app the focus, which was in a control on the proppage, is lost.
If using a CDialog as the parent of the sheet and props anything is fine only the main frame seems to cause the problem.
Has anyone any suggestions how the problem can be solved?
|
|
|
|
|
Why on in CFrameWnd you wouldn't rout fosus to the view/CPropertySheet/CPropertyPage (ActivePage)
You can get view from frame and set on view focus to any control.
I guess when frame gets focus back it don't remembers what control on the view was active.
|
|
|
|
|
Thanks for your help, but I guess I havn't got it right.
How do I know after returning which control has had the focus before? Is this stored somewhere in a CWnd object?
Do I have to call OnSetFocus() ( via SetFocus()) for all the windows ( CFrameWnd -> CView -> CPropertySheet -> CPropertyPage )? This is what I have done but that hasn't worked right. The only positive effect was that I coould set the focus on the first control on the page.
Some further help would be appreciated.
|
|
|
|
|
If you not keep information where focus was, nobody will do it for you. You can keep information obdatined from OnKillFocus(...) Why is so important to have focus on particar control. Why not set focus on View or PropSheet if you want. Unless while you was in other app, programmaticaly PropPage switched to another page and you want switch it back when focus will be set to your app. Other than that I don't know.
Anyway you as the developer need to deside preserve focus or not.
|
|
|
|
|
Hi everybody!
Im trying to develop an application to control my webcam using DirectShow instead of Video for Windows. Everything works ok, I mean, I connect the driver of the camera and I can see the image of the webcam. But what I haven´t been able to do is capturing a still image. The problem is the following instruction:
IPin *pPin = 0;
hr = pBuild->FindPin(pCap, PINDIR_OUTPUT, &PIN_CATEGORY_STILL, 0,
FALSE, 0, &pPin);
Where "pCap" is a IBaseFilter intarface, and it controls the capture, and "pBuild" is a "ICaptureGraphBuilder2" interface. With this instruction, I get this error: "E_FAIL".
Ive been reading the specifications of my webcam (Creative NX PRO) and it has support for DirectShow. It also has a button that allows to take photos using hardware trigger (thats why I suppouse that it has a "Pin_Category_Still").
If anybody knows any other way to take a photo, please tell me.
I appreciate any idea you can tell me about it.
Thank you very much for your help!
PerroFlaco
|
|
|
|
|
Have you been able to get it to work in GraphEdit? Play around with it there and see what pins go where and then you can easily translate it into code.
|
|
|
|
|
I don't even know that GraphEdit exits! . Ill take a look and see what happens. By the way, can you see what PIN are available using GraphEdit? I hope this help me to solve this problem.
Thanks Mark!
|
|
|
|
|