Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. opening file by double-clicking (FileDDE) broken in VS 7.1 ?!

opening file by double-clicking (FileDDE) broken in VS 7.1 ?!

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharpvisual-studiohelpsharepoint
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    T T H
    wrote on last edited by
    #1

    Sometimes I wonder whether I need a C++ geek or a shrink to solve my coding problems... (info: I am using Visual Studio .NET 2003 7.1.3008 on Windows XP Pro SP 2) With the project wizard of my Visual Studio I made an MFC application with multiple documents (MDI). I assigned a file type to my project: .nix (my .nix files are plain text files). In addition to the now automatically created code I added in the Doc an OnOpenDocument reading the first five lines of the openend file, storing them in a list of std::strings. I even added in the View in OnDraw a simple routine that prints those list of stings from the Doc straight to the pDC with TextOut. So far, nothing spectacular. Problem #1 After starting the application the very first time my file type associations get registered. Afterwards my .nix files have the default icon of my application and are even named correctly. Now when I double-click those files in the Windows Explorer my application starts BUT the .nix file is never read and no document is opened. I can open those files manually with "File" -> "Open..." with my application but the double-click on the file itself never ever works. Problem #2 When I start my application by double-clicking the .exe everything is fine. But when I start the application by double-clicking an associated file .nix (next to my problem #1) there is a very strange effect: when I simply close the application again the function CWinApp::ExitInstance throws an exception in line 661 of appcore.cpp because CWinapp::m_pCmdInfo has a value of 0x00000001 which obviously is a pointer no nowhere (and having a pointer address of exactly 1 is like winning the lottery, right?!). As I said, next to my trivial code additions described above this all comes from MFC source files or automatically generated code by the project wizard. It's hard to believe that this code is so bad that it could go so horribly wrong. I guess a huge amount of other people make MFC MDI applications with associated file types so all those other people should suffer from those problems, too, shouldn't they?! Or is it a problem only for me?! On the other hand I do have the same behaviour of my application on other PCs. Help needed... (at least moral support...) Bye, Matthias P.S.: my little example project can be found here -- modified at 4:38 Wednesday 7th September, 2005

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups