Hi,
I've created a Windows 7 application that integrates with GW7.x and higher.
The application is a C# Windows Forms application using .NET 3.5 . With any
version of GW, I am getting the attached error message and the application
crashes.
The error occurs when I access the address property of the FolderRights
object. To reproduce the error, create a personal folder and share it with a
couple of people in the GroupWise system address book. Once done, run the
code below and it will crash with the error below and the screen capture
I've attached.
The details of the crash have been included. Below the details, I have
included the sample code that produces the error. I would appreciate some
direction on this.
Thanks
Tim
**********************************BEGIN ERROR DETAILS
****************************************
Problem signature:
Problem Event Name: APPCRASH
Application Name: SageSoftSolutions.GroupWise.Wizard.vshost.exe
Application Version: 10.0.30319.1
Application Timestamp: 4ba2084b
Fault Module Name: StackHash_2374
Fault Module Version: 6.1.7600.16695
Fault Module Timestamp: 4cc7ab86
Exception Code: c0000374
Exception Offset: 000cea27
OS Version: 6.1.7600.2.0.0.256.48
Locale ID: 1033
Additional Information 1: 2374
Additional Information 2: 2374e92e674ab518ce7b17d1ec740d25
Additional Information 3: d043
Additional Information 4: d043f5f65ddc950e74ffd27eb5c8952d
Read our privacy statement online:
http://go.microsoft.com/fwlink/?link...8&clcid=0x0409
If the online privacy statement is not available, please read our privacy
statement offline:
C:\Windows\system32\en-US\erofflps.txt
**********************************END ERROR DETAILS
****************************************
**********************************BEGIN SAMPLE CODE
****************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GWLibrary = GroupwareTypeLibrary;
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
private GWLibrary.Application5 m_groupWise = null;
private GWLibrary.Account8 m_account = null;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.m_groupWise = new GWLibrary.Application5();
this.m_groupWise.MultiLoginAddressBookSupport = false;
}
private bool Login(string user, string password, string cmdLine)
{
try
{
//
// login and save GroupWise account object
//
m_account = (GWLibrary.Account8)this.m_groupWise.MultiLogin(us er, cmdLine,
password, GWLibrary.LoginConstants.egwNeverPrompt, Type.Missing);
// return authentication state
//
return true;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
// return authentication state
//
return false;
}
private void Logout()
{
// release GroupWise account
//
if (m_account != null)
m_account = null;
}
private void Dispose()
{
// release connections
//
Logout();
// release GroupWise object
//
if (m_groupWise != null)
m_groupWise.Quit();
m_groupWise = null;
}
private void button1_Click(object sender, EventArgs e)
{
if (Login("admin", "password", "ipa-gwserver /ipp-1677"))
{
try
{
// get all personal folders for this account
//
foreach (GWLibrary.IGWFolder folder in
(GWLibrary.IGWFolders)this.m_account.AllFolders)
{
String FolderName = String.Format("FolderName: {0}", folder.Name);
Console.WriteLine(FolderName);
if (folder.ObjType == GWLibrary.FolderTypeConstants.egwPersonalFolder &&
folder.Shared != GWLibrary.SharedFolderConstants.egwSharedIncoming)
{
// access folder rights
//
GWLibrary.IGWFolderRightsCollection rights =
(GWLibrary.IGWFolderRightsCollection)folder.Folder Rights;
// iterate rights list
//
for (int index = 1; index <= rights.Count; index++ )
{
try
{
// extract rights object
//
GWLibrary.IGWFolderRights right =
(GWLibrary.IGWFolderRights)rights.Item(index);
// get address
//
// TO DO: issue with GW interface object for folder rights
GWLibrary.IGWAddress address = (GWLibrary.IGWAddress)right.Address; // this
is where the app crashes!!!
//
//
Console.WriteLine(address.DisplayName);
}
catch (Exception x)
{
Console.WriteLine(x);
}
}
}
}
}
catch(Exception x)
{
Console.WriteLine(x);
}
Logout();
}
}
}
}
**********************************END SAMPLE CODE
****************************************