code does not work an no exception raised!

Mar 26, 2014 at 6:13 AM
i am using c# and trying to 7z and encrypt a single file into a new output archive.. i succeeded to encrypt a whole folder but not a file. here is the code that does not work ( i.e. after running the code output directory has no .7z file and no exceptions raised what so ever !!) ,my archiving class look like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SevenZip;

namespace WindowsFormsApplication1
{
    class Class1
    {
        public static int compressFileTo7zip(string sourceFile, string destinationFile)
        { // takes the sourceFile and encrypt it with a password as destinationFile
            //try
            //{
            //Console.WriteLine("compressFileTo7zip source File = " + sourceFile);
            SevenZipCompressor myCompressor = new SevenZipCompressor();
            myCompressor.DirectoryStructure = true;
            myCompressor.ArchiveFormat = OutArchiveFormat.SevenZip;
            SevenZipCompressor.SetLibraryPath(@"7z.dll");

            myCompressor.CompressionMethod = CompressionMethod.Lzma;
            myCompressor.EncryptHeaders = true;
            myCompressor.IncludeEmptyDirectories = true;
            myCompressor.VolumeSize = 15000000; // 15 mb segment
            myCompressor.CompressionMode = CompressionMode.Create;
            myCompressor.TempFolderPath = System.IO.Path.GetTempPath();

            string myPassword = "2Hm3m3c2RKgkCjXyw7UGqhZh2EbezNM5EV"; // yes hardcoded ,just for debugging
            // compress with password
            myCompressor.CompressFilesEncrypted(destinationFile,myPassword, sourceFile );
            //myCompressor.CompressFiles(destinationFile, sourceFile); // no output too !!
            return 1;
            //}
            //catch (SevenZipLibraryException Ex)
            //{
            //   Console.WriteLine("7zip 2nd merror message= " + Ex.Message);
            //   return -1; // an error occured ,return an indication of that
            //}



        }
    }
}
and i call it from a button click like so :
private void button1_Click(object sender, EventArgs e)
        {
            Class1.compressFileTo7zip(@"d:\ddd.doc", @"d:\eee.7z");
        }
the file d:\ddd.doc does exist. just for the sake of completeness i will include my code that work for archiving directories:
public static int sourceDirectoryToFirstZipFile(string sourceDirectory, string destinationZip)
        {
            try
            {
                SevenZipCompressor myCompressor = new SevenZipCompressor();
                myCompressor.DirectoryStructure = true;
                myCompressor.ArchiveFormat = OutArchiveFormat.SevenZip;
                myCompressor.CompressionMethod = CompressionMethod.Lzma;
                myCompressor.EncryptHeaders = true;
                myCompressor.IncludeEmptyDirectories = true;
                SevenZipCompressor.SetLibraryPath(@"7z.dll");

                myCompressor.CompressionMode = CompressionMode.Create;
                myCompressor.TempFolderPath = System.IO.Path.GetTempPath();

                string myPassword = "j4jkds98wlef04fw8nsfvi8svd9fwemjk"; //just debugging
                // compress with password
                myCompressor.CompressDirectory(sourceDirectory, destinationZip, myPassword);
                return 1;
            }
            catch(SevenZipLibraryException Ex)
            {
                Console.WriteLine("7zip 1st merror message= " + Ex.Message);
                return -1; // an error occured ,return an indication of that
            }
        } 
shall you please give me some idea on what to do to make my code work ?
thankx