|
you can use the follwing :-
SetParent(yourform->m_Hwnd,parentwnd->m_hwnd,..)
this code can make it child for any window(parentwnd)
thanks
faroq from yemen thammar
working in thammar universty and my intersted about network and security
im programmer from 6 years ago and ihave my B.C from this universty
|
|
|
|
|
I have been trying to open an MFC application in splitter panes. However I cant find any sample project that would show me how to do it.
If anybody could point me to some example that I could use or an extensive example on splitter panes, i'll really appreciate it.
A
|
|
|
|
|
What do you mean by "open an MFC application in splitter panes?"
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I was wondering if anyone has created a calculator using the stacks and any help would be useful. I guess my biggest problem with it is that I am trying to figure out how to read the data in and get it to how I need it. My teacher will give us an input file to manipulate and her expressions will have a space in between each char. SO what I was doing is using a getline to stop at a space and read all of these in as a char string. Then once I have these I will perform the isdigit to determine whether it is a digit or operand so then I can start converting to Postfix and later evaluating. I am sorry if this is kind of misleadig but I am just mainly having trouble with what I should read it in as and how I should convert it to something that is useful. Please help if at all possible. Thanks Alot
James
I bow down to the C++ gods for I am only a novice in training.
|
|
|
|
|
civicnar wrote:
I was wondering if anyone has created a calculator using the stacks...
Yes, I did back in college.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Do you still have the source code? I am trying to find an example so that I can get some ideas of how to do mine. Any info or suggestions would be great. Thanks
James
|
|
|
|
|
I'd bet 10 people would give David a stern scolding if he did your homework. What I suggest you to do is post the code that you are having problems with and ask questions about it...
John
|
|
|
|
|
BTW, there are several sources for calculator apps on this site. I doubt they are reading anything from files though...
John
|
|
|
|
|
Here is my source code. http://stuwww.hsu.edu/j/jd147649/web/calc.cxx I have it reading in from the keyboard until you break it but I am using a compiler on our Unix server so there may be some differences. I have looked at the examples on this site and none of them have been similar to what I am trying to do. But my biggest problem is figuring out how to read in the data to where I can convert it to what I need so that after I convert to Postfix I can evaluate the problem correctly. Yes I know there is an error in it but I have not been able to sit down and look at it too much so I am expecting some skepticism as to what I am doing. Please help if at all possible and any ideas or examples would be greatly appreciated. Thanks
James
|
|
|
|
|
civicnar wrote:
Do you still have the source code?
Not readily. It was 15 years ago. Before, I graduated, I printed out every project and homework assignment that I ever worked on. Filled up a large binder! I consulted it a few times since, but that binder is tucked away in a box someplace.
My first question is do you have the infix-to-postfix part of the code working? In other words, do you have code that will convert
a + b * c + (d * e + f) * g ----> a b c * + d e * f + g * +
In general, when an operand is read, it is immediately placed onto the output. Operators are not immediately output, so they must be saved onto the stack. Left parenthesis are also placed onto the stack. If a right parenthesis is encountered, pop and output symbols from the stack until the corresponding left parenthesis is encountered. If an operator is encountered, pop symbols up to a symbol with lower priority.
Here is at least one example found at CP.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi James, I haven't had the chance to compile the code you provide, but the following line struck me as a likely error:
rators.inputdataa = temp;
I guess you'll want to store the first char pointed to by temp , so this should be instead:
rators.inputdataa = *temp;
Hope this helps a little.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Thanks alot Joaquin that was that one single error that I had referred to earlier that I had not fixed. I appreciate you bringing that to my attention. I guess right now what I am trying to do is actually get my data into the 2 different stacks. I understand how to do post fix and evaluate but as of right now I am wanting to just get it to recognize what kind of data it is that is being sent in whether it is an operand or numerical data and convert it to what is needed to evaluate it.
|
|
|
|
|
I apologize if I did not say this earlier but if you run this you must put a space in between each number and operand for the getline to pick it up and also one at the end.
|
|
|
|
|
So, after fixing this problem are you still stuck somewhere else? Are you experiencing any problematic behavior?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
I am just kind of stumped as where to go next. I am just wondering do I need to read into a string or what kind of data I should read into but once I cna figure that out then I should be able to figure it out from there. I was also wondering would there be a better way than using a switch for my precedence. I am very sorry for my ignorance and I hope to get in depth into this sucker tonight. I have one week to complete it.
|
|
|
|
|
Well, I cannot solve your homework, so I hope some advice can put you on the right track.
First of all, this kind of problem is usually solved with one stack, not two. By inserting the numbers into one stack and the operands into another, you're losing crucial information about the orifinal postfix expression. For instance, consider the two expressions:
1 2 + 3 * [3 * (1 + 2) = 9]
1 2 3 + * [(3 + 2) * 1 = 5] According to your schema, these two expressions would be stored just the same:
number stack: 3 2 1
operation stack: * + so you're clearly doing it the wrong way. Ok so far? What you have to do is store everything into one single stack. As the stack can have to types of elements (numbers and operations), create a <ode>struct capable of storing both things, like for instance:
struct stack_element
{
bool is_operation;
} Now you have your stack with the given postfix expression conveniently stored in reverse order. You have to devise an algorithm to evaluate the contents of the stack. You can rely on the following two reduction policies:- If the top element of the stack is a number, this is what the stack evaluates to.
- If the top element is an operation then:
- Extract it from the stack.
- Recursively evaluate the first operand, yielding a number and leaving the expression for the second operand in the stack.
- Evaluate the second operand the same way.
- You have your operation and your two operands, calculate this and you're done.
I hope this is of some help. If you make some progress in your program and get stucked again, repost here trying to be specific about the particular problem you've run into.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
I really appreciate all of the help guys and the speedy responses. That is just amazing at how fast all of these responses have been accumulated. I am now on the right track and hopefully I can devulge myself into it in depth tonight and if I have any more problems I will be sure and let you know . Thanks
James
|
|
|
|
|
I would like to start an MFC application that would look at the arguments (like main(argv, argc) and launch an option for me. Any help would be appreciate it. Thanks
|
|
|
|
|
If you look at the InitInstance function in your app class you should see something similar to:
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
Command line processing is handled here. What you want to do is create a new class derived CCommandLineInfo and replace the declaration of cmdInfo with your new class instead.
Override the ParseParam function in your CCommandLineInfo class and set whatever variables you need based on the input.
void CYourCmdLineInfo::ParseParam(const TCHAR* pszParam,BOOL bFlag,BOOL bLast)
{
if( bFlag )
{
if( lstrcmpi(pszParam, _T("MyFlag")) == 0 )
{
bMyFlag = true;
}
else if( lstrcmpi(pszParam, _T("MyOtherFlag") == 0 )
{
bMyOtherFlag = true;
}
}
CCommandLineInfo::ParseParam(pszParam, bFlag, bLast);
}
|
|
|
|
|
I used Paul DiLascia's class for this:
http://www.microsoft.com/msj/1099/c/c1099.aspx
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
The CRT sets up the __argc and __argv variables for you, which have the same contents as argc /argv in a console mode app.
--
I'm Michael Dunn and I approve this post.
Vote Trogdor in oh-four!
|
|
|
|
|
My process use COMCTL32.dll and COMCTL32.DLL use USER32.DLL, I want to hook APIs in USER32.DLL, how can I do this?? Demo source code is welcome.
|
|
|
|
|
Hi All
i have a modeless dialog which i use as a wait screen.
this appears ontop of a dialog that is called
for example you click "Ok" the wait dialog appears
then once the function is completed the modless(wait) dialog disappear,
my problem is, if the user clicks away from the modless dialog, although
its still there focus can go somewhere else
how can i set the focus, on the modless dialog so that i cant click elsewhere
and that the modless dialog stays in focus until it disapears
ta
si
|
|
|
|
|
I think you want a modal dialog. Try looking into CWnd::DoModal()
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
There are several possible solutions. One solution is to handle the different window focus messages and process them according.
Kuphryn
|
|
|
|