Click here to Skip to main content
15,900,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDoes C# has default SOAP client package? Pin
Jack Su15-Feb-04 1:58
Jack Su15-Feb-04 1:58 
GeneralProcessor or Mainboard's Serial Number Pin
Member 84094015-Feb-04 1:51
Member 84094015-Feb-04 1:51 
GeneralRe: Processor or Mainboard's Serial Number Pin
Toni7815-Feb-04 19:10
Toni7815-Feb-04 19:10 
GeneralRe: Processor or Mainboard's Serial Number Pin
David Crow16-Feb-04 3:13
David Crow16-Feb-04 3:13 
GeneralConvert virtual key code to human readable format Pin
User 665815-Feb-04 1:30
User 665815-Feb-04 1:30 
GeneralRe: Convert virtual key code to human readable format Pin
Antti Keskinen15-Feb-04 3:08
Antti Keskinen15-Feb-04 3:08 
QuestionWhy this code never works???!?? Pin
YaronNir15-Feb-04 1:26
YaronNir15-Feb-04 1:26 
AnswerRe: Why this code never works???!?? Pin
Antti Keskinen15-Feb-04 3:33
Antti Keskinen15-Feb-04 3:33 
According the MSDN Library:

POSITION GetFirstDocTemplatePosition( ) const;

Return Value
A POSITION value that can be used for iteration or object pointer retrieval; NULL if the list is empty.


Thus, logical deduction is that your document template is empty. Also, you're asking for the document template position from your ATL-COM application. In order to access the IDE from your application, see this extract from MSDN.

Add-ins are time- and labor-saving applications that attach to and are used within the IDE. They are COM objects that implement the IDTExtensibility2 Interface and communicate with the IDE through the automation object model contained in the EnvDTE type library (dte.olb)

Like said, you can use the provided automation object model (DTE) to access the Visual Studio IDE. This object model is located in the dte.olb file, and it's COM name is 'Microsoft Development Environment', added with a version number. You must use this approach if you're not writing an add-in. If you are, the DTE object is provided to you automatically.

To actually utilize the DTE object, here is a code fragment that first loads the Microsoft Development Environment 7.0 object, then requests a pointer to the running instance of Visual Studio .NET:
//The following #import imports DTE based on its LIBID
#import "libid:80cc9f66-e7d8-4ddd-85b6-d9e6cd0e93e2" version("7.0") lcid("0") raw_interfaces_only named_guids
#pragma warning( default : 4278 )
using namespace EnvDTE; // optional

// Accessing the running instance of Visual Studio .NET
CComPtr<EnvDTE::_DTE> m_pDTE;
CLSID clsid;
CLSIDFromProgID(L"VisualStudio.DTE.7.1",&clsid);
CComPtr<IUnknown> punk;
HRESULT hr = GetActiveObject(clsid,NULL,&punk); // get a running instance of Visual Studio .NET
m_pDTE = punk;
The same approach ideas should work just as well for other environments, just the version numbers change. See your own IDE documentation for the correct object name, or browse through the COM object adder.

-Antti Keskinen


----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
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 
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 

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.