Reputation: 2391
I have a big application developed in MFC C++ 6.0 and I want to migrate it to VS2005 and then, to VS2012. I'm looking for solve as much errors as I can, however I run into this situation:
I had a MFC C++ method: BOOL CPaginaModelo::OnRetirar_ItemLista() which returned a boolean value. So in many cpp files I use code like:
if (CPaginaModelo::OnRetirar_ItemLista())
{
<code>
}
For migration reasons, I have to change such method from BOOL to void, so the code should looks like:
CPaginaModelo::OnRetirar_ItemLista();
<code>
Since there are a lot of parts of the project files where this is used, is there any way by using search and replace with regular expressions in VS2005 to replace first expression to look like second expression?
Thanks for your help
Upvotes: 0
Views: 317
Reputation: 4017
You could find and replace text in the Visual Studio editor by using Find and Replace (Ctrl+F or Ctrl+H) or Find/Replace in Files (Ctrl+Shift+F or Ctrl+Shift+H). For more details, I suggest you could refer to the link:https://learn.microsoft.com/en-us/visualstudio/ide/finding-and-replacing-text?view=vs-2019
You could also try to use .NET regular expressions to find and replace text in visual studio. For more details, I suggest you could refer to the link:https://learn.microsoft.com/en-us/visualstudio/ide/using-regular-expressions-in-visual-studio?view=vs-2019
As far as I'm concerned, Replacement couldn't make a symbol disappear, so { }
may need to be removed manually.
Upvotes: 1
Reputation: 1815
Find and replace operation is not dependent on visual studio version. If you want use higher version of VS for this purpose then you just need to open particular VS and in find window replace window, replace parameter of "Look In" from entire solution to folder of your solution. This will allow you apply find and replace operation on certain folder.
To solved your issue, Multiline Search and Replace will help to complete replacement of your code with specific.
Upvotes: 1