|
I'm starting a modeless dialog box from my main (dialog-based) app, but it's
always on top when I run the program. I can change focus back to the main
dialog box, but I can't bring it to the front. I've tried SetForegroundWindow()
and a couple of other functions, but no luck.
Any suggestions appreciated.
Details:
- Visual C++ 6.0
- MFC Dialog-based app
- Child dialog boxes created with Create() function
Gary Rathbun
|
|
|
|
|
SetWindowsPos();
Good Luck!!!!
Carlos Antollini.
|
|
|
|
|
Thanks, Carlos, but when I try to use that function, the compiler gives an error,
saying it doesn't have 7 arguments. The documentation says it does, and it
has 7 in WINUSER.H, where it's declared. In CONTROL.H, it has 4, but none
of them refer to height or Z-order positioning.
I also tried BringWindowToTop(). It compiled, but didn't bring the main dialog to the
top--the child dialog was still on top...
Any more ideas, I'd be glad to try them!
Gary R.
|
|
|
|
|
You are using MFC?
in that case is
CWnd::SetWindowPos
BOOL SetWindowPos( const CWnd* pWndInsertAfter,
int x,
int y,
int cx,
int cy,
UINT nFlags );
For Example
SetWindowPos(&wndTopMost, 0, 0, 0, 0,SWP_NOSIZE);<br />
If you not are using MFC is
BOOL SetWindowPos( HWND hWnd,
HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
UINT uFlags
For example
<br />
SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE);<br />
in this case you need to include the winuser.h file.
Cheers...
Carlos Antollini.
|
|
|
|
|
The debug version of my program works like a charm. The release build gives an access violation as soon as I double click on the exe. So....since I really can't "debug" the release version, I could use a lil help.
Any ideas?
|
|
|
|
|
You probably have an uninitialized variable. Try using AfxMessageBox() to trace through your program.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I just found out you CAN debug your release build. Under MSDN help, under index, look up "release build" and under that is "fixing problemss" (yes 2 s's). Click on "Turn on Generation of Debug Information for the Release Build" to find out how. So, I did that, and I am now debugging the release build, and I find out that my "Access violation" error comes before the first line of InitInstance. What on gods planet would cause this? The call stack just shows "0064ed69()".
|
|
|
|
|
Sounds like you have a member variable that is blowing up as it's being created.
|
|
|
|
|
Well, I don't hear any explosions ;D. On a serious note, could you elaborate on this variable "blowing up"?
|
|
|
|
|
I hope this equation works here
Quick Answer + time + thought = better answer
Try setting a breakpoint in the constructor of any class member classes. For example, you have a class CDoSomething which is declared as a member variable of CMyGreatClass. Notice I said class not pointer to a class. As a part of the construction of CMyGreatClass, it has to create CDoSomething. If there is a problem creating CDoSomething, CMyGreatClass will not even get created before an error occurs.
Good Luck
Brad
|
|
|
|
|
I thought that the very very very first thing that gets called is CMyApp::InitInstance(). I attempt to "run to cursor" to that function with my release build, and it doesn't make it. Do the constructors of the other classes get called before reaching the InitInstance function....? ( I also tried your suggestion, without success.
|
|
|
|
|
The constructor gets called first! Try setting a breakpoint there.
Brad
|
|
|
|
|
For strange it seems, you can debug a release version of a program in VC; read the article on http://www.pgh.net/~newcomer/debug_release.htm; very good!
|
|
|
|
|
MSDN states "Visual C++ includes the SDK Edition of Stirling Software’s InstallSHIELD". I have Visual Studio 6.0....I can't find it!
"If a man speaks in the forest, and there is no woman around to hear him, is he still wrong?"
|
|
|
|
|
You can downloaded the crappy but free version of installshield from installshield.com. Microsoft let's you download there installation package for visual c++ professional edition user's. I have the standard edition and when I went to download it they make you type in that long identification number and well....I never got to download the software.
Let me bestow my advice. INSTALLSHIELD SUCKS BADLY! A spectacular business-like (and free) installation package is inno-setup located at jrsoftware.org. It's easy to use and looks really nice. Installshield is difficult to use and takes forever to install.
Peace.
|
|
|
|
|
Allow me to second that motion.
InstallShield is incredibly hard to use; and virtually impossible to manage in source control. Wise Installer, on the other hand (www.wisesolutions.com) is very easy to use, just as powerful as IS, and uses a single file to manage the entire installation.
|
|
|
|
|
InstallShield is incredibly hard to use
If I can use it correctly, it can't be incredibly hard to use. Maybe a little hard to use, but definitely not incredibly.
and virtually impossible to manage in source control
To give them credit, the latest offering handles SFC very well. I haven't had any problems as of yet with using IS7 and VSS.
Wise Installer ... uses a single file to manage the entire installation
Why is that advantageous?
David Wulff
dwulff@battleaxesoftware.com
|
|
|
|
|
I've got to give the contrary opinion. I have used Installshield quite successfully for a number of years. Generally I find that when someone says it SUCKS they usually don't understand the tool. After demonstrating and correcting their misconceptions they are usually more excepting of Installshield.
|
|
|
|
|
I am not saying this to be mean.
Your statement "I find that when someone says it SUCKS they usually don't understand the tool" is correct (you sound like a university professor). However, it shouldn't take hours and hours and hours of training to understand an installation package. I spent several weeks studying installshield and I use to use it regularly. Compared to other packages on the market, installshield is complex and unbelievably expensive.
Take a simpler example. I bought my parents a vcr so they can record shows. It's esay for me to program the vcr. They however don't understand it. I could develop a vcr that is easier to use than anything on the market today. That easy-to-use vcr would be valuable because people can understand it without reading the manuals! The current vcr's suck badly because people who want them don't understand how to use them unless they have someone there showing them the features. It shouldn't be that complicated. Other installation packages are not that complicated nor expensive.
|
|
|
|
|
However, it shouldn't take hours and hours and hours of training to understand an installation package. I spent several weeks studying installshield and I use to use it regularly. Compared to other packages on the market, installshield is overly complex...
You're obviously not a linux fan then .
David Wulff
dwulff@battleaxesoftware.com
|
|
|
|
|
I'll agree that Installshield is much to expensive. Anyone from Instalshield out there, PAY ATTENTION!!
As for taking hours to learn, that depends on the individual of course. Some master subjects easier than others. In general however just as with <insert language="" here=""> it takes time to master it.
|
|
|
|
|
Yes he is!
|
|
|
|
|
I've only ever had experience installing VS 6 Enterprise edition, but after you install VS (or any of it's components), and then after you optionally install MSDN, you should be asked to install the additional tools (or which InstallShield is an option).
|
|
|
|
|
Hi there,
I am trying to use CListCtrl in a dialog box as a one column table.
So, I insert a column as following on the OnInitDialog:
m_List.InsertColumn(0, _T("Names"), LVCFMT_LEFT, -1, -1);
m_List.SetColumnWidth(0, LVM_SETCOLUMNWIDTH );
I have selected this to be of Report Type and to have scrolling.
My problem is that whenever I have a lot of names which would require
vertical scrolling, my horizontal scrolling also kicks in, evnethough
visually it's not needed.
i.e.
When my list has
1234
12
15
12
2
45
67
vertical scrolling comes in because we need to see the bottom part
but these numbers are too small to justify horizontal scrolling at
that time.
How do you force the List to be more smart? or for that programmer
its programmer?
|
|
|
|
|
Hello, the codegurus around the world.
Probably, you don't need insert all data to CListCtrl.
1) Create Array object like CArray to restore all column data.
2) Calculate the data number which don't show the scroll bar at all.
3) If the user want to move up or down the data, refill the data on the index
which going down or up by one index or more.
Refilling the data brings GUI flicker, and maybe you need some type of
owner draw CListCtrl?
Good luck.
Have a nice day!
-Masaaki Onishi-
|
|
|
|