Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

app runs in vb environment but not as an exe

Status
Not open for further replies.

Galyl

Programmer
Nov 21, 2001
16
0
0
ZA
Ive written an app in vb6, in runs perfectly in the vb environment, but when i compile it i get the following error:
Run-time error '5':
Invalid procedure call or argument

this error occurs after a call to a C dll. The dll gets initialised, it retrieves the data it is supposed to from the com port, but when it sends a return code to my vb app, the error occurs.

It runs perfectly in VB. Does anyone have any idea why this happens?

Thanks for your time

 
When ever this happens to me. I always discover a call or statement that some how was placed in the gerneal declarations portion of my code instead of within an event. And it doesn't show up til compile time. You may want to check that

JMTC
Scoty ::) "Learn from others' mistakes. You could not live long enough to make them all yourself."
-- Hyman George Rickover (1900-86),
 
Private Declare Function BcpSend Lib "vc2vb.dll" (ByVal cmd As Integer, ByVal address As Byte) As Byte

this is the only statement with regard to the dll in my general declarations section.

This is the line of code i use in a sub called InitLog()

iRet = BcpSend(151, iaddr)

that is the only places where it gets mentioned.

Thanks for replying
 
I don't see your End Function Statement. Do you have one? Just something to check for

jmtc
Scoty ::) "Learn from others' mistakes. You could not live long enough to make them all yourself."
-- Hyman George Rickover (1900-86),
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top