Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Run-Time Error '5' invalid procedure or argument

Posted on 2002-06-13
41
22,300 Views
Last Modified: 2011-08-18
A fellow Moderator here created an excellent tool for the Mod team which helps us quickly query the database and find open and locked questions at a userid level so we can post scripts and begin the follow-up process in the cleanup effort.  He is unavailable for a while and I need some help quickly, so your "comments" are appreciated very much.

The API worked flawlessly until I upgraded from W98SE to Windows XP.  I've modified the registry, moved pertinent .ocx files to the proper directory, downloaded VB6 SP5 runtime and installed it, yet the problem persists.  I also modified the API (exe) to run in Windows 98 Compatibility mode, but nothing has fixed the problems I list below:

Query the database (uses Power Search) for MemberIDs I know have open Qs, but the results return as zero found, that's problem one.

Query the database for PAQ items, get results, but can't access; get an immediate response saying:
"Run-Time error '5':  Invalid procedure call or argument"
Then the application shuts down.

Found many hits and bugs by others searching MSDN and MS, most said this was a bug in VB5, fixed in VB6.  Since I updated my VB runtime, should have been fixed (one would think), but apparently not.

Thanks for your helpful comments.

Moondancer - EE Moderator
0
Comment
Question by:Moondancer
  • 18
  • 15
  • 4
  • +3
41 Comments
 
LVL 1

Author Comment

by:Moondancer
ID: 7076836
I did find this on the Net, saying:
If you are getting "runttime error 5" "invalid procedure call or argument" and you are running Windows XP. You need this file riched32.dll (right click on the file name and choose "Save target as") and place them in your Windows system folder (usually C:\WINDOWS\SYSTEM).

But can't save it; try saving target as and only get the option to save register.htm
0
 
LVL 15

Expert Comment

by:ameba
ID: 7076841
http:Q.20294299.html
andreouellet solved problem by adding DoEvents before SetFocus:

>But with the line "DoEvents" before the line "cmbRapport.SetFocus" the problem disappear

          DoEvents    'Problem disappear ???
          cmbRapport.SetFocus
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7076843
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/CommCtls/richedit/richeditcontrols/aboutricheditcontrols.asp

This MSDN link shows that Windows XP already has riched32.dll... but still the problem persists.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:Moondancer
ID: 7076855
Hi, Bruno, thanks a bunch.

Sorry to be dense, but I know little to nothing about VB and VB Controls.  Does this mean I have to recode and recompile?  If so, I'm clueless.

I'll check the Q you list above.
0
 
LVL 15

Expert Comment

by:ameba
ID: 7076859
There are many possible causes for that error - without code you cannot do much.

>Query the database (uses Power Search) for MemberIDs I know have open Qs, but the results return as
zero found

I tried Power Search today and it doesn't work:
search for "button" (which is mentioned very often, btw) in VB topic area, in last 180 days and there were 0 matches.
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7076863
True, Power Search results have been intermittent.  But I only used queries that I manually tested in realtime first for userIDs that returned results but the API returns none.  Maybe it's a Power Search problem.

I then tried the query for PAQ for Moondancer, and since I have over 3,000 in my PAQ, the screen did begin to produce visible results but then returned this error 5.  Do you suppose that the error could result just due to sheer volumes trying to be handled?

I'm truly baffled and most appreciative of your help.

I have the EXE, is that what I'd try to modify?  Remember, I'm clueless on the programming side of things.

:) Moondancer - EE Moderator
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7076866
Could the runtime 5 error ever be a 'time out' kind of event?
0
 
LVL 15

Accepted Solution

by:
ameba earned 300 total points
ID: 7076878
You cannot modify EXE, you must have source code.

Or you can tell me what app does:
you enter username and it gives open questions? In which format?
Or does it automatically post something to each question?
0
 
LVL 15

Expert Comment

by:ameba
ID: 7076881
>Could the runtime 5 error ever be a 'time out' kind of event?
It can be anything.
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7076895
Also moved a key .ocx files into the windows directory, and found the same file in the windows\system32 directory, could that be a problem?
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7076898
I'm getting ZERO notifs, Engineering advised, so watching this Q realtime.  Closed it so we can keep this streamlined and work on it together with minimum disruption.

It can autopost the Abandoner script, the function was included, but I'm only using it in basic mode now.  What it does is logs me in as a Moderator to access the Administrative functions.  Once logged in there is an OpenQ exe and the other for PAQs.  The only one I critically need (until Tuvok returns) is the OpenQ function.  I key in the Member ID and say GO... the API invokes Power Search for all Open and Locked Questions for that Member ID and imports the results into the API where I can then take direction actions to close the items.  That part is "broken", it never pulls in any results, and I do not get a runtime 5 error for that, I just get zero results (no open questions), which is in error.

