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

C / C++ / MFC

 
AnswerRe: Why this code never works???!?? Pin
Antti Keskinen15-Feb-04 3:33
Antti Keskinen15-Feb-04 3:33 
GeneralRe: Why this code never works???!?? Pin
YaronNir15-Feb-04 5:33
YaronNir15-Feb-04 5:33 
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen15-Feb-04 7:10
Antti Keskinen15-Feb-04 7:10 
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen15-Feb-04 7:51
Antti Keskinen15-Feb-04 7:51 
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 
The VC++ 6.0 implements an IApplication interface. This interface allows access to a VC++ 6.0 object and it's sub-objects. These objects and how to automate tasks in VC6 are discussed in detail at an MSDN Link here[^].

Note, that I could not get the IApplication.ActiveProject method to work. It always caused a violation when ran. Instead, I built an example application that gets the project collection, queries for a project in the first slot, then gets this project's name.

You can download this example from here[^]. It is made completely with Visual Studio 6.0, so it should compile and run properly straight through. Remember, though that if you run the provided example application, you must have Visual Studio 6.0 running, and it must have a workspace and a project open. Otherwise the example app will crash !

You can add more wrappers for different objects in Visual Studio by using the ClassWizard. Just search your computer for a file named DEVSHL.DLL, then use the ClassWizard's 'Add -> From type library ' and specify the DEVSHL.DLL file. You will then be presented with a dialog showing the available interfaces.

Remember, that the ClassWizard automatically builds wrappers for the IDispatch interfaces of the available ones. Thus, if you want to access the IDispatch of IApplication, you choose 'IApplication' from the list, and code will be generated.

For the add-ins, the OnConnect method automatically receives a pointer to the IApplication interface. If you have an IDispatch wrapper for IApplication, you can use QueryInterface to ask for the interface IID_IDispatch from this interface. The returned LPDISPATCH can be used again in the AttachDispatch call of the wrapper class.

For further info, see the provided MSDN link and the comments in the source files.

-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 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 
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 

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.