|
I need to create a simple child window (a frame in the right of my parent's area) and I need to add some combo boxes and label (these controls change by user's preferences so they are not a fixed number)
I thought creating the child window dynamically without res template, adding dynamically controls based on user's preferences was a good idea
Otherwise i should implement almost 12 child template windows ._.!!
If you need clarifies, I could try to give more info
Thanks
---
|
|
|
|
|
You can create the controls at runtime, but you have to do the positioning yourself.
Another method (if it applies to this) would be to use a dialog resource with all the controls
you need, but the controls are hidden. At runtime you can make the appropriate controls visible
and reposition them easier because the layout is already partially done for you.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I definitely prefer placing controls by myself, but how to get Onclick event handler for a CStatic control for example?
Have I to use a derived class?
---
|
|
|
|
|
4288 wrote: how to get Onclick event handler for a CStatic control for example?
Have I to use a derived class?
With MFC, a CStatic-derived class is simpler. Just add a WM_LBUTTONDOWN handler.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thanks for the advice!
---
|
|
|
|
|
Yes, and change the size of the window / dialog to adapt it to the shown controls as well. I mean, 5 controls = one size, 10 controls = another size and so on.
It is the easiest way.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hello. I'm engaged in some data scraping off a web page and need to set some list box items. I'm having no trouble setting some integers but setting character values is a pain in the butt. Here is a snippet of my code:
if ( strTag == "tradeYear" )
{
CString strYear = m_strSystemDate.Mid(0,4);
strTag = "value";
bstr = strTag.AllocSysString();
VariantInit( &vVariant2 );
vVariant2.vt = VT_UINT;
vVariant2.intVal = atoi( strYear );
pElem->setAttribute(bstr, vVariant2);
SysFreeString( bstr );
nCheckInputs++;
}
if ( strTag == "venueChoice" )
{
if ( bFuturesData == true )
{
strTag = "value";
bstr = strTag.AllocSysString();
VariantInit( &vVariant2 );
CString strVenue = "Electronic";
BSTR bstrVenue = strVenue.AllocSysString();
vVariant2.vt = VT_BSTR;
vVariant2.bstrVal = bstrVenue;
pElem->setAttribute(bstr, vVariant2);
SysFreeString( bstr );
SysFreeString( bstrVenue );
nCheckInputs++;
}
}
The first block, tradeYear, works just fine and sets the desired value but the second doesn't cahnge the value of the box? If anybody could tell me what I'm doing wrong that would be great. Thank you.
Tom Paronis
|
|
|
|
|
i am trying to write a c++ program using VB 5 to create a base converter to do interconversion between OCT, DEC, BIN, HEX.
I am lost in doing this.....ANY sugestion.....HELP
jay
|
|
|
|
|
|
Mark Salsbery wrote: An article search can help
didn't someone else write an article on leanring hex and binary and converting bases... Jamesy, Jermini, something like that? he had some birdy last name, like eagle or vulture or something like that too....
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."
|
|
|
|
|
Jiminy Vulture I believe it was.
I'm sure Google can find it
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
El Corazon wrote: Jamesy, Jermini, something like that? he had some birdy last name, like eagle or vulture or something like that too....
Yeah, if you find that bastard let me know; he's been eating all my food!
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
|
You can't write a C++ program using VB 5. VB is for creating Visual Basic applications, not C++ programs.
|
|
|
|
|
jayyaj wrote: i am trying to write a c++ program using VB 5
While this is obviously impossible, a bigger question would be, why on earth would anyone use VB5 at all ? I mean, even VB6 is a dead language.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: I mean, even VB6 is a dead language.
Zombies are quite popular in programming languages.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
He's an archaeologist + a part-time Programmer.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
jayyaj wrote: I am lost in doing this.....ANY sugestion.....HELP
Try something like this in C/C++...
int main (int argc, char *argv[])
{
int vb = *system("VB5");
echo(vb->convert(150, "binary", "hexadecimal"));
}
|
|
|
|
|
mmm...oatmeal...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: mmm...oatmeal...
Unfortunately, it's more like "mmm... money" right now, but I so hope to get back on track with it. It's profoundly more fun than web development IMO.
|
|
|
|
|
Jeremy Falcon wrote: It's profoundly more fun than web development IMO.
you don't think I am in this business just for the money are you?
okay, the money helps, but enjoyment came first!
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."
|
|
|
|
|
El Corazon wrote: but enjoyment came first!
I'll second that. I suppose web dev could be worse (I'm not digging ditches at least), but it's not where my heart lies. I guess I need to win the lottery to hurry up and get back on track.
|
|
|
|