Microsoft KB Archive/107771

= PC Forms: Err Msg: Illegal Function Call =

Article ID: 107771

Article Last Modified on 10/30/2006

-

APPLIES TO

 Microsoft Exchange Electronic Forms Designer 5.0, when used with:  Microsoft Mail for PC Networks 3.0

 Microsoft Mail for PC Networks 3.0b

 Microsoft Mail for PC Networks 3.2 

-

<div class="notice_section">

This article was previously published under Q107771

<div class="symptoms_section">

SYMPTOMS
When you choose the Select E-Form command from the Mail menu of versions 3.0, 3.0b, or 3.2 of Microsoft Mail for Windows, you may receive the following error message:

Illegal Function Call

You may also receive this error message when you select the Route command in Microsoft Word or Excel.

<div class="cause_section">

CAUSE
This error sometimes indicates that a universal naming convention (UNC) path is defined for the SharedExtensionsDir in the MSMAIL.INI file. The Browser application code that parses a UNC shared extensions path may fail if the UNC path does not contain a backslash (\) as the last character in its definition. For example, the following MSMAIL.INI entry may generate the above error: <pre class="fixed_text">  SharedExtensionsDir=\\servername\share

<div class="resolution_section">

RESOLUTION
To solve the problem, add a "\" to the end of the path definition: <pre class="fixed_text">  SharedExtensionsDir=\\servername\share\

<div class="moreinformation_section">

MORE INFORMATION
You can also solve this problem by modifying the Browser application code that handles UNC paths. To do so: <ol> Open the BROWSER.MAK project in Visual Basic (VB\EFORMS\MEFBROWS).</li> From the Project window, select BROWSER.FRM. Click the View Code button.</li> From the Proc: list box, select fConnectShared.</li>  Modify the code as follows: If Left(szSharedDir, 2) = "\\" Then ' Handle UNC path and obtain connection substring length ' Ensure that the path doesn't end in a trailing slash If (Right(szSharedDir, 1) = "\") Then szSharedDir = Left(szSharedDir, Len(szSharedDir) - 1) End If        iShare = InStr(3, szSharedDir, "\") iPath = Len(szSharedDir)

' see if a connection already exists szNetDrive = SzExistingConnection(Left(szSharedDir, iPath))

If szNetDrive = "" Then ' No previous connection exists, find a free drive letter szNetDrive = GetFreeDrive ' and connect if a drive is free If szNetDrive = "" Then ' No free drive is available to connect FConnectShared = False Exit Function ElseIf WNetAddConnection(Left(szSharedDir, iPath), "",     szNetDrive) <> 0 Then ' Connection failed FConnectShared = False Exit Function End If        End If         szSharedDir = szNetDrive & Right(szSharedDir,      Len(szSharedDir) - iPath) End If </li></ol>

NOTE: Code that wraps to a new line here should be entered on the same line in Visual Basic. Also, this is not the most streamlined code for this procedure, it requires the fewest changes from the original.
 * 1) Choose Make .EXE File from the File menu and replace the existing MEFBROWS.EXE in the WINDOWS subdirectory.

Additional query words: 3.00 3.00b 3.20

Keywords: KB107771

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.