Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using MM Business Objects in a COM wrapper C# dll
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01125274
Message ID:
01126491
Vues:
23
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform