Microsoft Store Operations POS: Attempt to process COM object 'ObjectName' failed. An unknown error ocurred.

Jun 11, 2008 2 Replies

I have a program that gets executed in POS. Occasionally POS closes that program in the midle of execution; after trying to restart it the error message shows "Attempt to process COM object 'ObjectName' failed. An unknown error occurred." I am invoking this program from Custom POS Button. Here is entry code. The exception below is never executed.



namespace FrameWiz { [ComVisible(true)] public class Startup { public bool Process(object argSession) { FrameWizShell frameWizShell = null; Session mySession = null;



try { //mine code here



return true; } catch(Exception) { throw; } finally { frameWizShell.Dispose(); mySession.Destroy(); } } } }


Two biggy problems with this code. One, you should never catch an exception if you do nothing with it. Either get rid of your catch, or use it (log, or pop up a message box). Two, don't destroy your session. By doing this you are probably hurting rms. Unless you explicitly created the session object (which you did not, RMS passed it to you), you should not destroy it. Just my $.02.

Thank you for your response. I am aware of problems described. I just added try, catch, finally statement recently after getting this error for a while and I added code to destroy Session just before posting this message. I have been getting this error for a while now on number of computers and was not able to fix it. I cannot debug this neither because the error occurs on some of the clients computers. I was not able to replicate it on my computer so far. Bottom line without try, catch, finally, disposing, or destroying any object the POS occasionally closes down my program.

Regards

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required