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
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:u63MXvp0...@TK2MSFTNGP12.phx.gbl...
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...@tk2msftngp13.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.
Thanks for your suggestions.
Dean
"Someone" <nob...@cox.net> wrote in message
news:eOiVyNq0...@TK2MSFTNGP15.phx.gbl...