How can i get IApplication object.

524
1
05-28-2014 10:06 PM
Danieldai
New Contributor
hello,everyone:
How can i get IApplication object,i use c#
my class extends the ESRI.ArcGIS.ADF.BaseClasses.BaseCommand.
i use the way below in the OnCreate(object hook) method;
when i use:
IApplication pApplication = hook  as IApplication;
the pApplication will be null.
and when i use:
IApplication pApplication = (IApplication)hook;
will throw exception, the hook object cannot convert to IApplication;

How can i get IApplication object,someone who can help me,very thank you.
0 Kudos
1 Reply
ThomasEmge
Esri Contributor
The hook will be in reference to what or who is hosting the command. It could be IApplication for desktop applications or IHookHelper for Engine toolbar controls.

- Thomas
0 Kudos