**************************
*** Media View 1.3
***
*** Supporting Win31, Wfw311, NT305, Win95 (beta), Macintosh
**************************

README & FREQUENTLY ASKED QUESTIONS

====================================================================

**************************
*** SETUP PROCEDURE AND ISSUES
**************************

====================================================================
To set up the MediaView 1.3 toolkit and libraries on your computer, 
run SETUP.EXE from the root directory.

If you do a normal install and then later go to the Add/Remove option, 
the "Program Manager Groups" option appears on the list twice. This is 
a cosmetic bug only and will not impair your setup selection(s).

====================================================================

If the setup option "Remove All" is chosen it will remove the files 
from the previous install but not the directory structure(s).

====================================================================

**************************
*** LICENSE STATEMENT
**************************

SAMPLE CODE.  Microsoft grants to you a royalty-free right to use 
and modify the source code version and to reproduce and distribute 
the object code version of the sample code, icons, cursors, and 
bitmaps provided within the Sample Code bin/folder on the SOFTWARE 
("Sample Code") provided that you: (a) distribute the Sample Code 
only in conjunction with and as a part of your software product; 
(b) do not use Microsoft's name, logo, or trademarks to market your 
software product; and (c) agree to indemnify, hold harmless, and 
defend Microsoft and its suppliers from and against any claims or 
lawsuits, including attorneys' fees, that arise or result from your 
distribution of your software product.

REDISTRIBUTABLE COMPONENTS.  Microsoft grants you a non-exclusive 
royalty-free right to  reproduce and distribute the .DLL files 
included as part of the Sample Code provided that you: (a) distribute 
the .DLL files only in conjunction with and as a part of your software 
product; (b) do not use Microsoft's name, logo, or trademarks to market 
your software product; (c) agree to indemnify, hold harmless, and 
defend Microsoft and its suppliers from and against any claims or 
lawsuits, including attorneys' fees, that arise or result from the 
use or distribution of your software product; and (d) otherwise comply 
with the terms of this license agreement.

====================================================================

**************************
*** COMPILER:  Known Problems
**************************

====================================================================

If you have a 32bit platform, it is recommended that you use the 
32bit compiler ( see \mv\bin\nt\mvcc13n.exe )

====================================================================

A ! footnote MUST be authored before the text of the topic, or it may 
not be accessible at runtime.

====================================================================

**************************
*** DOCUMENTATION ERRATA
**************************

1.  The topic, "Using the MediaView Libraries," mentions 
    functions MVIMCInitiate and MVIMCTerminate.  These should be 
    MVMCIInitiate and MVMCITerminate.  (MVIMC should be MVMCI.)

    Also, at the very top, the topic mentions that MEDV13.H is for 
    MEDV13.LIB. Read MEDV13.LIB as MVCL13x.LIB.

2.  The topic, "Full Text Searching," refers to the MVSRCH13 library.  
    This should be the MVSR13x library.

3.  The "Vertical Scrolling and Hiding Partial Lines of
    Text" topic's sample code segment that reads:

    else
    {
        RECT rect;
        ERR err = SUCCEED;
        BOOL fResult;
        GetClientRect ( hWnd, &rect );
        fResult = fMVApplyToDC (lpMV, hDC, &rect, &err);
        EndPaint (hWnd, &ps);
        return err;
    }
    ----------------------------------
    Should be:
    ----------------------------------
    else
    {
        ERR err = SUCCEED;
        BOOL fResult;
        fResult = fMVApplyToDC (lpMV, hDC, &ps.rcPaint, &err);
        EndPaint (hWnd, &ps);
        return err;
    }

    ...
    because we don't want to automatically paint the whole window, 
    just the area that the WM_PAINT msg says is actually invalid 
    (which is what is in ps.rcPaint). This is an important 
    efficiency issue.

4.  The topic,  "RTF: footnote," reads:
    ---------------------
    !  Specifies authored data. The title player application can 
    retrieve this data at run time. The text parameter may be one or 
    more character strings separated by semicolons (;).
    ---------------------
    It should also state that the ! footnote MUST be authored before 
    the topic text, or it may not be accessible during runtime.

====================================================================

