mravichandran

ICommabdBars::Find, ::Create, ICommand::Add - vb.NET failing in some workstations.

Discussion created by mravichandran on Dec 15, 2010
Latest reply on Dec 15, 2010 by mravichandran
Dear Readers,

An IToolbar based application with a bunch of ICommand and ITool implementation is ready for deployment. for customer requirements, we have a class 'MouseFunctions.vb' class that overrides a few functions in a minimal way.

In my debug session, it works like a charm (granted i am an administrator of the workstation) - program coordinator was able to test it from a net meeting session.

when deployed to workstations on which users have smaller privileges, it is failing. in the net meeting session, i could not view the registry to verify the existence of the entry needed as the local user did not have enough privileges to view registry contents.

since this app will be deployed nationwide, requesting power user status for those users on those workstation might not FLY with the ITS dept.

any input in this matter will be appreciated.

thanks and regards
Ravi.

this function is using MouseFunctions (attached vb.txt file) class as follows:

PrivateFunction SetUpMouseFunctions(ByVal pMxDoc As IMxDocument) AsBoolean
'This routine initializes the mouse tools contained in MouseFunctions.
Dim pUID AsNew UID
Dim pDocument As IDocument
Dim pCommandBar As ICommandBar
Dim pCommandBars As ICommandBars
Dim pCommandItem As ICommandItem
pDocument = pMxDoc
Try
pUID.Value = "GNTToolbar.MouseFunctions"
pCommandBars = pDocument.CommandBars
pCommandItem = pCommandBars.Find(pUID)
If pCommandItem IsNothingThen
pCommandBar = pCommandBars.Create("MouseFunctions", esriCmdBarType.esriCmdBarTypeToolbar)
pCommandItem = pCommandBar.Add(pUID)
pCommandBar.Dock(esriDockFlags.esriDockHide)
EndIf
bMouseSetup = True
ReturnTrue
Catch ex As Exception
MsgBox("Problem setting up mouse functions: " + ex.Message)
ReturnFalse
EndTry

EndFunction



Attachments

Outcomes