|
Hey Max
Im a newbe and maybe this may help but again you may already know this.
CControlBar is an abstract base class for the control bar classes found in MFC.
A control bar is a window that is usually docked to one of the side os a fames window.
These windows can also float inside of the frame window. The control bar provided by MFC include CStatusBar, CToolBar, CDialogBar, CReBar, and COLeResizeBar.
The IsFloating Method
Bool IsFoating();
Returns True if the control bar is floating
book: Sams Teach Yourself Visual C++ in 21 Days
If not, Im sorry
|
|
|
|
|
I know about IsFloating() and it didn't return the good value ... it returned false even if the control bars were floating ...
Thanks anyway ..
M.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi there.
I have this class, derived from CFormView. It contains a CTabCtrl. I'm trying that, when a tab is clicked, to change the dialog resource id. Now, as you might remember, the constructor for CFormView includes the resource id. I've been trying many solutions (such as changing the m_lpszTemplateName member name and calling CreateDialog and CreateDialogIndirect), but I cannot find a solution.
I hope you can help me with this. Thanks a lot.
Kith.
Fools say "I know, you don't know", silence like a cancer grows...
Hear my words that I might teach you, take my arms that I might reach you...
but my words like silent raindrops fell... no one dare...
to disturb the sound of silence.
|
|
|
|
|
Hello,
If I understand correctly, you want to change a dialog when you click a tab on a tab control. This tab control is on the dialog you want to change.
If the above assumption is correct, read further, if not skip the next paragraph.
I don't think that you should change the resource ID of the class. I don't know what will happen, but it sure is something that you don't want!
If you want to display another dialog, you can make the dialog you want to change invisible (or destroy it if you want) and create another dialog with the resource ID that you want.
If you really need to reuse the class with another ID (I don't see the benefit in that) you can destroy the window (and the class) and create another one (the same class derived from CFormView) except with another ID.
Hope this information is of any help.
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Sounds like you need to embed a porpertysheet or a tab control into your form. that way it can handle the page changing for you.
There are several articles on that subject
If you vote me down, my score will only get lower
|
|
|
|
|
Hello,
How can I know the path of a running app without recurring to neither registry entries nor to an .INI file ?
I have been checking CWinApp for a function or variable member but was unable to find one...
Any suggestions?
David
BTW, m_pszExeName/m_pszAppName in CWinApp do not retrieve the path...
|
|
|
|
|
|
There is this Windows API function: GetCurrentDirectory. GetModuleFileName will only give you the file name, like "module.dll" instead of "C:\Program Files\Your Company\Your Product\bin\module.dll", the complete path. The prototype is as follows:
DWORD GetCurrentDirectory(DWORD nBufferLength, LPTSTR lpBuffer);
Greetings.
I know there's something so dear to me, beyond words,
beautiful feelings in my soul,
sounds I've heard like humming birds in a dream.
That mystical one I knew is returned,
lulling me with those raincloud eyes,
taking me and melting my heart away.
|
|
|
|
|
Wrong. GetCurrentDirectory will not always return the directory that the executable is in. You can not assume that it does as an a shortcut could change the working directory, the program can change the working directory or the user could launch the program from a command window using the full path. In each case GetCurrentDirectory will not be the directory that the program resides.
GetModuleFileName returns the correct result. Here is the doc:
GetModuleFileName
The GetModuleFileName function retrieves the full path and file name for the file containing the specified module.
John
|
|
|
|
|
I use GetModuleFileName() and it returns the whole path for me. In the app I wrote I use this to append a "\\temp" to the end of it for a call to CreateDirectory to create a temp folder in the same folder where the app resides. So as far as I know GetModuleFileName returns the whole path. I have a call to it like this in my app:
::GetModuleFileName(NULL,szPath,512);
where 'szPath' is declared
char szPath[512];
[insert witty comment here]
bdiamond
|
|
|
|
|
bdiamond wrote:
::GetModuleFileName(NULL,szPath,512);
It's not a good idea to use constants like this. If the size of your variable ever changed, you could easily miss one. Use the sizeof operator instead.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
sorry, but you know from experience that I'm not the brightest guy around Is this what you're saying I should do?
char szPath[512];<br />
<br />
::GetModuleFileName(NULL,szPath,sizeof(szPath));
[insert witty comment here]
bdiamond
|
|
|
|
|
bdiamond wrote:
Is this what you're saying I should do?
Correct.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
cool. Thanks
[insert witty comment here]
bdiamond
|
|
|
|
|
Hi again,
I'm still having trouble getting rid of flicker from my MFC program (on VC++NET but started on VC++6). I am trying to "simply" display 2 alternating, monochrome bitmaps using an off-screen memory dc buffer and bitblting the reuslt. I have (I think) overriden the OnEraseBkgnd calls, returning TRUE and doing nothing else.
The thing is, I call my Paint function directly, rather than invalidating the window, so (I think) I'm bypassing the messages from being sent anyway. The flicker does not look to be the background colour being painted anyway, it seems that the two images kind of take turns in "dominating" the window. I actually display the images on a microdisplay as an input to an optical system, where a camera grabs a resulting pattern every frame (which is why I'm confident it is the images merging and not the background colour of the window being painted). The problem works itself out over a few thousand frames and then reappears periodically.
Could it be the way I'm bypassing the messages that is causing the problem or something else? Any suggestions greatly appreciated!
|
|
|
|
|
I think there is a problem in your design. I believe that the windows api is not gauranteed to sync windows on the vertical blank so that it is possible to have part of both images on the screen at the same time. This is one problem that is solved with direct draw in which you can tell the blt to wait for the vertical blank signal.
John
|
|
|
|
|
Thanks very much for the replies - could you please tell me more about how to do the direct draw method? Best regards
NICK
ps I'm on WinNT 4, I believe that may not run the latest versions of DirectX?
|
|
|
|
|
Also, you should not call your OnPaint directly especialy if your using a CPaintDC. Windows does soem extra setup/tear down for on apinf stuff. You should write a Draw() procedure which you pass a HDC to and then use a function which uses GetDC() relaseDC() to call you paint function.
If you vote me down, my score will only get lower
|
|
|
|
|
This has been bugging me for years.
In Visual Studios 6, if I go to the frame menus and go [edit] -> [Find] and enter some text and hit "mark all" button, this all works fine. BUT how do you clear the bookmarks where the text has been found????
This is a problem because if I perform another search and select "mark all" again, the bookmarks from the previous search remains. You get bookmarks everywhere.
Any help appreciated, thanks
IGeorgeI
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
IGeorgeI wrote:
...how do you clear the bookmarks...
Ctrl+Shift+F2.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thankyou
ARSALAN MALIK
|
|
|
|
|
does anyone know how many bytes are the header for an mpeg file? I'd like to take the first 20 bytes (or however many) of an existing mpeg of about 500 MB, then take the remaining chunks in 50 MB increments, append the appropriate header info to them all, so that I can split the mpg up into 10 smaller files.
[insert witty comment here]
bdiamond
|
|
|
|
|
|
MPEG doesn't have file headers. The file is a sequence of blocks, each with its own header. Just split at block boundaries and the resulting files will be playable.
|
|
|
|
|
thanks. A friend of mine had a little .exe that he got off of planetsourcecode.com that allows you to do what I was talking about. It seems to work fine. Since I have one, there's no need to write one now!!;P
[insert witty comment here]
bdiamond
|
|
|
|