Click here to Skip to main content
15,902,112 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Why this code never works???!?? Pin
YaronNir15-Feb-04 20:58
YaronNir15-Feb-04 20:58 
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen15-Feb-04 22:06
Antti Keskinen15-Feb-04 22:06 
GeneralRe: Why this code never works???!?? Pin
YaronNir15-Feb-04 22:10
YaronNir15-Feb-04 22:10 
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen16-Feb-04 2:03
Antti Keskinen16-Feb-04 2:03 
GeneralRe: Why this code never works???!?? Pin
YaronNir16-Feb-04 2:15
YaronNir16-Feb-04 2:15 
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen16-Feb-04 2:54
Antti Keskinen16-Feb-04 2:54 
GeneralRe: Why this code never works???!?? Pin
YaronNir16-Feb-04 3:19
YaronNir16-Feb-04 3:19 
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen16-Feb-04 5:53
Antti Keskinen16-Feb-04 5:53 
Ah, so..

You should've told me earlier about the article: reading it completely through offered a good set of knowledge on how the Visual C++ 6 works. For other possible readers, a link to the article is available here[^].

Like this article states, an MFC extension DLL can share the CWinApp object provided by a loading application. This theorem is used as a base on the concept that Visual C++ is a BIG MFC program that loads a few extension DLLs when it starts up. Nothing prevents us from writing Add-ins as extension DLLs instead of regular add-ins, which are generated by the Dev-Studio Add-In wizard.

In order to utilize the code piece placed there, you must generate your Add-in module by using the alternative code wizard mentioned in the article: "CoDeveloper's Extension Add-in Wizard", instead of using the built-in DevStudio Add-in Wizard. Modules created with the prior wizard have access to the CWinApp object of Visual C++, and can thus enumerate through it's document templates and so on.

Basically, to solve your problem and answer your question in a single sentence: use the CoDeveloper's wizard to generate your add-in instead of the built-in one, and then write the necessary code again. By using the alternative wizard, you have access to the CWinApp object of Visual C++. For more information on how it works, you should read the original article with careful thought. You can find the wizard accompanied in the ZIP file that is with the article. Just read the Readme file and install the wizard accordingly.

Unfortunately, you cannot write a seperate module that does the same. This means that the code examples I have posted cannot be altered to access the workspace name on a VC6 platform. The .Net version works, because VC .NET's Automation interface is much more sophisticated.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Why this code never works???!?? Pin
YaronNir16-Feb-04 6:12
YaronNir16-Feb-04 6:12 
QuestionHow to Insert Table in Rich Text Box Control Pin
Sumit Kapoor15-Feb-04 0:18
Sumit Kapoor15-Feb-04 0:18 
AnswerRe: How to Insert Table in Rich Text Box Control Pin
CodeBrain15-Feb-04 21:57
CodeBrain15-Feb-04 21:57 
GeneralDatabase Problem Pin
Ghasrfakhri14-Feb-04 23:00
Ghasrfakhri14-Feb-04 23:00 
GeneralRe: Database Problem Pin
Manfred Staiger16-Feb-04 0:37
Manfred Staiger16-Feb-04 0:37 
GeneralRe: Database Problem Pin
David Crow16-Feb-04 3:23
David Crow16-Feb-04 3:23 
Generalneed help for sound recording and play back in C/C++ Pin
wenfoo14-Feb-04 22:14
wenfoo14-Feb-04 22:14 
GeneralRe: need help for sound recording and play back in C/C++ Pin
elza14-Feb-04 22:46
elza14-Feb-04 22:46 
GeneralRe: need help for sound recording and play back in C/C++ Pin
wenfoo15-Feb-04 4:05
wenfoo15-Feb-04 4:05 
GeneralRichEdit Pin
Rassul Yunussov14-Feb-04 22:14
Rassul Yunussov14-Feb-04 22:14 
GeneralRe: RichEdit Pin
Michael P Butler15-Feb-04 1:31
Michael P Butler15-Feb-04 1:31 
GeneralControl volume and Microphone of connected USB device Pin
elza14-Feb-04 21:31
elza14-Feb-04 21:31 
GeneralHide Mouse Pin
Andrew Walker14-Feb-04 20:21
Andrew Walker14-Feb-04 20:21 
GeneralRe: Hide Mouse Pin
Robert A. T. Káldy16-Feb-04 7:38
Robert A. T. Káldy16-Feb-04 7:38 
QuestionFile length macro??? Pin
PJ Arends14-Feb-04 13:28
professionalPJ Arends14-Feb-04 13:28 
AnswerRe: File length macro??? Pin
Michael Dunn14-Feb-04 14:10
sitebuilderMichael Dunn14-Feb-04 14:10 
GeneralRe: File length macro??? Pin
PJ Arends14-Feb-04 14:15
professionalPJ Arends14-Feb-04 14:15 

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.