I found a solution: returning FALSE in my document's OnOpenDocument. I get to deal with the file the user opened, but then I don't have to mess around with a doc or view hanging around. How come nobody told me about that? :cool: Jake
Jake Palmer
Posts
-
How to open project files in my app, like in Visual Studio -
How to open project files in my app, like in Visual StudioSounds great, but I am just using CMultiDocTemplates in my code. I tried to make a subclass and override InitialUpdateFrame, but I get errors with the constructor, because CMultiDocTemplate has no default constructor. It doesn't seem like MFC wants DocTemplates to be subclassed, since we can't create them in the New Class wizard. So, how did you get that CProjectDocTemplate class? thanks, Jake
-
How to open project files in my app, like in Visual StudioMy goal is similar to how Visual Studio opens Project and Workspace files: those file types are associated with VS, but they don't open up Views in the middle of the screen, they just fill in some information. I want to imitate this for opening Projects in my application.:~ Are they using a doc/hidden view for this, or something tricky? :wtf: Any suggestions are appreciated. thanks, Jake
-
open a Document with invisible View?My goal is similar to how Visual Studio opens Project and Workspace files: those file types are associated with VS, but they don't open up Views in the middle of the screen, they just fill in some information. I want to imitate this for opening Projects in my application.:~ thanks, Jake
-
open a Document with invisible View?Is it possible to associate a file type with a document, but to have no visible view, or even no view at all? I want the file type to be handled by my app, but not to open up a child window. I only want to process it in OnOpenDocument. thanks, Jake
-
app fails to load double-clicked fileYes, if I run the app normally and load in the file, everything works fine. Drag and drop also works fine. The only problems occur when double-clicking on files. Jake
-
app fails to load double-clicked fileWhen I double click on a file whose extension is handled by my MDI app, it starts to run the app but doesn't show the MainFrame properly (the floating dialogbar appears, but no main window or anything). I get an error saying "Cannot find the file ... Make sure the path and filename are correct and that all required libraries are available." I think these might be two separate problems, because when I click OK on the error message the half-opened application remains. The same thing happens when another instance of the app is running. I'm not trying to do anything tricky here, like open the file in the same instance, which just seems too difficult. I've found similar postings on this forum but nothing that helps here. thanks, Jake
-
How to get path of executableHow can I get the path of the executable? I want to Open a file in the same directory - the problem is that something causes the relative directory to change, so just specifying the filename can give me a FileNotFound exception. thanks, Jake ***** Jake Palmer www.duke.edu/~jp6
-
Scrolling CEdithi everyone, I want my CEdit to scroll to the bottom after a call to SetWindowText. The following code updates the scroll bar, so it looks like it's at the bottom, but the edit actually remains unscrolled: int max = m_edit.GetScrollLimit(SB_VERT); m_edit.SetScrollPos(SB_VERT, max, TRUE); I had the same results with GetScrollRange. What is the right way to scroll the edit? thanks, Jake ***** Jake Palmer www.duke.edu/~jp6
-
Scrolling multiline edit ctrl to bottomhi everyone! how should I tell a multiline edit control, which has more text than is viewable, to scroll down so the text at the end is always visible? the text is frequently changing, and every time I want the control scrolled automatically to the bottom. what do you think? :-D thanks, Jake ***** Jake Palmer www.duke.edu/~jp6
-
Progress updates from callback functionHere's something that's puzzling me: the purpose of the callback function for AVISave is to update a Progress control with the percent done. But the callback function must be global or static, and only takes an int nPercent argument, so how can I access any Progress control or dialog member variables from this callback function?? ***** Jake Palmer www.duke.edu/~jp6
-
CEditI had this problem for a while - if I am remembering correctly the solution is to NOT have the style AutoHScroll set. That should wrap at the end of each line instead of scrolling. Good luck! ***** Jake Palmer www.duke.edu/~jp6
-
CEditView & Menu Question#1: I know I've written some hack code to do this where I got all of the edit's text into a string, appended some more onto that string, and then set the edit's text to be my new string. It was ugly, but it worked :) #2: The check on a menu item comes from CCmdUI::SetCheck(bool), in the UpdateUI handler for that button item. Hope some of that works for ya :-D ***** Jake Palmer www.duke.edu/~jp6
-
Lame icon associationI think it must have something to do with the IDs of the icons, because I played around with them and was able to produce different incorrect results :) After enough frustration I deleted the icons and made bitmaps to display on my buttons instead, so that's working now and the icons are back to normal :rolleyes: Thanks for all of your help! Jake
-
Double to stringTo get a double into a string: double num = 10.0; CString str; str.Format("%d", num); something.SetWindowText(str); The syntax for Format probably looks really ugly if you've never programmed in C, but that %d grabs a double from after the comma and sticks it in there as a string. enjoy :-D Jake
-
Lame icon associationBefore I added any icons, the correct icon IDR_ABCTYPE was associated with all of my .abc files. I added another icon, and even though IDR_ABCTYPE is still exactly the same, all my .abc files are now being shown with this new icon, which should have nothing to do with them. any ideas what I've messed up?? X| thanks, Jake
-
EditStreamPaste errorsMicrosofts documentation says that this function returns 0 (AVIERR_OK)if successful, or an error otherwise. I'm trying to figure out why this paste operation fails in my code, but I can't find anything out about the errors this function returns or what causes them. Any ideas? Thanks, Jake
-
AVIFileOpen errorI've written an application that plays AVI files, and has no problem opening them, with one exception: I took some open-able AVI files and burned them onto a CD. Then, when I tried to open them directly from the CD or after copying them from the CD to the hard drive, AVIFileOpen returns the error AVIERR_FILEOPEN. The process of burning the files onto the CD did something to cause this, however the files still play fine in Windows Media Player. This is a big problem, and I haven't been able to find out anything about what causes the FILEOPEN error. If any of you have any ideas, I would greatly appreciate them :) thanks, Jake
-
OnKillFocus questionI'd like to do something if a view in my MDI app loses focus to another view, but not if it loses focus to a dialog or message box. OnKillFocus gives me a pointer to the new CWnd, so is there a safe way to check if that is a CView? thanks, Jake
-
tons of awful errorsSweet Jesus it actually worked! I had a non-inline function without the semicolon, and the compiler wasn't happy. Thanks a ton! :) Jake