Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Pure Virtual function called error
Satadru
Hi guys,
The tool that I'm currently working on throws the following error : Microsoft VC++ runtime error. R6205 Pure Virtual function called.
The error is random and is not specific to a particular call. The details of the environment is as follows :
1. Targeted .Net framework : 2.0
2. OS : WIN XP, SP3
3. Dependent DLLs : IManage.dll Ver. 8.2
Microsoft.Office.Interop.Excel.dll
Microsoft.Office.Interop.Outlook.dll
Microsoft.Office.Interop.Powerpoint.dll
Microsoft.Office.Interop.Word.dll
Office.dll
It'd be great if any one give me any pointers to the resolution of the defect.
Thanks
Sat
Find more posts tagged with
Comments
rapperson
Sat,
We have been dealing with this same issue for a very long time when using the imanage API. We are using COM interop via VB.NET, and the error occurs sporadically -- it causes the entire application to terminate after you click 'OK' on the error dialog.
A lot of ad hoc research on this has led me to the only "solution" I could find, which is not really a solution at all because it has only diminished the frequency of the error. This "solution" involves a LOT of extra messy code within your project; it is very painful and would otherwise be considered bad programming if it weren't the only option. Here it is:
you have to create explicit references for every COM (imanage) object you use, and you have to release those objects when you're done with them. For example, say you want to find out which user currently has a document locked, and you know the document's number and version. To do this, you would typically create an ImanProfileSearchParameters object by calling the 'CreateProfileSearchParameters' method of the IManDMS class. Then you would perform a search for the document by calling the 'SearchDocuments' method of the ImanDatabase object, and then you'd get the document by referencing the first element in the returned collection (the collection is an ImanContents object, and the document is an IManContent object that can be cast into an IManDocument object). Once you have the document, you'd reference its 'InUseBy' property which returns a ImanUser object. So you have the following COM objects: IManProfileSearchParameters, ImanContents, ImanDocument, and ImanUser. What I'm saying is that each of these needs to have an explicit reference, and you must release the COM reference when you're done with them (at the end of the method, typically) and perform a garbage collection after that.
So, I'd do this (given the above example, and assuming you have a global explicit reference already to the IManDMS object called 'objDMS' and the ImanDatabase object called 'objDB'):
Dim objSearchParams as IManProfileSearchParameters = objDMS.CreateProfileSearchParameters()
objSearchParams.Add(imProfileAttributeID.imProfileDocNum, CStr(FromDocNum))
objSearchParams.Add(imProfileAttributeID.imProfileVersion, CStr(FromDocVersion))
Dim objSearchResults As ImanContents = objDB.SearchDocuments(objSearchParams, True)
Dim objDoc As ImanDocument = DirectCast(objSearchResults.ItemByIndex(1), ImanDocument)
Dim objUser As ImanUser = objDoc.InUseBy
Dim strReturnValue As String = objUser.Name
Marshal.ReleaseComObject(objSearchParams)
Marshal.ReleaseComObject(objSearchResults)
Marshal.ReleaseComObject(objDoc)
Marshal.ReleaseComObject(objUser)
System.GC.Collect
Return strReturnValue
I hope this helps.
LinkToImage.rptdesign
LinkToImage.pdf