|
Hi Ilan,
You don't need to call Create (and you cannot, in your case). Create is used only if you create your ScrollBar (and this is true for any other control) at runtime. In your case, you use the resource editor so this is done automatically. Just drop it on your dialog and attach a control to it. And that's it !
|
|
|
|
|
Thanks again for the help. Apparently I didn't tell you the whole truth. In fact, I'm using a CDialogBar not a CDialog object. In the CDialogBar, it doesn't have the Add Variable object, so I did it manually with the DDX control.
Apparently, it is not for nothing that the Add Variable doesn't exist. The problem is that the CSrollBar has no window so it keeps crashing on the ASSERT check on the window. I tried my best to set the window, but with no success. I may have no choice but to actually create the scroll bar with the Create command and not drop it in at design time.
Thanks,
Ilan
|
|
|
|
|
IlanTal wrote:
I want to have a scrollbar in a dialog box, so I drag it in at design time. Then I want to attach this to a control m_myScroll.
My problem is that I don't know what to do with the Create function.
You don't need to call Create directly. Just add a DDX_Control for it in your dialog's DoDataExchange implementation:
void YourDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_MYSCROLL, m_myScroll);
}
This gets called during dialog initialization (CDialog::OnInitDialog ) and does all the work for you.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi All.
I have a window which has child windows of two types.
The child windows can be of non-rectangle shape.
I need to exclude from painting the areas occupied by
windows of the first type but not the second ones.
If I create the window with the WS_CLIPCHILDREN option,
I'll get the both types of child windows excluded.
What might be the best way to implement this using
VC++ and MFC?
I've looked towards regions but at the moment it looks a
little bit difficult comparing with just specifying one
option.
Thanks.
|
|
|
|
|
1) WS_CLIPCHILDREN appies mainly to OnEraseBkgnd(), so override it to return success.
2) Do all your drawing in OnPaint() or OnDraw().
3) Draw what you need and then exclude there regions or rects.
4) Draw background.
Beyond that, your question does not make much since.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
How can I change the theme of my program? I want to change this classic gray theme and put something else...
|
|
|
|
|
Simple theme or visual style?
Don't try it, just do it!
|
|
|
|
|
I don't know, what's the difference? Tell me both if you know
|
|
|
|
|
Visual styles is the feature of xp, which enables you to change the complete design of the windows ui (e.g. the blue design or the silver design.. you know what I mean?). Themes are concerning just the color of controls and windows, sounds, icon spacings, text sizes, etc.
So if you just want to change the e.g. the title bar color to red, you can use SetSysColors.
For other settings use SystemParametersInfo.
Have a look here for more APIs: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/system_information_functions.asp[^]
Don't try it, just do it!
|
|
|
|
|
Can you please elaborate what exactly do you want to do.
What is theme?
Anil Kumar
|
|
|
|
|
How can I handle message of a class that drived from COleControl?
I added some function like WndProc(...), but program does NOT reach them!?
|
|
|
|
|
|
can anybody help!
i am creating check boxes at run time in the Statc group box.and i want if the no. of check boxes are upto 13 a scroll bar will added vertically on static group box and further check boxes will create in that group box.but i dont know how i do this
|
|
|
|
|
Use a checklist box. See CCheckListBox .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I have a dialog application that contains OnSize() to handle the resizing messages. I have a Window containing an activex control. When resizing the Window, the ActiveX Control fills the entire dialog Window. I dont want to fill the entire Window. Does anyone know how to control the sizing of the activex control??
Jerry
|
|
|
|
|
|
Handle WM_GETMINMAXINFO message
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi everyone.
I'm coding a source filter and a demultiplexer filter for DirectShow.
When I add the filters to the graph, connect the pins and render the whole thing it still works.
But when I run the graph via IMediaControl::Run it returns S_FALSE.
The SDK says that I should use IMediaControl::GetState after Run() has failed, but GetState() does never return when I have INFINITE as timeout, else it returns an error (VFW_S_STATE_INTERMEDIATE), too.
The graph uses Push-Mode.
Is there a way I can find out what is going wrong?
Thanks for advice,
Alex
Don't try it, just do it!
|
|
|
|
|
Problem solved. It's a live source, so there are some things different from a normal pull source.
Don't try it, just do it!
|
|
|
|
|
What is the rigth method to add a Statusbar to a Dialog?
I had done this way.
CStatusBar m_StatusBar //Memeber variable
m_StatusBar->Create(this);
But whenever i call 'Invalidate' method the status bar also flickering
Is the GetClientRect retrieves the StatusBar area also?
Thanks in Advance
Ann
|
|
|
|
|
I think the status bar is flickering because it is a child of the dialog. If you invalidate the entire dialog, then the status bar comes along for the ride.
Some things I would try:
1. Invalidate only the specific client area of the dialog that does not include the status bar.
2. Adjust the client rect of your dialog to exclude the status bar.
3. Set the clip children style of the dialog, so it does not erase or repaint the area with the status bar or any other child controls.
|
|
|
|
|
Anyone knows a method which does hexadecimal to decimal conversion in the visual c++ library ??
Cheers
llp00na
|
|
|
|
|
|
Now I've checked it. Here it is:
int hexToInt(const char * hex)
{
// Expects to get ONE hex digit at the time
int result;
sscanf(hex, "%x", &result);
return result;
}
int main(int argc, char* argv[])
{
int i = hexToInt("FF"); // i becomes 255
i = hexToInt("80"); // i becomes 128
i = hexToInt("40"); // i becomes 64
i = hexToInt("0"); // i becomes 0
return 0;
}
|
|
|
|
|
thanx for the reply, i will test your suggestion and see the results.
I am trying to get colours from the html source code and convert them to RGB format.
using your method will make it easy to convert a string of the format #ffffff
as i will just devide the string into three parts where each part represents red, green, blue respectively.
My problem now is that people sometimes do not use conventional formats but instead use for example : #fff to refer to #0f0f0f, that should not be so hard to deal with. a more complicated case would be : #9999 !!! how do i now which part of the string refers to red, green, and blue !!!
llp00na
|
|
|
|