|
I am using VS2008 and see Auto behavior for checkboxes. See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 13-Sep-12 9:38am.
|
|
|
|
|
Hello All!
I have been tasked with writing a dialog based application that must include a menu, tool bar and status bar. Being CFormView based is not an option. I have everything working beautifully except 2 items:
1. Tool tips do not display correctly on the status bar panes.
2. I need to resize the dialog once the tool bar or status bar are turned off.
I only need help with #1 as I have not even worked on #2 yet.
I have a normal CStatusBar derived from a class described here:
http://msdn.microsoft.com/en-us/library/ccstww6w(v=vs.71).aspx[^]
The dialog has a base class as described here:
http://msdn.microsoft.com/en-us/library/ccstww6w(v=vs.80).aspx[^]
What happens when hovering over any of the status bar panes is you get a tool tip centered horizontally over the status bar that simply says "Toggle Status Bar". I am seeing the TTN_NEEDTEXT message fire with control ID 59393 which is AFX_IDW_STATUS_BAR.
All of the update commands, tool tips and message strings work for the menus and tool bars as well as the update handlers for the status bar, it is just the tool tips for the status bar that do not work.
Any help is greatly appreciated.
Craig
modified 13-Sep-12 1:43am.
|
|
|
|
|
Have a look at the article StatusBarACT[^] and the source code to add the tool tip related code to your CStatusBar derived class.
|
|
|
|
|
If a winwird application is started by a c++ programm (borland5) it ist possible to stop the prodedure by
OleProdure("Close");
But otherwise the process still appears in the Task-Manager.
How to end this process by c++?
|
|
|
|
|
Somehow you should find the process. I think the easiest way to find it by window. You can use FindWindow() to find the window of the process by either window text (title) or by window class. I recommend the window class because the title is usually variable, you can find out the window class of a window by using spy++. So lets say you know the window classname and you can find the window handle of the window of the process. Then you can use GetWindowThreadProcessId() to get the id of the process and the thread that created the window. You need the process id. Use OpenProcess() with the processid to create a handle to the specified process. You can use the process handle with TerminateProcess(). There are two other more polite ways to do the stuff: When you get the HWND of the program with FindWindow() you can send messages to the window of the process. By using PostMessage to post a WM_CLOSE to this HWND you get basically the same effect as by clicking on the X-close button of the window. The problem with this is that many programs react to this by popping up a "Do you really want to exit?" messagebox and the user can still cancel the program exit. Another solution that is between the WM_CLOSE and the TerminateProcess() solutions is calling DestroyWindow() on the HWND of the program (that destroys the window and before this sends WM_DESTROY message to it). The problem with this is that many programs don't handle this well, for example some buggy programs use PostQuitMessage() from their WM_CLOSE instead of their WM_DESTROY handler and they don't put proper cleanup code to their WM_DESTROY. The less reliable is DestroyWindow() that might be used if we spoke of one fixed version of a program that proved to work with this, but if WM_CLOSE is enough than I would go with that, otherwise with TerminateProcess().
|
|
|
|
|
|
|
Did you start the instance of Word using something like CreateProcess() or ShellExecute() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hello,
I am Using CDHTMLDialog to display an HTML Page along with some MFC Controls.
Using Reference from: http://www.codeproject.com/Articles/1094/The-MFC-CDHtmlDialog-class
&&
http://www.codeproject.com/Articles/5729/CDHtmlDialog-with-CSS-JavaScript-and-images
My query is how do I control the position of the HTML page on the dialog?
I have used OnSize function to control the lower part of the Dialog.
void CTestUIDlg::OnSize(UINT nType, int cx, int cy)
{
CDHtmlDialog::OnSize(nType, cx, 165);
CDialog::OnSize(nType, cx, cy);
}
This code helps in displaying HTML page with height of 165 and the lower part is only CDialog.
I want to achieve the following:
CDialog Size(0, 0, 500, 500) // Full Dialog
CDHTMLDialog(0, 100, 500, 165)// Middle Strip of 65 pixel
The top area of the Dialog should also contain only CDialog Controls!
I don't want to use the WebBrowser Control for this.
Any tip on how to achieve this!
Thank you!
|
|
|
|
|
|
Hi,
I am working on a simple win32 console based application in C in visual studio2005.
My application uses a third party static library.
So I have included the path of the library and the library in additional dependencies for linker input.
My code compiles and works fine if I compile this code as C++ code.
But If I want to compile this as C code, for the same library functions, I am getting unresolved external symbols.
Can any one please let me know, if I have to change anything for this library to compile as C code.?
Regards,
Sunil Kumar
|
|
|
|
|
Its possible to do that but depending on your unresolved external symbols you might have to use a thin layer of C++ between your C code and the C++ library.
|
|
|
|
|
The library is compiled as C++ code, due which the function names exported by the library are mangled.
When you compile your code as C code, the name mangling is disabled, due to which the linker looks for un-mangled version of the function calls you're using from the third party library. And hence the unresolved external symbol errors are shown.
The way out for this is use dynamic loading of that DLL.
|
|
|
|
|
Hi Malli,
thanks for the reply.
So in that case,by using dynamic loading of library using LoadLibrary, we can avoid this even the library is compiled as C++.?
Regards,
Sunil Kumar
|
|
|
|
|
Yes, provided that you have function prototype with you and the function pointer defined for the function you are calling.
|
|
|
|
|
Malli_S wrote: The way out for this is use dynamic loading of that DLL.
DLL?
|
|
|
|
|
Chris Losinger wrote: DLL?
I meant to say using LoadLibrary().
|
|
|
|
|
but the post says nothing about a DLL. it says "static library".
|
|
|
|
|
Hmm. I should have mentioned about the DLLs. I was trying to focus on dynamic linking, rather than static linking.
My mistake. I missed that.
|
|
|
|
|
Hi,
the good thing is that I have both static and dynamic libraries.
But I wanted to use only static, so that I can distribute only an exe.
But anyway, now I will have to use the dynamic library.
Thanks for the help.
Regards,
Sunil Kumar
|
|
|
|
|
If it was me I would put a C function wrapper around it. And compile that at a library. Then your app uses the second library. The dynamic loader solution works but it means that you must deal with the name mangling yourself rather than letting the compiler do it. And if the C++ requires an C++ idioms, like creating a class, then doing thing via dynamic method calls is going to be difficult.
|
|
|
|
|
But it's a third party library. He might not have the source code for that.
|
|
|
|
|
Hi,
One more thing is,it compiles properly for C++ in debug mode.
But in Release mode the same unresolved external errors, I am getting for the functions.
I have mentioned the project properties in Release mode same as in Debug mode.
But still it is unable to link to the functions in the library.
Why this behavior.Does it mean, the library is compiled in debug mode?
Regards,
Sunil.
Regards,
Sunil Kumar
|
|
|
|
|
Malli_S wrote: But it's a third party library. He might not have the source code for that.
That has nothing to do with what I said.
|
|
|
|
|
Hello everybody,
i am having text file opened in some other application(our application). if i delete this opened file from windows explorer, its deleting, so, at some point, my application crashes (while trying to write). how can i lock that file when it is use in other application?
i am using VC++ with win32.
Thanks in advance,
A. Gopinath.
|
|
|
|