Home All Groups Group Topic Archive Search About
Author
16 Oct 2005 9:51 PM
DPM
Hello,

We've written an application in VB6 we intend to run on XP SP1 embedded.  We
compile the application and package it.  If we install and run it on XP pro
SP1 it runs correctly, but on XPe we get a "Runtime error 5" (invalid
procedure call or argument).  We've isolated to a string function (LEFT,
MID, RIGHT or INSTR).  Curiously, if we build the XP Pro emulation on
embedded we don't see the problem, so we can only assume that we're missing
a component.

So the $64K question is: what XP component would be used to handle string
functions?  It must be part of the basic OS if the VB6 packager does not
include it.  Is there a tool we could use to isolate the dll or control that
does string management?

Any help appreciated.  Thanks.
--
Regards,
Dean

Author
16 Oct 2005 10:20 PM
Someone
> So the $64K question is: what XP component would be used to handle string
> functions?

MSVBVM60.DLL

Add error handling to your code. Here is how to show which routine and line
if you can't run the IDE in the target system.

- Download and install MZTools:

http://www.mztools.com/v3/mztools3.htm

- Go to MZTools Options|Error Handler, and paste the following(unwrap as
needed):

    On Error GoTo {PROCEDURE_NAME}_Error

{PROCEDURE_BODY}

ExitMe:
    On Error GoTo 0
    Exit {PROCEDURE_TYPE}

{PROCEDURE_NAME}_Error:

    MsgBox "{MODULE_NAME}:{PROCEDURE_NAME}:" & ErL & vbCrLf & "Error " &
Err.Number & ": " & Err.Description
    Resume ExitMe

- The above would show a message like:

Form1:Form_Load:110
Error 5: Invalid procedure call or argument

- Backup your source files in case you want to remove these additions
quickly.

- Go to every form and routine and add an error handler by clicking on the
icon on the tool bar. Add line numbers to each routines as well, which is
another button in MZTools toolbar.




Show quoteHide quote
"DPM" <d*@junk.com> wrote in message
news:u63MXvp0FHA.3336@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> We've written an application in VB6 we intend to run on XP SP1 embedded.
> We
> compile the application and package it.  If we install and run it on XP
> pro
> SP1 it runs correctly, but on XPe we get a "Runtime error 5" (invalid
> procedure call or argument).  We've isolated to a string function (LEFT,
> MID, RIGHT or INSTR).  Curiously, if we build the XP Pro emulation on
> embedded we don't see the problem, so we can only assume that we're
> missing
> a component.
>
> So the $64K question is: what XP component would be used to handle string
> functions?  It must be part of the basic OS if the VB6 packager does not
> include it.  Is there a tool we could use to isolate the dll or control
> that
> does string management?
>
> Any help appreciated.  Thanks.
> --
> Regards,
> Dean
>
>
Author
16 Oct 2005 10:46 PM
Someone
You could find related DLL files by going to View|Object Browser(F2).
Maximize the window, then search for the function name and see what library
it's included in. For example, searching for "mid" shows that it's in "VBA"
library. To find the DLL name for "VBA" library, select "VBA" from the
dropdown list on the upper left. At the bottom, you will see what's the DLL
file name for "VBA" library. In my case, it shows
"C:\WINDOWS\system32\msvbvm60.dll".

Adding error handling to everywhere in your code helps in finding where the
problem is. You probably have error handling in places where you expect the
errors to be, but in this case it was not enough.


Show quoteHide quote
"Someone" <nob***@cox.net> wrote in message
news:eQB6c$p0FHA.3856@tk2msftngp13.phx.gbl...
>> So the $64K question is: what XP component would be used to handle string
>> functions?
>
> MSVBVM60.DLL
>
> Add error handling to your code. Here is how to show which routine and
> line if you can't run the IDE in the target system.
>
> - Download and install MZTools:
>
> http://www.mztools.com/v3/mztools3.htm
>
> - Go to MZTools Options|Error Handler, and paste the following(unwrap as
> needed):
>
>    On Error GoTo {PROCEDURE_NAME}_Error
>
> {PROCEDURE_BODY}
>
> ExitMe:
>    On Error GoTo 0
>    Exit {PROCEDURE_TYPE}
>
> {PROCEDURE_NAME}_Error:
>
>    MsgBox "{MODULE_NAME}:{PROCEDURE_NAME}:" & ErL & vbCrLf & "Error " &
> Err.Number & ": " & Err.Description
>    Resume ExitMe
>
> - The above would show a message like:
>
> Form1:Form_Load:110
> Error 5: Invalid procedure call or argument
>
> - Backup your source files in case you want to remove these additions
> quickly.
>
> - Go to every form and routine and add an error handler by clicking on the
> icon on the tool bar. Add line numbers to each routines as well, which is
> another button in MZTools toolbar.
>
>
>
>
> "DPM" <d*@junk.com> wrote in message
> news:u63MXvp0FHA.3336@TK2MSFTNGP12.phx.gbl...
>> Hello,
>>
>> We've written an application in VB6 we intend to run on XP SP1 embedded.
>> We
>> compile the application and package it.  If we install and run it on XP
>> pro
>> SP1 it runs correctly, but on XPe we get a "Runtime error 5" (invalid
>> procedure call or argument).  We've isolated to a string function (LEFT,
>> MID, RIGHT or INSTR).  Curiously, if we build the XP Pro emulation on
>> embedded we don't see the problem, so we can only assume that we're
>> missing
>> a component.
>>
>> So the $64K question is: what XP component would be used to handle string
>> functions?  It must be part of the basic OS if the VB6 packager does not
>> include it.  Is there a tool we could use to isolate the dll or control
>> that
>> does string management?
>>
>> Any help appreciated.  Thanks.
>> --
>> Regards,
>> Dean
>>
>>
>
>
Author
17 Oct 2005 5:31 PM
DPM
Solved it.  Turns out German language support got included somehow, and this
screwed up some date string processing.

