Click here to Skip to main content
15,885,953 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to monitor internet activities Pin
IndianOcean7-Sep-05 3:42
IndianOcean7-Sep-05 3:42 
Questionsimplest thread program doesn't work Pin
Spiritofamerica6-Sep-05 22:40
Spiritofamerica6-Sep-05 22:40 
AnswerRe: simplest thread program doesn't work Pin
Cedric Moonen6-Sep-05 22:57
Cedric Moonen6-Sep-05 22:57 
AnswerRe: simplest thread program doesn't work Pin
Hans Ruck6-Sep-05 22:58
Hans Ruck6-Sep-05 22:58 
AnswerRe: simplest thread program doesn't work Pin
Marc Soleda6-Sep-05 23:06
Marc Soleda6-Sep-05 23:06 
AnswerRe: simplest thread program doesn't work Pin
Bob Ciora7-Sep-05 3:03
Bob Ciora7-Sep-05 3:03 
AnswerRe: simplest thread program doesn't work Pin
LighthouseJ7-Sep-05 13:58
LighthouseJ7-Sep-05 13:58 
Questionopening file by double-clicking (FileDDE) broken in VS 7.1 ?! Pin
T.T.H.6-Sep-05 22:36
T.T.H.6-Sep-05 22:36 
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
Questionstringsend? Pin
Member 21610046-Sep-05 22:31
Member 21610046-Sep-05 22:31 
AnswerRe: stringsend? Pin
Cedric Moonen6-Sep-05 23:13
Cedric Moonen6-Sep-05 23:13 
GeneralRe: stringsend? Pin
Member 21610046-Sep-05 23:39
Member 21610046-Sep-05 23:39 
GeneralRe: stringsend? Pin
Cedric Moonen6-Sep-05 23:45
Cedric Moonen6-Sep-05 23:45 
GeneralRe: stringsend? Pin
Member 21610047-Sep-05 17:20
Member 21610047-Sep-05 17:20 
AnswerRe: stringsend? Pin
kakan7-Sep-05 0:14
professionalkakan7-Sep-05 0:14 
QuestionAdding page number to word doc Pin
Barm6-Sep-05 21:46
Barm6-Sep-05 21:46 
QuestionChange Font of caption of dialog box ?? Pin
ana_v1236-Sep-05 20:59
ana_v1236-Sep-05 20:59 
AnswerRe: Change Font of caption of dialog box ?? Pin
Barm6-Sep-05 21:43
Barm6-Sep-05 21:43 
GeneralRe: Change Font of caption (title) of dialog box ?? Pin
Anonymous13-Sep-05 1:47
Anonymous13-Sep-05 1:47 
QuestionProper time to record Pin
LiYS6-Sep-05 20:20
LiYS6-Sep-05 20:20 
AnswerRe: Proper time to record Pin
David Crow7-Sep-05 3:22
David Crow7-Sep-05 3:22 
QuestionProblem related to CImageList(explanation) Pin
a_david1236-Sep-05 20:18
a_david1236-Sep-05 20:18 
QuestionHow does CListCtrl notify its parent window when a cell content has changed? Pin
followait6-Sep-05 20:18
followait6-Sep-05 20:18 
AnswerRe: How does CListCtrl notify its parent window when a cell content has changed? Pin
Ian Bowler7-Sep-05 13:39
Ian Bowler7-Sep-05 13:39 
GeneralRe: How does CListCtrl notify its parent window when a cell content has changed? Pin
followait7-Sep-05 16:15
followait7-Sep-05 16:15 
AnswerRe: How does CListCtrl notify its parent window when a cell content has changed? Pin
David Crow8-Sep-05 2:34
David Crow8-Sep-05 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.