Options

RTC Blocked with BrowseForFolder method (WindowsShell)

Pedro_IñiguezPedro_Iñiguez Member Posts: 7
edited 2011-06-22 in NAV Three Tier
Hi,

We've a problem with the execution of "Microsoft Shell Controls And Automation"'s method (BrowseforFolder) in RTC. I call this function on trigger onassistedit of Request page report. When I try push [...] of request page the client becomes blocked.

The Code in my codeunit is:


WindowsShell Automation 'Microsoft Shell Controls And Automation'.Shell
ActiveWindow Automation 'C/SIDE Utility Classes'.ActiveWindow

CLEAR(WindowsShell);
CLEAR(ActiveWindow);

IF ISCLEAR(WindowsShell) THEN
BEGIN
IF NOT ISSERVICETIER THEN
CREATE(WindowsShell)
ELSE
BEGIN
CREATE(WindowsShell,TRUE,FALSE);
END;
END;

IF ISCLEAR(ActiveWindow) THEN
BEGIN
IF NOT ISSERVICETIER THEN
CREATE(ActiveWindow)
ELSE
BEGIN
CREATE(ActiveWindow,TRUE,FALSE);
END;
END;

SelectedFolder := WindowsShell.BrowseForFolder(ActiveWindow.Handle,
Title, BIF_RETURNONLYFSDIRS, Root); //Here the execution blocks the client

IF NOT ISCLEAR(SelectedFolder) THEN BEGIN
FolderItem := SelectedFolder.Self;
EXIT(FolderItem.Path);
END;



Thanks for the help.

Comments

  • Options
    kinekine Member Posts: 12,562
    The last parameter of CREATE must be TRUE because you need to instantiate the class on client, not on server... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    Pedro_IñiguezPedro_Iñiguez Member Posts: 7
    Thanks for the help Kine, It's working now.
  • Options
    bhalpinbhalpin Member Posts: 309
    Exactly the answer I was looking for! But ...

    When creating the variable ActiveWindow I can't see an Automation Server listed for 'C/SIDE Utility Classes'.

    Am I missing something?

    Thanks!
  • Options
    kinekine Member Posts: 12,562
    May be the automation is not registered on your PC? ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    bhalpinbhalpin Member Posts: 309
    Yes. Probably.

    And how does one go about registering it?
Sign In or Register to comment.