Thanks for your suggestions.

Dean

Show quoteHide quote
"Someone" <nob***@cox.net> wrote in message
news:eOiVyNq0FHA.2924@TK2MSFTNGP15.phx.gbl...
> You could find related DLL files by going to View|Object Browser(F2).
> Maximize the window, then search for the function name and see what
library
> it's included in. For example, searching for "mid" shows that it's in
"VBA"
> library. To find the DLL name for "VBA" library, select "VBA" from the
> dropdown list on the upper left. At the bottom, you will see what's the
DLL
> file name for "VBA" library. In my case, it shows
> "C:\WINDOWS\system32\msvbvm60.dll".
>
> Adding error handling to everywhere in your code helps in finding where
the
> problem is. You probably have error handling in places where you expect
the
> errors to be, but in this case it was not enough.
>
>
> "Someone" <nob***@cox.net> wrote in message
> news:eQB6c$p0FHA.3856@tk2msftngp13.phx.gbl...
> >> So the $64K question is: what XP component would be used to handle
string
> >> functions?
> >
> > MSVBVM60.DLL
> >
> > Add error handling to your code. Here is how to show which routine and
> > line if you can't run the IDE in the target system.
> >
> > - Download and install MZTools:
> >
> > http://www.mztools.com/v3/mztools3.htm
> >
> > - Go to MZTools Options|Error Handler, and paste the following(unwrap as
> > needed):
> >
> >    On Error GoTo {PROCEDURE_NAME}_Error
> >
> > {PROCEDURE_BODY}
> >
> > ExitMe:
> >    On Error GoTo 0
> >    Exit {PROCEDURE_TYPE}
> >
> > {PROCEDURE_NAME}_Error:
> >
> >    MsgBox "{MODULE_NAME}:{PROCEDURE_NAME}:" & ErL & vbCrLf & "Error " &
> > Err.Number & ": " & Err.Description
> >    Resume ExitMe
> >
> > - The above would show a message like:
> >
> > Form1:Form_Load:110
> > Error 5: Invalid procedure call or argument
> >
> > - Backup your source files in case you want to remove these additions
> > quickly.
> >
> > - Go to every form and routine and add an error handler by clicking on
the
> > icon on the tool bar. Add line numbers to each routines as well, which
is
> > another button in MZTools toolbar.
> >
> >
> >
> >
> > "DPM" <d*@junk.com> wrote in message
> > news:u63MXvp0FHA.3336@TK2MSFTNGP12.phx.gbl...
> >> Hello,
> >>
> >> We've written an application in VB6 we intend to run on XP SP1
embedded.
> >> We
> >> compile the application and package it.  If we install and run it on XP
> >> pro
> >> SP1 it runs correctly, but on XPe we get a "Runtime error 5" (invalid
> >> procedure call or argument).  We've isolated to a string function
(LEFT,
> >> MID, RIGHT or INSTR).  Curiously, if we build the XP Pro emulation on
> >> embedded we don't see the problem, so we can only assume that we're
> >> missing
> >> a component.
> >>
> >> So the $64K question is: what XP component would be used to handle
string
> >> functions?  It must be part of the basic OS if the VB6 packager does
not
> >> include it.  Is there a tool we could use to isolate the dll or control
> >> that
> >> does string management?
> >>
> >> Any help appreciated.  Thanks.
> >> --
> >> Regards,
> >> Dean
> >>
> >>
> >
> >
>
>
Author
17 Oct 2005 12:01 PM
Phill. W
"DPM" <d*@junk.com> wrote in message
news:u63MXvp0FHA.3336@TK2MSFTNGP12.phx.gbl...

> We've written an application in VB6 we intend to run on XP SP1
> embedded.  We compile the application and package it.  If we
> install and run it on XP pro SP1 it runs correctly, but on XPe we
> get a "Runtime error 5" (invalid procedure call or argument).
> We've isolated to a string function (LEFT, MID, RIGHT or INSTR).

that fact that you're getting Runtime Error #5 rather than some more
nasty (like a memory violation) suggests that your VB code is failing,
rather than anything that might be "underpinning" it.

Are you searching a string read from the operating system based on
some delimiter and then using this result to "slice up" the string?  as in

i = Instr( sFromSystem, "-" )
sPrefix = Left$( sFromSystem, i - 1 )

If the given delimiter /doesn't/ appear in the string, the above will fail
(because you can't index into a string from position -1).

HTH,
    Phill  W.