Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM Errors

Status
Not open for further replies.

wbehning

Programmer
Nov 14, 2001
47
US
I am designing an application that can be run normally or as
a com object. I want to make sure that no dialogs can appear while running as a com object. Obviously, I need to be aware of using funcitons like MessageBox() and the like. I also need to prevent system dialogs from appearing, such as an unhandled error.

I know this has probably already been answered, but can anyone give me the article or suggest what settings I should be aware of?


=CREATEOBJECT("goComTest")
DEFINE CLASS gocomTest as custom OLEPUBLIC
cMessage = "None"
Procedure init as Boolean
this.cMessage = "Init"
EndProc

Procedure testerror as Boolean
Local llRetVal
llRetVal = .t.

Try
tis.cMessage = "Test"
Catch
llRetVal = .f.
this.cMessage = Message()
EndTry

Return llRetVal

EndProc
enddefine

 
If it's compiled as a DLL, you can't have any UI...period. In fact, much of it is automatically handled for you. You also can't use reports, as they try to display a "Printing" dialog.

If you have an EXE, then UI is allowed.

If the intent is to run the COM component on a server, then you don't want any UI at all.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top