Sorry for the confusion here, but I thought the PAQ module runtime error 5 "may" play a part in the empty results on the OpenQ module.

Let me know what else I should be telling you.  Or should I send you the ZIP file of the API package, would that help?

Thanks so much.
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7076899
BTW, I do have riched32.dll in the windows\system directory, and it is version 5.1.2600 Wrapper Dll for Richedit 1.0
0
 
LVL 15

Expert Comment

by:ameba
ID: 7076904
I don't think you can do anything without source - if any OCX is missing you'll get different error.

The programmer must find the line and procedure which gives the error...

Thanks for the grade  :-)

It seems app does more than just reading open and locked questions.
I can read/parse profile, and output those questions, but it seems that is only part of the story...

And I'm not moderator, so API's wouldn't work, I think...
0
 
LVL 15

Expert Comment

by:ameba
ID: 7076914
My e-mail is in my profile, I can have a look if you send me something...
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7076923
Thank you, sending now.
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7076934
It is an incredibly excellent API and tuvok put tons of creative energy and work into designing it for us, I was the official tester. It does so much more than I can even begin to relate, I am the idea person and 100% clueless about the complexity and magic that Tuvok worked to bring the tool into being.  He is always and has always been there for me when I encounter roadblocks, but this roadblock has been here for me since I upgraded and my productivity is seriously degraded.  If he were available, he'd have fixed it for me without a doubt, as he's fixed others before.  I appreciate your help very much, and wish I could tell you more of the details.  Hopefully he'll return soon and see my pleading Email and this link.
0
 
LVL 15

Expert Comment

by:ameba
ID: 7076942
Thanks, I'm receiving it... I'll check it and see if I can do something...
0
 
LVL 15

Expert Comment

by:ameba
ID: 7077056
I extracted one zip file (there are other files, but utility to extract from "tnef" doesn't work good) and installed ModTools.

I'm also receiving Run-Time error '5', so it has nothing to do with XP.  I think format of the page with search results changed, and program cannot parse/read that page.

My program also stopped working last week because of changed links.
It will be simple for programmer to change program to recognize underscore in question links.
0
 
LVL 15

Expert Comment

by:ameba
ID: 7077296
Summary:

Links have been changed on 5 (or 6) June 2002
Before, we had dot "." between Q and question number, e.g. Q.20311459.html
Now, it's underscore "_" e.g. Q_20311459.html

I changed my program QuickPost, to read question lists with new links, in 30 minutes.
Tuvok will have to do the same with his program.

--------------------
Moving files riched32.dll or some OCX-es to different directory won't help.
--------------------
It has nothing to do with XP, since the same problem "Runtime error 5" is on my Win95 system.
So, going back to Win98 from XP won't help.
--------------------

I cannot change Tuvok's program, because I do not have source code.

--------------------
I can create new program which can read PAQs or opened and locked questions.
But, this is not useful for you - since you need automatic posting, and that (automatic posting) is the part which I didn't try and I would need time to create/test that functionality.
--------------------
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7078109
YOu've done plenty by helping me understand the programming changes to the QID format (wish I misssed completely), and thank you very much.  You more than earned these points.  I'll send this link to Tuvok and, again, thank you.

:) Moondancer - EE Moderator
0
 
LVL 15

Expert Comment

by:ameba
ID: 7078115
Thanks again for the points and grade!

Bruno
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7079046
Thanks to you, Bruno for all your help over and above "the call of duty", so to speak.

I'm still getting no Email notifs, quite frustrating.

But smiling anyway.

:)
0
 

Expert Comment

by:Tuvok
ID: 7083207
Hi guys!

Bruno, thanks for covering for me ;-)

The format of the search page is changed, as Bruno suggested. Since ModTools still is in beta version, I did not include all error handling.
This is an easy fix. Hope to come to it within a couple of days. But as you know Moonie, I don't have internet access all the time ... :(

Live long and prosper.
Best regards my friends,
Tuvok
0
 
LVL 15

Expert Comment

by:ameba
ID: 7083258
Thanks, Tuvok.  It's a nice and useful program.  Good work!

Bruno
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7083881
I LOVE IT!  Thank you thank you thank you.

Still no fix for the Moondancer@experts-exchange.com notifs (since 6/12), and many have since been purged.  Very sad.

Oh well, as always, I'm in deepest appreciation mode to you both.

Tuvok's tool is the most excellent tool I've used (API) in all the years I've used APIs to automate redundant processes, and he's been here for me in all regards to fix things and/or further enhance the program.  I just can't find enough words of praise and appreciation for all that he has done for our team here.

:) Moondancer - EE Moderator
0
 

Expert Comment

by:Tuvok
ID: 7085750
:"> Thanks Moonie! I'm blushing!

Bruno, if you like, you can have the source code.
Just mail me.... You know my addy (just look in the help of ModTools).

T

0
 
LVL 1

Author Comment

by:Moondancer
ID: 7091075
COOL, great.  Blushing is good.  ;)
Finally got Email from 6/17 onward, prior time, gone (so far).  Boo hoo.
Thanks,
Moondancer - EE Moderator
0
 
LVL 15

Expert Comment

by:ameba
ID: 7092336
Thanks, Tuvok.
If the tool isn't updated yet, I can try updating it to new type of links - in that case, please, send me the source;  my e-mail is in my profile, or I think it's also in you address book (as Bruno Paris)
0
 

Expert Comment

by:Tuvok
ID: 7092346
Bruno, I will send you the source a.s.a.p.
(indeed I have your personnal addy...)

I know you can fix it also. Thanks!

T
0
 
LVL 15

Expert Comment

by:ameba
ID: 7092432
OK. Thank you!
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7092505
HUGS and thanks. :)
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7101571
Hi, ameba.

I know Tuvok has had Internet access roadblocks, and probably why you haven't yet received the source code.

Moondancer - EE Moderator
0
 
LVL 15

Expert Comment

by:ameba
ID: 7101965
OK.  No problem.  :-)
0
 
LVL 15

Expert Comment

by:ameba
ID: 7107705
Hi, all
I received source files and changed "Q." to "Q_" and it seems reading now works.

I don't know if any other function is not working...

Exe file (zipped) sent to Moondancer for test...
0
 

Expert Comment

by:Tuvok
ID: 7109781
Great!
Thanks Bruno!!

T
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7110224
Thank you so much, Tuvok and ameba.  Works fine, no problems; we love Tuvok's tool, it makes our productivity so much better.  Your help in dealing with the reformatted URL "roadblock" is appreciated, and thanks very much to Tuvok for sharing his code.

Sent it to our entire team and we're all grateful.

:) Moondancer - EE Moderator
0
 
LVL 1

Author Comment

by:Moondancer
ID: 7127623
Moondancer is leaving as a Moderator effective today and all Moondancer Email will be forwarded to others effective tomorrow.
It's been great, thanks for all the help and support.
:) Moondancer - EE Moderator
0
 

Expert Comment

by:BobJacobson
ID: 7713194
I have had the same problem with one of my apps, it turned out to be a simple little problem with a message box routine.  

Dim Response

Response = msgbox("Are you sure you want to format your hard drive?", vbOKCancel, "WARNING")



It was crashing before the message box.  I added the full variable type and it fixed the problem.  It worked fine when running from within VB, but once compiled, it didn't like it.

Dim Response As VbMsgBoxResult

Hope this may help...
0
 

Expert Comment

by:BobJacobson
ID: 7800947
I am also having problems with the runtime error 5 messages.  It works on some machines and not others even though they are the same OS's. I am trying to track it down myself.  I do know that I fixed one of the messages by actually DIMming a variable without a variant type.

Example:

  I had dimmed a variable for a message box response like this:

Dim Response

I added the extra "As VbMsgBoxResult", to read:

Dim Response As VbMsgBoxResult

This fixed the problem! This other way has worked for quite sometime.  I hope this helps. I am now dealing with the same issue on a UserID.SetFocus command on a form.  It worked all of the time, now that I added some other controls to the project, it seems to be acting up.

Can anyone shed anymore light on this situation?

               Bob
0
 
LVL 12

Expert Comment

by:roverm
ID: 7801307
Hi Bob,

The runtime error 5 in the situation Moonie had, didn't have anything to do with programming errors orso.
It was just a change in the URL that ModTools tried to reach and that caused the error.

The error you are getting now could be that the SetFocus method is called to early, for instance in the FormLoad event.
Try calling it in the Form_Activate event.

D'Mzzl!
RoverM
0
 

Expert Comment

by:MSeitz
ID: 8493782
I just had the same problem, and am a little embarrassed at what I found: The message box generates a form_paint event (I don't know if matters that the msgbox obscures part of the form or not). If there are any '.setfocus' instructions in the paint procedure, these will generate an error, since the focus is simultaneously being assigned to the msgbox and a control in the form, or the form itself.

I hope this helps you.

regards,
Markus
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question