Click here to Skip to main content
16,010,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to copy the value of _bstr_t into a BSTR variable?? Pin
Erik Thompson25-Mar-01 21:21
sitebuilderErik Thompson25-Mar-01 21:21 
General1] OnKillFocus and RichEdit Ctrl - 2] Always on top Pin
25-Mar-01 20:37
suss25-Mar-01 20:37 
GeneralWeb Service Deployment problem Pin
Kannan Kalyanaraman25-Mar-01 19:10
Kannan Kalyanaraman25-Mar-01 19:10 
GeneralRe: Web Service Deployment problem Pin
Gerry25-Mar-01 21:02
Gerry25-Mar-01 21:02 
GeneralChanging the clock text Pin
Greg Hedlund25-Mar-01 13:59
Greg Hedlund25-Mar-01 13:59 
GeneralRecognizing a voice Pin
Antonio25-Mar-01 13:45
Antonio25-Mar-01 13:45 
GeneralDevStudio macro to open (and position) file Pin
Ravi Bhavnani25-Mar-01 10:48
professionalRavi Bhavnani25-Mar-01 10:48 
GeneralRe: DevStudio macro to open (and position) file Pin
Kannan Kalyanaraman25-Mar-01 22:07
Kannan Kalyanaraman25-Mar-01 22:07 
hi ravi,

I do not know macros .. but i know how to go about that in VC++
Actually there are lots of interfaces (a whole lot in VS.NET) available for manipulating the IDE/VStudio environment.
You need to have(query) the following interfaces,

IApplication, IDocument, ITextDocument, ITextSelection

You need to call the Open method of the IDocument interface with the "Text" Option.
It would be something like this,

if(pDocuments)
pDocuments->Open(CComBSTR(strFile), CComVariant("Text"),
CComVariant(VARIANT_FALSE), &p_Document)

For traversing inside the file, you need another interface called ITextDocument, Once you have the interface you can call,

if(pTxtDocuments)
pTxtDocuments->get_Selection(&m_pTxtSelection)

Before this you need initialize the Document context the Text you are going to refer.

Once you got the Text Document right for traversing inside you need to go for another interface called ITextSelection, and call a method inside that called GotoLine

if(pTxtSelection)
pTxtSelection->GoToLine(iLineNo,CComVariant(VARIANT_FALSE))

here FALSE would place the cursor in front of the line .. if you pass TRUE it would select that particular line.

Hope this helps Smile | :)

Cheers
Kannan




QuestionHow to work with an ACCESS database. Pin
Rafal25-Mar-01 7:17
Rafal25-Mar-01 7:17 
AnswerRe: How to work with an ACCESS database. Pin
25-Mar-01 9:42
suss25-Mar-01 9:42 
GeneralOpening New DIALOG Pin
Rafal25-Mar-01 6:10
Rafal25-Mar-01 6:10 
GeneralRe: Opening New DIALOG Pin
l a u r e n25-Mar-01 6:55
l a u r e n25-Mar-01 6:55 
QuestionInclude ALL MFC dlls? Pin
25-Mar-01 6:00
suss25-Mar-01 6:00 
AnswerRe: Include ALL MFC dlls? Pin
Anders Molin25-Mar-01 8:58
professionalAnders Molin25-Mar-01 8:58 
GeneralRe: Include ALL MFC dlls? Pin
25-Mar-01 9:24
suss25-Mar-01 9:24 
GeneralRe: Include ALL MFC dlls? Pin
Michael Dunn25-Mar-01 10:39
sitebuilderMichael Dunn25-Mar-01 10:39 
AnswerRe: Include ALL MFC dlls? Pin
26-Mar-01 0:10
suss26-Mar-01 0:10 
GeneralRe: Include ALL MFC dlls? Pin
26-Mar-01 4:25
suss26-Mar-01 4:25 
GeneralAccessing parent class variables Pin
25-Mar-01 2:39
suss25-Mar-01 2:39 
GeneralRe: Accessing parent class variables Pin
Joseph Dempsey25-Mar-01 4:21
Joseph Dempsey25-Mar-01 4:21 
GeneralWTL/Win32 question - making a CListCtrl Pin
Christian Graus25-Mar-01 1:21
protectorChristian Graus25-Mar-01 1:21 
GeneralRe: WTL/Win32 question - making a CListCtrl Pin
Michael Dunn25-Mar-01 9:24
sitebuilderMichael Dunn25-Mar-01 9:24 
GeneralRe: WTL/Win32 question - making a CListCtrl Pin
Christian Graus25-Mar-01 10:19
protectorChristian Graus25-Mar-01 10:19 
GeneralRe: WTL/Win32 question - making a CListCtrl Pin
Michael Dunn25-Mar-01 10:52
sitebuilderMichael Dunn25-Mar-01 10:52 
GeneralRe: WTL/Win32 question - making a CListCtrl Pin
Christian Graus26-Mar-01 10:19
protectorChristian Graus26-Mar-01 10:19 

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.