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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB EXE calling DLL repeatedly-Invalid Procedure Call

Status
Not open for further replies.

ClarkJeff

Programmer
Feb 28, 2002
46
0
0
US
Help! On Winows 2000 Advanced server, I have a VB6 EXE that can repeatedly call a DLL. The DLL is in COM+ and I can see the object working. If the EXE is repeatedly calling the DLL AND I have another process call that same DLL, I can see the Objects counter increment/decrement, but the EXE yields an error "5-Invallid procedure call or argument" on the (next?) CreateObject. It seems to run ok if the second call isn't made while it's processing.

The EXE is a task that wakes up every minute looking for batch-type work to do. When it finds something to do, it calls the DLL. The DLL is also call from a Web ASP.

I've tried using ObjectContext, thinking maybe it wasn't creating/deleting objects properly, but it doesn't seem to help.

The call to the DLL is currently using a Long and Strings. I think I read to use Variants instead, but the COM+ object count never goes back to 0 when doing that for some reason. The Call Time resets back to 0, but the Object Count doesn't.

After receiving a number of the errors, the process seems to hang and won't work anymore. I currently get around the problem by manually Shutting Down the COM+ Application occassionally during the day. I've also thoroughly checked for memory leaks (missing set x=nothing, etc.)

Below are some snippets of code. Any help is greatly appreciated.

The DLL is set to 5-MultiUse, 1-NoTransactions, 0-NotPersistable.


DLL Code (TestDLL.clsTestDLL)
-----------------------------------------------------------
...
Private objContext As ObjectContext
...
Public Function Submit(strFirmID As String, lngReportHistoryID As Long, Optional strChildAccountNo As String) As String
...
working code here
...
set objContext=GetObjectContext()
if lngErrorNumber=0 Then
objContext.SetComplete
else
objContext.SetAbort
end if
...


EXE Code (TestEXE.EXE)
-----------------------------------------------------------
...
Private objProcessReport As TestDLL.clsTestDLL
...
Set objProcessReport=CreateObject("TestDLL.clsTestDLL")
...
strFile=objProcessReport.Submit(rstSites.Fields("FirmID"), rstReportHistory.Fields("cntID"), rstGroupAccount.Fields("AccountNo"))
Set objProcessReport=Nothing
...


Thanks!

Jeff Clark
 
Update...
It appears to only happen when I use the .Export method (which is always :)

...
crxExportOptions.FormatType = crEFTPortableDocFormat
crxExportOptions.PDFExportAllPages = True
...
crxReport.Export False 'comment out and no errors
...

Anyone? Any clues?

Thanks.

Jeff Clark
 
Sorry, I didn't mention that the DLL makes calls to Crystal Reports RDC. It appears to be a problem in Crystal Reports. I'll check on their website and post a message in the appropriate forum.

Thanks.

Jeff Clark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top