Re: Need some help...



Stephany,

I'm going to hold out my wrist and let you slap it, OK?? You are correct. I
had temporarily changed the
Path.GetFilename(_Folder) to simply '= _Folder' to try something after
reading one of your messages. When I noted that it was providing the full
path, I changed it back to the original. But I mada the copy of the line
prior to changing it back without realizing that I would throw everything
out of whack. Told you I was senile. :) I posted the working sub under your
other response earlier.

"Stephany Young" <noone@localhost> wrote in message
news:%23mG5immIHHA.2232@xxxxxxxxxxxxxxxxxxxxxxx
Another Paint Shop Pro X user. That makes 2 I know of now. :)

I would expect strDeepestNode to have a value of Brushes rather than the
full path, because strDeepestNode is assigned the result of
Path.GetFilename(_Folder).

If strTargetDir is "C:\Temp" then I would expect the result of
Path.ChangeExtension(Path.Combine(strTargetDir, strDeepestNode), "cab") to
be "C:\Temp\Brushes.cab".

What happens if you use paths that don't have any spaces in them?

It's possible that the CabLib library has a 'bug' in it but I would be
inclined to make sure that I am sure that my own code is correct and what
the behaviours are before I start going down that path.?



"Bruce W. Darby" <kracor@xxxxxxxxxxx> wrote in message
news:T9udnceeFs8FvBvYnZ2dnUVZ_r6vnZ2d@xxxxxxxxxxxxxx
Stephany,

I'm far too lazy to type that much code into a newsgroup window... LOL
Trust me when I say that I've made prodigious use of the Ctrl-C/Ctrl-V
option.

Now on with the show...

When I commented out the i_Compress.CompressFolder line and used your
Console.Writeline command line, I got a string of text showing the path
of the compressed file, as follows

strSourceDir "C:\Program Files\Corel\Corel Paint Shop Pro X" String
strDeepestNode "C:\Program Files\Corel\Corel Paint Shop Pro X\Brushes"
String

But I went just a little bit further and changed the Console.Writeline
portion of the command line to i_Compress.CompressFolder. As soon as I
left that line, three errors popped up in the IDE. Here they are...

Error 1 Argument not specified for parameter 's_CabFile' of 'Public Sub
CompressFolder(s_Folder As String, s_CabFile As String, s_Filter As
String, s32_SplitSize As Integer)'. D:\Program Files\Microsoft Visual
Studio\Projects\Folder Archive\Folder Archive\Folder Archive\Form1.vb 129
13 Folder Archive

Error 2 Argument not specified for parameter 's_Filter' of 'Public Sub
CompressFolder(s_Folder As String, s_CabFile As String, s_Filter As
String, s32_SplitSize As Integer)'. D:\Program Files\Microsoft Visual
Studio\Projects\Folder Archive\Folder Archive\Folder Archive\Form1.vb 129
13 Folder Archive

Error 3 Argument not specified for parameter 's32_SplitSize' of 'Public
Sub CompressFolder(s_Folder As String, s_CabFile As String, s_Filter As
String, s32_SplitSize As Integer)'. D:\Program Files\Microsoft Visual
Studio\Projects\Folder Archive\Folder Archive\Folder Archive\Form1.vb 129
13 Folder Archive

These are the same errors I was receiving when I tried what you
suggested, which is why I believe that there may be a bug in the .dll
because it's (possibly) parsing the command strings only for commas and
when it sees one, it goes looking for the next piece of the puzzle
instead of trying to make sure the piece I've provided it really fits.
When I present it with just a variable it behaves as it should. :)

P.S. In the last message I posted with the leading params, I did make a
typo, but I was trying to illustrate how I thought the .dll was parsing
it's commands and got in a rush and just typed stuff in. The actual code
doesn't have that colon at the end of "cab". Sorry.

"Stephany Young" <noone@localhost> wrote in message
news:u%23X2PrlIHHA.1816@xxxxxxxxxxxxxxxxxxxxxxx
Typo!!!!!

Directly following the b of cab should be a " - you have a :

FYI, I get the impression that you are typing your code into the message
rather than copying and pasting it. If you are then it is too open to
typo's etc. and we are scratching our heads to figure out how you even
managed to compile it etc.

When you do copy and paste code from the IDE into a message it may look
like a load of rubbish. Simply do a Format/Rich Text (HTML) from the
menu and then do a Format/Plain Text and it will look OK.

Now the big question is, what result do you get when you execute?:

Console.WriteLine(Path.ChangeExtension(Path.Combine(strTargetDir,
_deepestnode), "cab"))


"Bruce W. Darby" <kracor@xxxxxxxxxxx> wrote in message
news:VqWdneF3JYlJlBvYnZ2dnUVZ_qOpnZ2d@xxxxxxxxxxxxxx

"Stephany Young" <noone@localhost> wrote in message
news:O5OSlwjIHHA.448@xxxxxxxxxxxxxxxxxxxxxxx
I don't understand why the call to i_Compress.CompressFolder is not
working. It takes 4 parameters and they are:

The second parameter is what causes the failure. It is somehow not
seeing that I'm attempting to pass 'one' simple parameter. I'm thinking
that it's catching the commas in the Path.Combine method and thinking
that it's getting five or six parameters rather than four. In software
testing terms, I'd say that was a bug. LOL

Example:
Param 1 - _Folder,
Param 2 - Path.ChangeExtension(Path.Combine(strTargetDir,_deepestNode),
Param 3 -"cab:),
Param 4 - "",
Param 5 - 0

_Folder,
Path.ChangeExtension(Path.Combine(strTargetDir, _deepestnode), "cab")
""
0










.



Relevant Pages

  • Re: Is Java Applet Best?
    ... * @param pName ... DirFilter(String[] pAvoidDirs) ... * Accept only junk files to be deleted. ... * exec command to invoke NT command processor customised for my ...
    (comp.lang.java.programmer)
  • Re: Copying Directories
    ... Here is a program for getting rid of junk files. ... * @param pName ... DirFilter(String[] pAvoidDirs) ... * exec command to invoke NT command processor customised for my ...
    (comp.lang.java.programmer)
  • Re: VB6 and Windows Media Player
    ... within the My Music Folder. ... Private Declare Function ShellExecute Lib "shell32.dll" Alias ... "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal ... the folder Documents and Settings eg:- C:\Documents and Settings? ...
    (microsoft.public.vb.general.discussion)
  • Re: File Input Question
    ... To have a user select a folder, not a file, I use the below. ... pszDisplayName As String 'Address of a buffer to receive the display name of the folder ... Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long ... Private Declare Function GetWindowRect Lib "user32" ...
    (microsoft.public.excel.programming)
  • Re: How do outlook express save mail??
    ... windows interface, but will use the safe mode and DOS commands to try and ... > {a long string of numbers} is a sequence assigned to your identity and there ... > may be more that one folder, each with a different string of numbers. ... > settings" folder and all that follow will be hidden from any form of command ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)