**************************
*** TUTORIAL:  Known Problem
**************************

====================================================================

CAUTION:

When working with the tutorial, please note: 

Do not delete files from your personal working directory before 
copying lessons from the tutorial lessons source.  Copying these 
files also copies the changes for the lesson to your personal working 
directory. If a file has no changes, however, it will not be in the 
tutorial source directory.  If you delete files in your personal 
working directory for the tutorial, you risk losing the work contained 
in those files.

====================================================================

**************************
*** FUNCTIONS
**************************

====================================================================

hMVCopyAdvanced - Known problem pasting RTF to some applications:

This function returns a handle to a buffer which holds the rtf and 
data to be pasted. Some applications require that the '/ANSI' 
token be placed at the very beginning of the stream. MediaView 
does not place this token in the stream, which may cause 
the output to not paste properly. The workaround is:

-----------------------------
Suggested Workaround Approach
-----------------------------

char rtf[] = "{\\rtf";
char ansi[] = "\\ansi";
int nLen1 = lstrlen( rtf );
int nLen2 = lstrlen( ansi );

HANDLE h = hMVCopyAdvanced ( lpMV, fSelection, nType, &err );

DWORD dwSize = GlobalSize( h );
GlobalReAlloc( h, dwSize+nLen2+nLen1, GMEM_MOVEABLE );
void * vp = GlobalLock( h );

memmove( vp+nLen2+nLen1, vp+nLen1, dwSize-nLen1 );
memcpy( vp+nLen1, ansi, nLen2 );

GlobalUnlock( h );
vp = NULL;

====================================================================

**************************
*** Windows95 (beta)
**************************

====================================================================

Certain RIPs and Access Violations may be encountered within the 
Windows95 beta version. Try adding

\SECTION:rsc,rws

to your link options.

====================================================================

How do I set my paths?
--=> edit the PATH variable in your Autoexec.bat and restart

====================================================================

Why can I not see the DLLs in Explorer?
--=> You have to explicitly set Explorer to show you DLLs. Keep in 
--=> mind that Windows95 Explorer allows you to screen out 
--=> file types.

====================================================================

I found the NT directories, but where are the Win95 beta directories?
--=> The files in the "NT" directories are for both NT and Win95(beta)

====================================================================

How do I set the working directory for a Taskbar item (like DPlay32)?
--=> Start | Settings | Taskbar | (find the item, then set properties)

====================================================================

*****************************
*** MVERROR.H:  Known Problem
*****************************

====================================================================

ERR_CANTWRITE	"The search failed due to a disk-read error."
should read	"The search failed due to a disk-write error."

====================================================================

********************************************************************
********************************************************************
*** FREQUENTLY ASKED QUESTIONS
******************************

====================================================================

Question #1:  I have been experimenting with the new API and am not 
sure about how lMVKeyIndexGetAddrs works.  What is in the buffer 
returned by lMVKeyIndexGetAddrs?

Answer:  The buffer is an array of addresses of the topics (not topic 
numbers).
____________________________________________________________________

Question #2:  When displaying a bitmap (e.g., *.BMP or *.DIB) in an 
embedded window, what palette handling is necessary?  

Answer:  The application must always control the palette. If the 
embedded windows change the palette, some titles with interface art 
may exhibit unpredictable results.

There is no way for an embedded window to resolve conflicts when 
multiple images with different palettes are displayed at once.

Note: An embedded window does not receive WM_PALETTECHANGED 
messages (which are only sent to top level windows), and all 
applications must respond to these.

To properly set the palette, an application needs to:

1.  Run through the embedded windows (hwndMVGetEmbeddedWindow), and 
send a EWM_ASKPALETTE message to each one. An HPALETTE will be 
returned. 
2.  Process all of the HPALETTEs, including the one for its 
interface art, and come up with the best combination.  

In reality, this may be an unnecessarily complex operation.

A more pragmatic way to set the palette is:

1.  Go through embedded windows, until an HPALETTE with > 16 
colors is returned.
2.  Save that palette and realize it as appropriate (i.e., when 
retrieved and on WM_PALETTECHANGED).

How to determine the number of colors in the HPALETTE:
	WORD nCount;
	GetObject (hPal, sizeof(nCount), &nCount);

When to check:
	After fMVRealize or yMVScrollY 
	The HPALETTE could become invalid during the yMVScrollY, so 
	it is important to check there.

Optimization:
	MVIMAGE will return the same handle for the same image.  So 
        during yMVScrollY, check to see if the handle is the same as 
        the current one.
____________________________________________________________________

Question #3:  I tried the new-for-MV1.3 API, hMVCopyAdvanced, to copy 
text including a bitmap, authored with a {bml ...} statement. The 
selection appears correctly, but only text gets to the clipboard.

Answer:  {bmx } statements, which are maintained for backward 
compatibility, cannot be copied.  Use {ewx} wherever possible.  
{ewx} commands also support more colors than {bmx} statements 
(which are limited to 16).
____________________________________________________________________

Question #4:  What's the difference between the baggage file I/O 
procedures in MV1.3 and using the mmio file I/O procedures?

Answer:  Baggage file I/O procedures permit more direct access to 
the files.  The mmio procedure opens a new instance of the HTITLE, 
and doesn't allow things like hMVBaggageGetFile().

You cannot use the mmio procedures to play media from baggage when 
statically linking.

____________________________________________________________________

Question #5:  What's the best way to ensure that MSFS13x.DLL has been 
loaded before any attempts to load baggage files commence?

Answer:   mmio procedures have been moved from MVFS13x.DLL into 
MVCL13x.DLL. The mmio procedures are installed automatically.
____________________________________________________________________

Question #6:  Does MediaView assume that titles are designed for 96 
DPI screens, or does it assume that MediaView clients will deal with 
multiple resolution displays (using Char Styles)?

Answer:  You can use fMVSetMagnifier to enable the end-user to adjust 
the text size to his display. 
____________________________________________________________________

Question #7:   Where can I find the sample code for printing in 
MediaView 1.3?

Answer:  MediaView 1.3 includes online documentation and a tutorial 
that covers all essential aspects of authoring a title and developing 
a title player for it.  Lesson 13 of the tutorial covers printing, 
and includes a working code sample for using fMVPrintMedia.  You can 
also access sample code from the online Developer's Reference by 
clicking on the "Example" button for a given API reference page. 
The documentation title displays the sample code in a second window.
____________________________________________________________________

Question #8:  Is there a way for a MediaView title application to get 
the context string associated with a VA or an ADDR -- something that 
would be the converse of the API, vaMVConvertContextString?

Answer:  The compiler discards context strings at compile time for 
speed and efficiency, so there is no API that can simply retrieve 
it. You can, however, retrieve the VA or ADDR of any context string 
through a combination of title authoring and an API call:

1.  Author the desired context string as a topic information string 
with the ! footnote (note that the ! footnote must be authored before 
the text of the topic).
2.  At run time retrieve the string information with hMVGetData.
____________________________________________________________________

Question #9:   I've updated to MediaView 1.3.  When I try to play an 
embedded AVI file, the player just displays a window outline with 
nothing in it. What's the problem?

Answer:   Make sure you have updated all your file extensions from 
.M12 to .M13.  Also make sure that other references to old libraries 
and header files have been remapped or changed to the new names.
____________________________________________________________________

Question #10: Can an ADDR (such as one returned by KeyIndexGetAddrs) 
be converted into a topic number (to create a topic list for a full 
text search query)?

Answer:  Create an LPMV to do the conversion.  You can do a 
fMVSetAddress using the ADDR, and then get the topic number from the 
LPMV.  You do NOT need to call fMVRealize for it to work.
____________________________________________________________________

Question #11:  Is the MediaView API for the sole purpose of creating 
a title player?   If not, what other tasks can the API help perform?

Answer: It can be used anywhere there is a need for hyperlinks and 
topical information:

One application is as a highly customized, context-sensitive help, 
where the application owns the help window.
____________________________________________________________________

Question #12:  Why can't my title application scroll to a highlighted 
item when I perform a search?

Answer:  If you have search highlights turned off and jump to a search 
item, it will not scroll to the highlight. It will scroll only if you 
have search highlights on.
