Microsoft Developer Studio and ActiveMovie

Getting Started

Make sure you have installed Microsoft's Visual C++ Developer Studio and the ActiveMovie SDK including libraries, samples, and headers.

Set the Microsoft Developer Studio Include and Lib directories properly:
1.  Bring up the Options dialog box by selecting Options from the Tools menu. Select the Directories tab.
2.  Add the ActiveMovie include directories (by default: DXMEDIA\INCLUDE and DXMEDIA\CLASSES\BASE) to the list.
3.  Select Library files in the Show directories for: combo-box.
4.  Add the ActiveMovie library path (c:\DXMEDIA\LIB). 

Remember to link with QUARTZ.LIB STRMBASE.LIB and LIBCMT.LIB via the Link tab in the Microsoft Developer Studio Build/Settings dialog box, and check 'Ignore Default Libraries.' No further changes are required to build first ActiveMovie application. Filter developers should follow the steps below to install and customize the AMVCKIT.


Filter Development and Microsoft Visual C++ Developer Studio

The steps below explain how to customize AMVCKIT in preparation for filter development.

Assumptions

1.  The ActiveMovie Software Development Kit has been installed in C:\DXMEDIA.
2.  The name for our sample filter will be FILTER.

Preliminary Setup

1.  Choose a project name (we're going to use FILTER).
2.  Create an empty directory for the project. [C:\FILTER].
3.  Copy the files (excluding this .doc file) into the directory just created [into C:\FILTER].
4.  If you already have a working project which you have developed you can keep your .DEF file and .RC file rather than reverting to those provided in AMVCKIT. However, be sure to read Modifying the .DEF and RC files from the AMVCKIT below and merge any necessary changes into your own files.
5.  Copy the source .CPP and .H files into the project directory, as well as the .RC file and any other miscellaneous source files it requires. Do not copy any make files or compiler intermediate files. 

Working with Microsoft Developer Studio

1.  Run Microsoft Developer Studio and close any open projects.

2.  Open the [FILTER] workspace [FILTER.DSW] using Open Workspace... from the File menu.

3.  Add any .CPP files to the project by choosing Files... from the Add to Project... menu option under the Project menu.

4.  Bring up the Settings dialog box by selecting Settings... from the Project menu. Select the Link tab and set the Output file name to [C:\FILTER\FILTER.AX].

5.  Choose Save All from the File menu.
 
Modifying the .DEF and .RC files from the AMVCKIT

AMVCKIT includes a sample .DEF file and minimal .RC file you can use as a template if your are creating a new filter. If you have an existing project, treat the following steps as a checklist to make sure you have modified your files appropriately. This especially applies if you are modifying one of the samples provided with the ActiveMovie SDK.

1.  Follow the steps listed in Appendix A to create your own GUID. Appendix A also provides more information about GUIDs. If you are using code from one of the AMSDK samples,  please generate a new GUID.
2.  Save everything via Save All from the File menu.

The Test

1.  Rebuild the entire project via Rebuild All from the Build menu. The project should build with zero errors and two warnings when built as Debug, and one warning when built as Release. 
2.  Install the filter by using the REGSVR32 program found in the \MSDEV\BIN directory. From the console window for example, REGSVR32 FILTER.AX. The REGSVR32 program will indicate success or failure via a dialog box.
3.  Launch GraphEdit from (C:\DXMEDIA\TOOLS\GRAPHEDT.EXE) and try inserting the [FILTER] filter.



Appendix A - Generating New Globally Unique Identifiers (GUIDs)

In ActiveMovie, objects are identified by globally unique identifiers (GUIDs). Each filter is identified by a distinct GUID. Likewise, the filter's property page is identified by a separate and distinct GUID. GUIDGEN is a Windows-based utility designed to generate GUIDs. Adding GUIDGEN to the Developer Studio Tools menu (via Customize) is a great time-saver. GUIDGEN can be found in the \MSDEV\BIN directory. If GUIDGEN.EXE was not installed, simply copy the executable from the Microsoft Developer Studio disc.

1.  Run GUIDGEN (handy if it's in the Tools menu) and copy the new GUID in the DEFINE_GUID format. Now you have a new GUID on the clipboard, ready to be pasted into your source code.

2.  Replace the GUID declaration in your source code by pasting in the new GUID.
For the steps below, imagine GUIDGEN created the following GUID:

// {A0290240-8EF6-11cf-8F47-00AA0060D683}
DEFINE_GUID(<<name>>,
0xa0290240, 0x8ef6, 0x11cf, 0x8f, 0x47, 0x0, 0xaa, 0x0, 0x60, 0xd6, 0x83);

3.  Replace the <<name>> in the filter's DEFINE_GUID macro accordingly [CLSID_FILTER].
4.  Copy the alpha-numeric sequence [{A0290240-8EF6-11cf-8F47-00AA0060D683}], from the comment line above into the clipboard.
5.  Save your changes.
6.  Proceed with other modifications in step 3 of Modifying the .DEF and .RC files from the AMVCKIT above.

Appendix B - Details about the AMVCKIT kit.

The following information chronicles how the AMVCKIT project workspace was created in case the developer needs to reconstruct, refine or customize the environment.

1.  Launch Developer Studio.
2.  Create a new DLL project workspace named FILTER.
3.  Modify the project's Build/Settings...

In the Settings For: portion of the Project Settings dialog, select both the Win32 Debug and Win32 Release entries.
a) Set the Microsoft Foundation Classes: setting of the General pane for Not Using MFC.
b) In the General category under C/C++, set the compiler at W3 (minimum).
c) Add the following Preprocessor Directives (commas between directives):
INC_OLE2, STRICT, WIN32,_MT,_DLL,_X86_=1,WINVER=0x0400
d) In the C++ Language category, enable exception handling.
e) In the Code Generation category, set the processor setting to Blend.
f) In the Code Generation category, set the call convention to __stdcall.
g) In the Code Generation category, select multithreaded dlls..
h) In the Precompiled Headers category, disable use of precompiled headers.
i) In the Object/library module section, start the .lib list with QUARTZ.LIB STRMBASE.LIB LIBCMT.LIB.
j) Select to ignore default libraries.
k) Disable the use of program databases under the Customize category.
l) In the Output category, set the base address to 0x1c400000.
m) In the Output category, set the entry-point symbol to DllEntryPoint@12.
n) Back in the left Settings For pane, select the Debug entry.
o) In the General category under C/C++, enable generation of browse information.
p) In the Debug category under Link, enable generation of debug information.
q) Select C7 compatible debug information.
r) In the Code Generation category, select debug multithreaded dlls..
s) Under Browse Info, enable generation of browse information.

4. Copy the .DEF and .RC files from the SDK's BALL sample, naming the files FILTER.DEF and FILTER.RC respectively.
5. Add FILTER.DEF and FILTER.RCto the project via Insert/Files...
Save the entire environment via File/Save All.
