|
vyjesh wrote: if (!TranslateAccelerator(m_hWnd, haccel, &msg))
The problem is with the m_hWnd, i guess i overlooked that.
replace m_hWnd with m_chatWindow->m_hWnd
and let me know if it worked.
-Prakash
|
|
|
|
|
Hello prakash,
It did not work. But I got the problem solved by this way
m_chatWindow = new CChatWindow(this); m_chatWindow->Create(IDD_DIALOG1,GetDesktopWindow());
m_chatWindow->ShowWindow(SW_SHOW);
m_chatWindow->RunModalLoop(); //this solved problem.
Regards
|
|
|
|
|
oh cool, I am kinda more conversant with win32. Good that you solved it.
RunModalLoop() kinda does what we were doing before but maybe in a correct way.
-Prakash
|
|
|
|
|
Hello,
I've just installed Visual Studio 2005 and eagerly I converted the C++ project I'm working on, from Studio 2003 project format to Studio 2005 one.
But I can't get the project to compile. Visual Studio 2005 compiler has been made more ISO compliant so it no longer accepts implicit int declaration.
Thus, I need to convert my project back to Studio 2003 format. But I don't know how.
Can someone help?
Thanks
|
|
|
|
|
Your 2003 sln file should still be in your directory. I think all you need to do is load that instead of the converted 2005 sln file (and delete it altogether if you don't want to eventually upgrade) and you should be go to go.
|
|
|
|
|
In the updrade log generated by VC 2005 it is said there is a backup sln file in the project directory.
It is called myproject.sln.old but I can't find it even in the hidden files.
Do you have any idea?
|
|
|
|
|
|
Thanks for your reply.
I wish I had read that article before upgrading.
Now I just cant compile my project.
|
|
|
|
|
Allad wrote: Visual Studio 2005 compiler has been made more ISO compliant so it no longer accepts implicit int declaration.
So why don't you go ahead and fix it? Why leave bad code in your source?
|
|
|
|
|
Nishant Sivakumar wrote: So why don't you go ahead and fix it? Why leave bad code in your source?
In my project I'm using a library with thousands of code lines. And the real problem is that library. I don't dare mess with such a huge amount of code I've not written myself.
Anyway thanks for replying.
|
|
|
|
|
Hello,
Did you make a backup? VS 2005 asks this before it converts the file.
Anyway, as Nishant already said it: fix the errors and use the better compiler. The standard conformance is far better than any previous compiler written by Microsoft.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote: Did you make a backup? VS 2005 asks this before it converts the file.
In the updrade log generated by VC 2005 it is said there is a backup sln file in the project directory.
It is called myproject.sln.old but I can't find it even in the hidden files.
Do you have any idea?
|
|
|
|
|
Hello,
Did you save the converted solution to another directory? Otherwise I don't know where the file might be.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi, i am using WM_QUERYENDSESSION to check that system is shutting down. But i am unable to differentiate whether system is shutting down or restarting. Is there any way to find this out.
Thanks.
|
|
|
|
|
i am pretty sure that there is no clean way to do it, and i remember a discussion where some of MS guys agreed with that.
now, ExitWindowsEx API takes a flag which specified the type of shutdown, so maybe you could dissasemble the function and see what it really does.
|
|
|
|
|
Probably there is no way to find out the difference
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi everybody!
I need to write a program that will differentiate expressions. The input to this program will be a series, each representing an infix expression to be differentiated.
First the program will have to scan the infix expression, building up an appropriate binary tree representation of it. Once the binary expression tree is built, traverse it, building up an other binary expression tree, which represents the derivative of the original expression.
Finally, once the binary expression tree for the derivative has been built, print the expression...
|
|
|
|
|
homework, huh?
first, you will need to parse the expressions. you can find some implementations here:
http://www.codeproject.com/cpp/rwformulaparser.asp
http://www.codeproject.com/cpp/FastMathParser.asp
http://www.codeproject.com/cpp/MathieuMathParser.asp
second part should be easier, but you can find a Java implementation here:
http://cs.jsu.edu/mcis/faculty/leathrum/Mathlets/src/ (look for 'Derivative Calculator' near the bottom of the page)
also, have a look here:
http://fermitools.fnal.gov/abstracts/mxyzptlk/abstract.html
|
|
|
|
|
Hi ,
I have a VB active X control which has a few buttons on it. I have added the Tab order for these buttons.
I am using this ActiveX on a VC++ dialog. It is a simple dialog application.
and the Active X control is the only control on the VC++ dialog.
When I launch the application the focus does not go to the First button on the VB ActiveX.
I have found that the User control(Active X) gets the focus and not the First control on the User Control.
Can anyone help me out with this(Do I need to set any property??)
Thanks,
Gayathri
|
|
|
|
|
eg.
IXRect *pRect
IXRect *p;
mDoc->get_Rect(&p);
pRect = p;
pls see above the code. whenever i change the member value of p, mDoc.Rect values are changed. also how to avoid it.
i want to copy values only from mDoc.Rect Object to p . how to do
shadrach
|
|
|
|
|
It all depends how mDoc->get_Rect is implemented, it seems like it is returning the address of existing "rect" hence both the objects are pointing to the same content and hence you are having the problem.
-Prakash
|
|
|
|
|
I come from a java background where Exceptions are heavily used. I started using try/catch(...) in C++, but not sure what all can be done in the catch block.
1. What does the elipsis (...) mean? What else can be put here?
2. If we want to catch an exception of a known type, can we specify the exception in the catch here?
3. If so, how do you define an exception class? Is there an interface that we should implement?
4. When we have the elipsis(...) how do you get the details of the exception?
5. Are there simple examples anywhere that demonstrate exceptions in C++ for Java programmers?
thanks!
|
|
|
|
|
1. it means that any possible exception type will be caght there
2. yes, like this: catch (MyException& e)
& operator is not necessary, but it is a good programming practice regarding performance
in c++ you can also catch integral types, like: catch (long x)
3. any class/type can be exception tpye, but maybe you would like to have look at the 'exception' class, which is a base class for all exeption classes in standard c++ library
4. as far as i know, there is no portable way to do it.
5. these are not specifically for java developers but it is not that hard.
http://cis.stvincent.edu/swd/except/except.html
http://cplus.about.com/od/beginnerctutorial/l/aa122202a.htm
there is also a lot of in-depth articles on exceptions at Guru of the Week[^] and here on CodeProject
|
|
|
|
|
Zdeslav Vojkovic wrote: yes, like this: catch (MyException& e)
& operator is not necessary, but it is a good programming practice regarding performance
The example[^] here uses a pointer to the exception object, whereas you are using a reference. What is correct? or does it depend on what is being "thrown", but you dont always have cotnrol over what is thrown, right? When it is a pointer, is it considered as an integral datatype exception?
Zdeslav Vojkovic wrote: in c++ you can also catch integral types, like: catch (long x)
Does this work like this:
try {<br />
throw 5;<br />
}catch(long x) {<br />
printf("%d", x);<br />
}<br />
Does this print 5?
Zdeslav Vojkovic wrote: as far as i know, there is no portable way to do it.
Can you tell me how you would obtain the exception info when using Microsoft Visual C++?
Zdeslav Vojkovic wrote: 5. these are not specifically for java developers but it is not that hard.
Sure, I will go throught them.
thanks!
|
|
|
|
|
Britley wrote: The example[^] here uses a pointer to the exception object, whereas you are using a reference. What is correct?
if an exception is allocated on the heap (using 'new' operator), it must be caught through a pointer. however, this is not a good practice because it is not obvious to the client code how to handle it, and it complicates the deleting of the allocated exception instance (who will call delete on it). exceptions shoud be stack allocated, thrown, and caught by reference. please note that the example is for an MFC client, and MFC implements somewhat specific idiom, where exceptions are allocated on the heap and you have to call Delete() method of the CException class to destroy the instance.
Britley wrote: Does this work like this:
no, because 5 is an int, not a long, but this does:
try {<br />
throw 5L;<br />
}catch(long x) {<br />
printf("%d", x);<br />
}
Britley wrote: Can you tell me how you would obtain the exception info when using Microsoft Visual C++?
when you catch exception with (...) you can't do that. anyway, in this case you should always rethrow the exception, because it is not possible to correctly handle an exception without knowing its type. you can retrieve some exception info, but all the ways i know are OS specific, and not supported by standard c++. for more details, look here:
http://www.codeproject.com/cpp/exceptionhandler.asp
http://www.codeproject.com/debug/XCrashReportPt2.asp
and lots of other exception handling articles on codeproject
what you can do is to catch specific exceptions. example:
catch(exception& e)
this will catch all the exceptions of type 'exception' and of all types derived from it . exceptions are usually modelled in hierarchies, so you can handle multiple exception types in one handler.
|
|
|
|