Attempt to execute COM object failed. Help!

Apr 20, 2009 1 Replies

Working on my first customization for RMS, so hopefully I'm not asking completely stupid questions... I've searched here for a point in the right direction but didn't find anything that helped. I'm sure it's something trivial. We have a developer engaged to do a number of things, so this is more for my own knowledge of how this works and what capabilities we have.



Anyways, here goes:



RMS v2.0, all patches applied. VS 2008, developing in vb.NET POS is installed on the same machine as VS if it makes a difference.



I've created a simple class which displays a form and waits for the user to click "OK", which then closes the form.



The root namespace is LSGPFunctions and I've created a class called AgeCheckClass, with a single function Process().



I eventually will run this through a hook, but for now just trying it via custom buttons.



The custom button is setup as COM Object (Session Object) with the command LSGPFunctions.AgeCheckClass.



I open POS, click the button, and I get the message:



"Attempt to execute COM object 'LSGPFunction.AgeCheckClass' failed. Could not create object.



I've tried some of the more obvious things -- change to windows form and the app runs as expected, tried recompiling and reregistering the DLL, changing names, verifying root namespace, etc.



Any help would be much appreciated, or if there's something else that would help with the diagnosis, please let me know.



Thx



Garrett


-------------------------------------


##-----------------------------------------------# Newsgroup Access Courtesy

formatting link
Tax and Accounting Software Forum Web and RSS access to your favorite newsgroup - microsoft.public.pos - 37295 messages and counting ##-----------------------------------------------##


jrat had written this in response to

formatting link
: Sorry, found the issue after doing some more searching.

As a few others had the same question, all I needed to do was turn on "Register for COM interop" on the Compile page of the project properties. It triggers two build warnings but seems to fix the issue.

Thx

G

------------------------------------- jrat wrote:

##-----------------------------------------------## Newsgroup Access Courtesy

formatting link
Tax and Accounting Software ForumsWeb and RSS access to your favorite newsgroup - microsoft.public.pos - 37297 messages and counting! ##-----------------------------------------------##

Join the Discussion

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

Didn't find your answer?

Ask the community — no account required