SubFox doesn't create VCX/VCT files

Topics: Bug Information
Dec 3, 2009 at 3:28 PM
Edited Dec 3, 2009 at 3:37 PM


When Downloading from Repository to create a VFP proj ect the SCX/SCT files are created and added to the project, but VCX/VCT not.
*.vcx.subfox and *.vcx-*.subfox are present but no binary file is created and added to project.
Is even not possible to use the Translate Source Files function because the *.vcx.subfox files are not visible in the dialog.
SubFox vers. 1.2.103


When Downloading from Repository to create a VFP project the SCX/SCT files are created and added to the project, but VCX/VCT not.

*.vcx.subfox and *.vcx-*.subfox are present but no binary file is created and added to project.

Is even not possible to use the Translate Source Files function because the *.vcx.subfox files are not visible in the dialog.

The problem is the same if I use Translate Source Files just after checkout with Tortoise.

SubFox vers. 1.2.103



Jan 4, 2010 at 9:15 PM

Sorry for the delay in getting back to you on this.  I have not been monitoring the Discussions area, so I only just discovered your bug report.  Unfortunately, my system is busy conducting a full backup which will probably last another 4 hours, so I thought I would quickly respond and thank you for the report.  A bug fix should be posted in the next 24 hours.

Jan 5, 2010 at 7:09 PM
Thank you, please see my other post about pushok components.....
Thank you again for Subfox.

Andrea Mariottini
Jan 11, 2010 at 6:21 PM

In response to your bug report, I have posted a new version that should overcome this problem with VCX files not being decoded - version 1.2.106.

I will continue testing to see if there is a "legitimate" bug that I have overlooked, but I can assure you that SubFox does decode class-libraries automatically when it performs the download from the server repository.  It does NOT, however, perform any decoding without a trigger event.  If you are using Tortoise to move files back and forth, you should install the Tortoise hooks to SubFox.  There has not yet been sufficient testing for me to be able to reassure you that Tortoise always dutifully invokes these hooks whenever translation is required, so you should be verifying and reporting problems if they occur (please!).

I am still looking at the issue of PushOk COM object file path flexibility.  I too have been stung by this problem already, so I am eager to have it fixed.

Jan 11, 2010 at 7:09 PM

Okay, so I lied.  I re-posted release 1.2.106 to include the change for SVN-COM portability.  The only reference that I changed was in the SVN Event Listener, which I switched to a GUID reference {26BAD3D0-C2C4-4723-9175-840366CF37E7}#1.0.  Since I don't know much about using the IMPLEMENTS clause, I could have screwed it up and not realized it, but it looks like it still works so we'll see.

Jan 12, 2010 at 12:43 PM
Now PushOK integration seems ok, but I have ever the problem of VCX files.
If you give me a private email I can send to you the .subfox files.....
Andrea Mariottini
Jan 12, 2010 at 12:48 PM

Maybe the problem is the VCX contains an OLE object?

Jan 12, 2010 at 12:51 PM

If I choose "Translate source files..." even if I check "Show all files" I don't see the vcx file and I can't decode it manually.

Jan 12, 2010 at 2:00 PM
amariottini wrote:

Maybe the problem is the VCX contains an OLE object?

Nope.  The conversion simply creates a VFP table, then re-compiles it.  Even if the compile fails, the VCX file (table) would still exist. 

OLE objects involve binary data, which SubFox stores in base64 format.  Again, that might somehow fail, but the vcx should get created.

Jan 12, 2010 at 2:22 PM
Edited Jan 12, 2010 at 2:25 PM
amariottini wrote:

If I choose "Translate source files..." even if I check "Show all files" I don't see the vcx file and I can't decode it manually.

 Is the VCX added to your project?  Is it Excluded from the build?  Is it included as a versioned file (using the SubFox->Setup Versioned Files... feature)?

If you answered NO to the 1st or 3rd question above, then the feature SubFox->Translate Source Files... is working properly:  it only offers to translate the versioned files within the active project.

The problem I thought you were having is that after downloading the encoded file from the repository, it never got added to your project.  Thereafter, you couldn't do anything with it because you couldn't add it to your project because the decoded version of the VCX simply wasn't there.  The new Add/Remove feature should resolve this by allowing you to add resources that have not yet been decoded.

However, it is still a bug if you downloaded an encoded vcx from your repository but it did not get decoded.  If you download via SubFox, it should decode as part of the process regardless of whether it is included in the VFP project.  If downloaded via Tortoise, the hooks mechanism should have fired, passing a list of downloaded files to SubFox, and decoding all of them regardless of project.

Lastly, I am concerned that perhaps the program DID attempt to decode the vcx, but it failed somehow without notifying you.  Failure is bad, but neglecting to notify the user with a proper error message is inexcusable.  I can't believe this is what happened, but I will continue testing to see if somehow it did.

Jan 13, 2010 at 3:13 PM

It's fixed (see release 1.2.107).

