Recreate or recovering a VB6 project - vb6

I left VB6 and programming all together years ago, so pardon since I'm still dusting off what I remember.
I have an old program made for a friend in VB6 that he still runs in Windows Vista. He tried to update a label in the program and in trying to do the update, he has overwritten the project file where I used to see all forms and modules together.
Is there a way I can recover or recreate the project file as it was? All project files and modules are there, but when I open the VB6 project it shows only one form, that I can't compile or execute because it shows a "source not found"
I tried to go back to an old version of the project file with file recovery software but I couldn't find it.
Other way?

Practical steps to recover:
First and foremost: Back up what you have. Do this now.
Second, and only after the first, check (again) to see if you have a previous backup. Yes, this may seem pedantic, but, really, it's worth looking. Was that the only copy? Once you do all of this, consider creating a git repo for your code.
Third, in your empty project, simply right-click in the project explorer (Ctrl + R), and click "Add >" and then "Add Files...". Then, in the file input box, scroll down to the first file, hold down shift, and keep pressing the down arrow and all the files you want. Click "Open". Repeat if need be.
Finally, you need to re-add any dependencies. One way is simply to try to run the program with full compile (Ctrl + F5 or File | Run With Full Compile in the menus). If everything starts up, consider yourself fortunate. If not, you'll have to see each one that fails and add them back. This could be tedius, but just go through them one by one. In the Project menu, both "Components" and "References" can be gone through. Do this until the program successfully starts with full compile.
At this point, consider a making a backup. ;)

Related

SSIS script task "The binary code for the script is not found"

This problem is very similiar to those:
"The binary code for the script is not found" and
The binary code for the script is not found” ssis
I have an SSIS project with multiple script files. SSIS claims that one of them has no binary even though there should be. There are no code errors, and I can build it properly. I suspect it's a VS bug because this problem appears and disappears randomly. What I mean by that is that this script is working fine, I open it to see the contents, close and suddenly this error happens! So I open it like 20 times, and it (without me doing anything) repairs itself! Any ideas on how to make it work better? It seems (though I can't confirm with 100% certainty) that this problem happens when you save the SSIS script (as in use ctrl+s) instead of simply exiting from the VS.
Things that I have tried that sometimes work:
Restarting Visual studio, opening the script without doing anything, closing it
Adding a small change to the code, exiting
Removing and adding breakpoints
Going on my knees in the direction of Redmond, Washington, and chanting the names of M$ presidents while opening and closing windows in the building to the rhythm of the windows starting sound
Randomly closing and opening the project, as well as going through items in the script component menu
Things that don't seem to work: rebuilding project, cleaning project, you know the standard stuff
I've found a solution that OFTEN works. Notice the usage of often.
1) Try restarting your computer.
2) If it doesn't work go to your system temp files directory, and find the location of SSIS temp projects (you can also open the script, right click on C# project, explore in windows explorer). Delete the project. (Make copies before deleting just in case). Start Visual studio, and once again edit script, close, hope it works. DON'T SAVE THE SCRIPT PROJECT BEFORE CLOSING! JUST CLOSE!
Note that for the second step, you can also try using a cleaning tool, like CCleaner of similar.
In my case, I did some idiotic changes to main package solution config manager and tried changing the "Target SERVER Version". That wiped out all the scripts project from each packages. Then I came to know that it is auto-generation everytime we open. That means each package is storing script project within it. But now I don't know why its not generating while pressing on "Edit Script button" (really pissed!)
Thank for suggestion. In my case, I did some idiotic changes to main package solution config manager and tried changing the "Target SERVER Version". That wiped out all the scripts project from each packages. Then I came to know that it is auto-generation everytime we open. That means each package is storing script project within it. But now I don't know why its not generating while pressing on "Edit Script button" (really pissed!)
"Lucky I am" . got an fix! Each package file was internally not linked with their Script.cs. So I opened each package file in Notepad++ and found Script.cs content within. I recreated scripts.cs in each package (steps) and pasted the content from notepad++. And it worked!!!

Keeping unused files in Xcode project

In Eclipse you can create a folder and name it, say, "unused", to keep currently unused files (incomplete code, resources for future use, etc)
which are ignored by project builder. Can I have something similar with Xcode?
If I move a file to a project folder without inserting it with Xcode, it may be OK, and I will be able to see it while opening in Finder. However, it will be more convenient to have it listed by Project Navigator.
As far as I am concerned, it's not possible. Though, you can comment all of your code in one click to momentarily disable it.
Press command + A;
Right click and select Comment Selection.

VisualHG marks files with an [R] but TortoiseHg still removes/adds the files when committing

