🔒 Locked
Developing a plugin for VC++?
Advertisement
Original Post
Well, I have heard a few horror stories about VC++ deleting your source files and stuff, so I dont trust it now, I am interested in developing a plugin for VC++ that backs up my stuff and that, like a source control system, im probly sure you get them for it already, but you probly have to pay for them, but I dont really care even if you can get them for free, I would like to make one for myself... so how would I go about this?
CEO Platoon Studios
quote:
Original post by elis-cool
Well, I have heard a few horror stories about VC++ deleting your source files and stuff,
Um, not likely. Visual Studio is one of Microsoft''s better products (if not their best) and I''ve never run into any bugs (other than a few minor ones to do with the AutoComplete and stuff), and I''ve been using it for years.
codeka.com - Just click it.
What!? Until SP4 was released, I crashed MSVC6 several times a day! Now it''s only a couple times a week with both 6&7.
And if it crashes while you''re saving... kiss your source code buh-bye! (That''s only happend to me twice)
And hell will freeze over before auto-complete & the class-view work right. (It''s better but still far from prefect in MSVC7)
It''s unusual for either to work correctly. In the IDE guys''s defense here, it is a daunting task to make these features work perfectly. You need a fully interactive & compliant compiler.
And if it crashes while you''re saving... kiss your source code buh-bye! (That''s only happend to me twice)
And hell will freeze over before auto-complete & the class-view work right. (It''s better but still far from prefect in MSVC7)
It''s unusual for either to work correctly. In the IDE guys''s defense here, it is a daunting task to make these features work perfectly. You need a fully interactive & compliant compiler.
I had Visual C++ 6.0 crash sometimes when I ran it on Windows 98
and I tried to run code that screw up the system... But that
wasn't exactly the IDE's fault - more one of the operating system.
When using it on NT-based systems it worked really fine. The .NET
IDE is a bit slower now (more like Office), but still way more
reliable than other Microsoft products.
You're right about the AutoComplete feature, though...
[edited by - Origin on July 21, 2002 6:10:07 PM]
and I tried to run code that screw up the system... But that
wasn't exactly the IDE's fault - more one of the operating system.
When using it on NT-based systems it worked really fine. The .NET
IDE is a bit slower now (more like Office), but still way more
reliable than other Microsoft products.
You're right about the AutoComplete feature, though...
[edited by - Origin on July 21, 2002 6:10:07 PM]
msvc++ has never crashed on me(I use v5 enterprise). IMO it's the only product that M$ has ever got right. It's also the only M$ product that doesn't piss me off. And it's the product M$ coders spend most of their time in. Hmmm strange 
[edited by - Monder on July 21, 2002 6:26:05 PM]
[edited by - Monder on July 21, 2002 6:26:05 PM]
You don't want to write a plug-in, you want to write a macro. Assuming you're using VS.NET, which you should, the code below will backup all your open files -- you just need to paste the functions into some class in the VS Macro IDE. It's pretty easy to figure out, even without reading anything about it...or even knowing VB.
If you really want to create an plugin, you start by creating an "Add-in" project. Creating your own source control system would be rather "extreme", though...you should probably look into using something that already exists like SourceSafe.
/********************
Sub BackUpAllOpenDocuments()
Dim doc As Document
For Each doc In DTE.Documents()
doc.Activate()
SaveBackup()
Next
End Sub
Sub SaveBackup()
Dim Sel As TextSelection = ActiveDocument.Selection
Dim FileName As String = ActiveDocument.FullName + ".bak"
Dim Anchor As EditPoint = Sel.AnchorPoint.CreateEditPoint
Dim Active As EditPoint = Sel.ActivePoint.CreateEditPoint
Dim tw As TextWindow = DTE.ActiveWindow.Object
Dim Pane As TextPane = tw.ActivePane
Dim Corner As EditPoint = Pane.StartPoint.CreateEditPoint
Dim Text As String
Sel.SelectAll()
Text = Sel.Text
' Create the temp document, save, then close.
DTE.ItemOperations.NewFile("General\Text File")
ActiveDocument.Object("TextDocument").Selection.Insert(Text)
ActiveDocument.Save(FileName)
ActiveDocument.Close(EnvDTE.vsSaveChanges.vsSaveChangesNo) 'Already saved with line above, don't need to save again
' Restore the selection.
Sel.MoveToPoint(Anchor)
Sel.MoveToPoint(Active, True)
Pane.TryToShow(Corner, vsPaneShowHow.vsPaneShowTop)
End Sub
********************/
[edited by - WoR on July 21, 2002 7:18:39 PM]
If you really want to create an plugin, you start by creating an "Add-in" project. Creating your own source control system would be rather "extreme", though...you should probably look into using something that already exists like SourceSafe.
/********************
Sub BackUpAllOpenDocuments()
Dim doc As Document
For Each doc In DTE.Documents()
doc.Activate()
SaveBackup()
Next
End Sub
Sub SaveBackup()
Dim Sel As TextSelection = ActiveDocument.Selection
Dim FileName As String = ActiveDocument.FullName + ".bak"
Dim Anchor As EditPoint = Sel.AnchorPoint.CreateEditPoint
Dim Active As EditPoint = Sel.ActivePoint.CreateEditPoint
Dim tw As TextWindow = DTE.ActiveWindow.Object
Dim Pane As TextPane = tw.ActivePane
Dim Corner As EditPoint = Pane.StartPoint.CreateEditPoint
Dim Text As String
Sel.SelectAll()
Text = Sel.Text
' Create the temp document, save, then close.
DTE.ItemOperations.NewFile("General\Text File")
ActiveDocument.Object("TextDocument").Selection.Insert(Text)
ActiveDocument.Save(FileName)
ActiveDocument.Close(EnvDTE.vsSaveChanges.vsSaveChangesNo) 'Already saved with line above, don't need to save again
' Restore the selection.
Sel.MoveToPoint(Anchor)
Sel.MoveToPoint(Active, True)
Pane.TryToShow(Corner, vsPaneShowHow.vsPaneShowTop)
End Sub
********************/
[edited by - WoR on July 21, 2002 7:18:39 PM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement