microsoft / microsoft/mfcmapi

SetColumns with a MVI_FLAG property fails with error

Open
#609 0 comments 0 reactions 1 assignee View on GitHub

@stephenegriffin is already working on this.

Since Nov 14, 2023.

bug
Dominant language
C++
Stars
978
Forks
170
Avg merge
1d 3h
Merged PRs (30d)
5

Description

Version: 23.0.23089.01 MFCMAPI Unicode x64

Reproduction

Make a contact with Outlook. Then open the "Root Container\Top of Information Store\Contacts" folder in MFCMAPI. The contact that was created by Outlook usually has some PT_MV_LONG properties, e.g. PidLidFileUnderList (mapped to 0x81AF1003 here).

contact

From the menu, choose Table ► Set Columns. Add that property to the list, but do set the MV_INSTANCE bit, e.g. enter 0x81AF3003.

contact2

Close the dialog with "OK".

Observed behavior

MFCMAPI throws an error at this point:

Error:
Code: MAPI_E_NO_SUPPORT == 0x80040102
Function lpContentsTable->QueryRows(rowCount, NULL, &pRows)
File D:\a\1\s\UI\Controls\SortList\ContentsTableListCtrl.cpp
Line 579

Expected behavior

Do not throw an error. / Give user more details (see below).

Background

MFCMAPI is too eager to call QueryRows right away after columns were set. Without a matching sortorder which includes MV_INSTANCE properties, the QueryRows call will always be rejected. However, it is not possible to edit the sortorder ahead of editing the column set, as that will also lead to a QueryRows error, because QueryRows does not like sortorders referencing properties that are not in the set of chosen columns.

Desired behavior

Let MFCMAPI take notice that there is one or more MV_INSTANCE properties in the column set, and show extra text in the error dialog that the error can be expected behavior and that a suitable sortorder needs to be set.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.