I'm using Visual Studio 2010 with VisualHG and TortoiseHg. I've noticed that if I move or rename a file using the Solution Explorer, a little [R] appears next to the file, which I assume indicates "renamed". However, if I go to commit my changes in TortoiseHg, it doesn't perform a rename--it deletes the old file and adds the new one. This causes all the history for the file to be lost (and bloats the repo unnecessarily).
Is there any way to get this to work properly? There's really very little benefit to using VisualHG if it's not going to coordinate file renames properly with TortoiseHg.
Also, I should mention that TortoiseHg has a "Detect Copies/Renames in Solution" dialog, but I can't seem to get it working. First, I can't seem to find any button or menu item in the TortoiseHg Workbench to launch it. Second, if I launch if using the terminal by entering thg guess, no path appears in the Unrevisioned Files box (and there's no apparent way to add one). I made sure I was navigated to the correct directory (my solution directory, which contains my .hg repo) when I tried this. I also tried thg guess solution_directory_path, but that made no difference. If this dialog is a possible solution to my problem, how do you actually use it?
Edit
I finally figured out that you can access the "Detect Copies/Renames in Solution" dialog by right clicking the solution folder in Windows Explorer, and selecting TortoiseHg > Guess Renames. When I do this, however, again, no path appear in the Unrevisioned Files box, so I still can't get started with this dialog. (I.e., I can't even perform step 1 in these instructions.)
Edit 2
I found a bug report on the VisualHG CodePlex issues page that I think explains the problem I'm having: https://visualhg.codeplex.com/workitem/99. I'm kind of surprised it hasn't gotten more votes, though.
After further investigation, I realize that, even though the files were shown as removed/added in TortoiseHg Workbench, they in fact were renamed correctly.
If you click a file with a "+" next to it in the Workbench, if that file was in fact a rename, the header for the code window will show something like this:
Project/Folder/RenamedFile.cs (renamed from Project/Folder/OriginalFile.cs)
After reading a bit more about what Mercurial is really doing, it sounds like it actually is deleting and adding, it's just that the added file maintains a reference to the original, so you can still view the history across renames.
I'm not sure if this explains the problems I was having with "Detect Copies/Renames in Solution", but I'm now satisfied that renames are being handled properly.

Is there a way to recover erased code in a source-controlled project(TFS)?

I'm working on a project in Visual Studio 2012, that's hosted on TFS.Any way, I don't know if it's due to lack of sleep or sheer carelessness, when trying to move one large function body from one file to another, I copied the declaration to the new file, but forgot to copy the body and then erased the body from the old one, clicked save by reflex and closed the first .cpp file, so when I pasted it in the second one, to my surprised I pasted the declaration and not the definition.Undo pending changes would only undo the 'Add' alltogether.Is there ANY way to retrieve the lost source or should I start rewriting it ASAP?Because I spend quite a while writing it.
View the history of the file. Right click it >> Source Control >> View History, as below:
This obviously assumes you've checked it in at some point.
Under Visual Studio you have several levels of Copy / Paste, so you could have retrieved it by pressing CtrlAltIns (if I remember well).
If you still haven't closed Visual Studio, it might still be in your Copy / Paste ring, it might be worth giving it a try.
Otherwise, you can always rollback to a previous check-in state in your TFS server (if you checked in the code you want before you deleted it).
First, check-in your current state to the server. Then rollback to the previous version that had your code (right click your solution, then Source Control -> Get Specific Version). Now copy your code in a side editor. Re-go to the latest version (Get latest Version... on your solution). Now re-paste your code at the right place and you're done.
If CTRL+Z doesn't work inside VS, go to the empty folder of the deleted files and try CTRL+Z there. Has worked for me several times.

visual studio keeps asking to save project file as

I am using VS 2010 and recently I moved some files around and changed paths etc.
The solution still compiles correctly and all files are able to be loaded/compiled without error however just about every time I go to compile after a change it gives me the save as dialog and asks me to save one of the projects, if I try to give it a new name or something the dialog does not exist nothing I do can make it exit apart from pressing cancel.
If I do a build straight after cancelling it works fine and I'm not presented with the save as dialog. I have verified that the project file is not read only.
Any ideas as to whats going on here.
The solution is stored in TFS 2008
You need to do 2 things
1- remove the read-only tick from the project folder
2- when a save-as window prompts at build, just overwrite the project
next time you build, the window won't pop up
You need to run VS as administrator. (right click on VS Icon- Run as administrator)
I solved the issue. When I try to save as this time it gives the error that file is being used by another process. Google Sync prevents to save so it opens save as dialog.
You should put your project under a folder not sync while working.
Are the bindings in TFS set up correctly with the new location? TFS will mark files as read only unless they get checked in. It might have been marked as such before you moved everything around, and now, isn't being checked out properly.
Also, try closing sync. files tools like google backup and sync.

Resources