The bug was in the project decoder, and the error was not related to class libraries, but merely to the last file listed in the encoded project file.  Somehow the parser was leaving a trailing carriage return / line feed on the final file name, which became further mangled when a ".subfox" extension was appended after that.  Naturally VFP could not open a file with a mangled name like that, so the decoder simply never got called for the last file in the list.

Oct 15, 2012 at 3:07 PM

I have version 1.2.121, and I still have the VCX problem as described in this thread. The hooks are installed, and they work for every other file type. The hook also works to encode the class files before commit. However, when i update an encoded class file, the hook does not work, and the user has to manually translate through VFP>Subfox, which takes at least 5 minutes per user. Failure to remember this step has resulted in a huge mess with missing code. Furthermore, Subfox's decode after downloading menu always shows that every vcx needs to be decoded. That means everyone has to know exactly which class libraries they need to decode, or else take the time to translate every one of them, and usually crash out at some point during the process. We are about to have to drop Subversion because our team cannot get the hang of all of these additional steps. Do you have any advice?

Oct 15, 2012 at 7:51 PM
Edited Oct 15, 2012 at 7:57 PM

I went ahead and looked through the source code for the tortoise hooks, and I found some odd behavior with the VCX's.

Changing the lines below that are bold seem to have corrected the issue. The hooks still work properly for forms with these changes as far as i can tell.

It was trying to compare aaa.vcx against aaa.vcx.subfox instead of aaa.vcx-class1.subfox. There is still an issue with the time comparison. After decoding a vcx, the timestamp does not reflect the latest subfox timestamp. I think this is why they are always flagged for translation.

This isn't perfect, but it's better than nothing. When you try to commit the directory, it re-encodes every single subfox file, instead of just the ones that have changed. I will look into that as well.

FUNCTION AddFileToList(sFName AS String, bIncludeMissingFiles AS Boolean) AS VOID
    LOCAL s
        s = LEFT( sFName, RAT( ".", sFName ) - 1 )
        IF PADR( JUSTEXT( s ), 4 ) == "vcx-"
            s = FORCEEXT( s, "vcx" )
        IF FILE(s)
            *sFName = s
            IF bIncludeMissingFiles
                INSERT INTO cFile (s_FName) VALUES (sFName)
    *IF FILE( sFName ) AND ("," + JUSTEXT( sFName ) + ",") $ ("," + SUBFOX_ENCODEABLE_EXTS + ",")
    IF FILE( sFName ) AND ("," + JUSTEXT( s ) + ",") $ ("," + SUBFOX_ENCODEABLE_EXTS + ",")
*--            SEEK( PADR( sFName, MAX_VFP_IDX_LEN ) )
*--            LOCATE FOR s_FName == PADR( sFName, MAX_VFP_FLD_LEN ) ;
*--                REST WHILE PADR( sFName, MAX_VFP_IDX_LEN ) == PADR( s_FName, MAX_VFP_IDX_LEN )
*--            IF !FOUND()
        IF !this.SeekInCFile( sFName )
            *s = sFName + "." + SUBFOX_PRIVATE_EXT
            IF !FILE(s) OR this.FDateTime(s) != this.FDateTime(sFName)
*                INSERT INTO cFile (s_FName) VALUES (sFName)
                INSERT INTO cFile (s_FName) VALUES (s)
ENDFUNC && AddFileToList

Oct 21, 2012 at 6:29 PM

eklamer:  I think I may have the solution to your problem.  When you use Tortoise, you must always include in your Commit and Update functions not only the individual class files, but also the encoded file for the class library as a whole.  For instance:

  • myclasslib.vcx.subfox
  • myclasslib.vcx-mytextbox.subfox
  • myclasslib.vcx-mylabel.subfox

When you commit updates to one class you must also commit updates to the overall library.  SubFox always looks at the encoded file for the class-library to determine whether or not it has had any changes, and then to discover what classes are in the library.

As for the code changes suggested by eklamer, they are not correct. 

The AddFileToList method of the SubFoxTortoiseTools class must strip off the "subfox" extension if it exists to convert the file name into a normal native file name.  In the case of VCX files, this also means removing the class name embedded into the encoded file's name.  eklamer's modifications would preserve the "subfox" extension embedded in the file names passed from Tortoise.

The two functions Encode and Decode each use the same method LoadFileList to transform the Tortoise parameter (a file name of a temp file containing a list of files and folders) into a VFP cursor containing normal native files names.  Each method then scans the cursor, appending the ".subfox" extension to each file where necessary creating from-to file name pairs.

The SubFoxTortoiseTools class only builds the list of files to process.  The SubFoxTranslator class is responsible for encoding or decoding without trampling updates in the project's working copy.  If there are bugs in that program, we have yet to identify them. However, in researching this bug report I decided the logic was a bit confusing, and perhaps could present errors in certain situations.  Specifically in the case of decoding new files (classes, forms, reports, etc).

I have tweaked the AddFileToList method, and added a lengthy comment.  The new version is posted as 1.2.122. I will continue to review the bug report regarding classes in specific and try to reproduce the bug myself.  There may be additional releases to follow.  Thanks.