Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using MM Business Objects in a COM wrapper C# dll
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01125274
Message ID:
01126491
Views:
21
Mike,

>I have a COM exposed method that is being called successfully from Visual FoxPro. I have added a business object based upon several tables in my MS SQL Server database. When I try to do anything that connects to the data I get an exception with this Message:
>
>Object reference not set to an instance of an object.

We solved this problem with you off line, but for the benefit of posterity, I'll post the answer here.

In order to instantiate business objects from a COM server, outside the context of a .NET Windows Forms or Web Forms application, you must instantiate an instance of the factory before instantiating any business objects. In this case we just used added a line of code that instantiates the AAppTest object:
AAppTest AT = new AAppTest();
The constructor of AAppTest instantiates a factory object and all is well!

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform