|
Hi,
I have a MFC app in which i create controls dynamically in a View.For the edit control i need to set the width dynamically.may be to hold characters of length 10 or 15 or may be anything.How to handle this .I tried to use memebrs of Crect..but nothing works.
Pls help .i am struggling .
I don't use dialogs.The size of control is known only during runtime.
Thnks in advance
Ram
|
|
|
|
|
Look at the second parameter of CEdit::Create() . Otherwise, you'll need to use CWnd::MoveWindow() , or CWnd::SetWindowPos() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,
I would like to know if there is any way (preferrably easy ) of drawing an icon as an overlay over another icon on a dialog (like overlays in an imagelist).
I tried to use 2 CStatic controls with tranparent backgrounds, but it didn't seem to work.
If I had to subclass CStatic and create my own control for this, which methods should I implement besides OnDraw()?
Thanks in advance.
|
|
|
|
|
Salvador Dali wrote:
Now, that is truly surreal!
Phil
|
|
|
|
|
Why is it so hard for us surrealists to do something that is so easy to do on the canvas (overlaying and mixing colors), in MFC?
|
|
|
|
|
Hello, I want to disable (gray) an item from the main menu created by the framework.
I know when the menu is create by code but here?? It must be really simple but I don't have a lot of time to search in the MSDN doc
Thanks
|
|
|
|
|
EnableMenuItem() ?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Yes I know but how to retrieve this main menu created by the framework ????
|
|
|
|
|
GetMenu().
I case you mean the menu on top of your app.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hum, great! That was easy
Thanks
|
|
|
|
|
Is there something wrong with this code?
void Calculate(const int &a, float *b, int &c); //?
int a; //can i initialize a
float b;
int c;
float d = 20.4;
Calculate(a,b,c); //function call
void Calculate(const int &a, float *b, int &c)
{
//Code //
};
lets say a is 4, b is 0.0 and c is 5.
a is supposed to stay 4, b is supposed to be 0.25 and c 24.4 when the function returns.
Can someone correct please
oh and its not home work or an assignment or something
Thanks bhangie
|
|
|
|
|
In what way are the parameters being calculated? There must be some sense of the "Calculate" function
What do you want to achieve?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Some comments:
If you don't want a to change a variable, don't pass a reference to it. You can do something like this:
void Calculate( const int a, int c, float* f );
Here I'm not passing any references and you cannot change 'a' within Calculate. I can change the value of 'c' within the function, except the variable will retain its original value upon return. Now you maybe asking why I changed the parameter order. Mainly preferrence. I like to have the same types grouped together.
Yes, you can initialize 'a' just like you did with float. The variable 'a' at the point you placed it is not a constant value.
If you have anymore questions, just ask.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
Hi all, is there anyway of registering a custom file type with Visual Studio so that when I try to open a file I can see all files with the extension *.xrs? Also when I load the file I'd want it to have the same formatting rules as C++ (I know you can do this by clicking on the file properties and select C++ formatting, but this is only temporary, all subsequent .xrs files load in with no formatting and are just black text.
I await the forums decision.
|
|
|
|
|
found it! HKEY_CURRENT_USER\Microsoft\Devstudio\6.0\TextEditor\Tabs/Language Settings\C/C++\FileExtensions, add you custom file extension to that list for dev studio to apply c++ formatting to it. There is also a way to get dev studio to compile these files in with a project by adding the extension to HKEY_CURRENT_USER\Microsoft\Devstudio\6.0\Build System\Components\Platforms\Win32(x). This is highly useful for custom scripting languages where you can integrate a syntax checker to dev studio and use your scripts within the dev studio environment. Of course you'd better hope it uses the same syntax otherwise the formatting will be complete crap, but adding you user defined keywords to Microsoft Visual Studio\Common\MSDEV\Bin\USERTYPE.DAT (you'll have to create it yourself) will help you customise dev studio formatting rules to highlight your own keywords . You'll also need a fresh boot of msdev to see the results. Just thought I'd share this poorly documented info with the rest of the world .
Alan.
|
|
|
|
|
Hi !
In Visual Studio 6, when I right click on a class name or a function, I can select 'Open Document' or 'Go to definition of xxx'.
But when I do that, I get this error:
C:\xxx\xxx\myproject.bsc
This is not a valid browse information file.
What can I do to solve this problem ?
Thanks !
Jerome
|
|
|
|
|
Delete the .BSC (source browser) file and let it get recreated.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
can you make me an example with while and for,
thank you,please describe everything im a beginner.
thanks.
bye
khodadad@eminem.com
|
|
|
|
|
for(int nLoop = 0; nLoop < 10; nLoop++)
{
}
int x = 0;
while(x < 10)
{
x++;
}
If you are a beginner, I suggest you need a few books to learn the basics of C++.
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
|
Don't mind me, I'm in a teaching mood!
There are three diffrent looping structures within The C Programming Language and C++ (an extension of C). There are:
- for
- while
- do-while
Here is a brief description for each:
- for: The for loop is mainly used to step through something, like an array. It syntax is "for( staring index ; condition ; increment ) Statement" These statements can be incremented (or decremented) by a known value, like 1, 3, 5, 56, ... You don't need all the items within the paranthesis, but you do need the semi-colons. Example:
for( x = 0; x < 10; x++ ) a[x] = x; for( ;; )... Here I have an endless loop. for( ; x < 10; ) ... Here it is like the while loop.
- while The while loop is used to do looping until a condition is met. One example for the while would be in polling something. You continue waiting until the event occurs then drop out of the loop. You can interchange the for/while exactly like one of the post stated. The condition testing is done at the beginning of the loop.
- do-while This loop structure is a different animal than the rest. Unlike the for/while loops where they must first pass the condition to execute, the do-while will always execute the loop once. The condition testing is done at the end of the loop instead of the beginning.
I hope this helps. The uses that I described are not hard and fast, but they can be used as a guide line if your new until you get more experience.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
Hi there
Example, new to this myself!!
{
//Create vector put 26 numbers into it
//using for loop
for(int i = 0; i < 26; ++i)
{
Vec.push_back(i * 2); // pushback * 2
//2,4,6,8,10......
cout << Vec.at(i) << "\n"; //Display
}
Not that dificult hey.
Regards bhangie
|
|
|
|
|
How can I know if user clicked on the balloon help for the tray icon (Win2k, WinXP)?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hi all,
I have developed a dialog based application in VC++ 6.0
I have dropped a button and attached a event handler with this button.
I have created another dialog template for my child windows.
On button clicks I am calling new operator to create those MODLESS child dialogs windows.
Now when I call the Show(...) method and minimzes it, the child dilaog minimizes above the task bar rather then like normal dialog windows.
You can visualize the situation like, when we have a MDI application, and whenever we create a new view it minimizes within the MDI application rather then in the task bar.
Please anybody helps me in this regard.
The Phantom.
|
|
|
|
|
Hello!
I think I have read about ProfUIS library for C++ developer on this forum some days before, but I could not find the article this time. Could you, please, help me and give me a link to the article or any other article about ProfUIS.
Best Regards,
Haldir
|
|
|
|