Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>WARNING: Before I give you too much hope, I haven't tested this with Flash. I've tested it with smaller stuff where I "owned" both COM client and server. If Flash or some software it depends on requires registry settings other than pure COM and ActiveX controls, and even so, settings which are not available in manifests (e.g. categories), this might not work.</p> <p>Define one <a href="http://msdn.microsoft.com/en-us/library/aa374219%28v=vs.85%29.aspx" rel="nofollow">Assembly Manifest</a> for each file that Flash installs, that matches the COM settings that Flash registers during installation. If you know enough COM, <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms694355%28v=vs.85%29.aspx" rel="nofollow">you'll</a>-<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms691424%28v=vs.85%29.aspx" rel="nofollow">know</a>-<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms680091%28v=vs.85%29.aspx" rel="nofollow">where</a>-<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd542719%28v=vs.85%29.aspx" rel="nofollow">to</a>-<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms221610%28v=vs.85%29.aspx" rel="nofollow">look</a>. Each of these manifest files must have a name different from the DLL.</p> <p>Then, create an <a href="http://msdn.microsoft.com/en-us/library/aa374191%28v=vs.85%29.aspx" rel="nofollow">Application Manifest</a> for your executable and add assembly dependencies after the file names you chose previously. If your application doesn't have an embedded manifest, this will be <code>&lt;your-application&gt;.exe.manifest</code>. If it has, you must make your build tool include these dependencies.</p> <hr> <h3>my-application.exe.manifest</h3> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; &lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&gt; &lt;!-- name: a string with the format: Organization.Division.Name Note: It doesn't matter version: 4 numbers between 0 and 65535 separated with dots Note: It doesn't matter --&gt; &lt;assemblyIdentity type="win32" name="My.Application" version="1.0.0.0"/&gt; &lt;dependency&gt; &lt;dependentAssembly&gt; &lt;!-- name: a string with the format: Organization.Division.Name Note: It doesn't matter, but it must match what's in the manifest version: 4 numbers between 0 and 65535 separated with dots Note: It doesn't matter, but it must match what's in the manifest --&gt; &lt;assemblyIdentity type="win32" name="Adobe.Flash.Control" version="8.0.42.0"/&gt; &lt;/dependentAssembly&gt; &lt;/dependency&gt; &lt;/assembly&gt; </code></pre> <hr> <h3>Adobe.Flash.Control.manifest</h3> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; &lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&gt; &lt;!-- name: a string with the format: Organization.Division.Name Note: It doesn't matter, but it must match what's in the dependency version: 4 numbers between 0 and 65535 separated with dots Note: It doesn't matter, but it must match what's in the dependency --&gt; &lt;assemblyIdentity type="win32" name="Adobe.Flash.Control" version="8.0.42.0"/&gt; &lt;!-- file elements name: HKEY_CLASSES_ROOT\CLSID\{CLSID}\InprocServer32, default value HKEY_CLASSES_ROOT\TypeLib\{TLBID}\{version}\{lcid}\win32, default value Note: Keep only the file names Note: In this case, the class factories and the type library happen to be in the same file Otherwise, the comClass and the typelib elements would be under different file elements --&gt; &lt;file name="Flash8g.ocx"&gt; &lt;!-- comClass elements description: HKEY_CLASSES_ROOT\CLSID\{CLSID}, default value clsid: {CLSID} threadingModel: HKEY_CLASSES_ROOT\CLSID\{CLSID}\InprocServer32, ThreadingModel tlbid: HKEY_CLASSES_ROOT\CLSID\{CLSID}\TypeLib, default value progid: HKEY_CLASSES_ROOT\CLSID\{CLSID}\ProgID, default value miscStatus: HKEY_CLASSES_ROOT\CLSID\{CLSID}\MiscStatus, default value miscStatusIcon: HKEY_CLASSES_ROOT\CLSID\{CLSID}\MiscStatus\4, default value miscStatusContent: HKEY_CLASSES_ROOT\CLSID\{CLSID}\MiscStatus\1, default value miscStatusDocprint: HKEY_CLASSES_ROOT\CLSID\{CLSID}\MiscStatus\8, default value miscStatusThumbnail: HKEY_CLASSES_ROOT\CLSID\{CLSID}\MiscStatus\2, default value --&gt; &lt;comClass description="Shockwave Flash Object" clsid="{D27CDB6E-AE6D-11cf-96B8-444553540000}" threadingModel="Apartment" tlbid="{D27CDB6B-AE6D-11cf-96B8-444553540000}" progid="ShockwaveFlash.ShockwaveFlash" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst"&gt; &lt;progid&gt;MacromediaFlashPaper.MacromediaFlashPaper&lt;/progid&gt; &lt;progid&gt;ShockwaveFlash.ShockwaveFlash.1&lt;/progid&gt; &lt;progid&gt;ShockwaveFlash.ShockwaveFlash.3&lt;/progid&gt; &lt;progid&gt;ShockwaveFlash.ShockwaveFlash.4&lt;/progid&gt; &lt;progid&gt;ShockwaveFlash.ShockwaveFlash.5&lt;/progid&gt; &lt;progid&gt;ShockwaveFlash.ShockwaveFlash.6&lt;/progid&gt; &lt;progid&gt;ShockwaveFlash.ShockwaveFlash.7&lt;/progid&gt; &lt;progid&gt;ShockwaveFlash.ShockwaveFlash.8&lt;/progid&gt; &lt;/comClass&gt; &lt;comClass description="Macromedia Flash Factory Object" clsid="{D27CDB70-AE6D-11cf-96B8-444553540000}" threadingModel="Apartment" tlbid="{D27CDB6B-AE6D-11cf-96B8-444553540000}" progid="FlashFactory.FlashFactory"&gt; &lt;progid&gt;FlashFactory.FlashFactory.1&lt;/progid&gt; &lt;/comClass&gt; &lt;!-- typelib elements tlbid: {TLBID} version: HKEY_CLASSES_ROOT\CLSID\{CLSID}\Version, default value HKEY_CLASSES_ROOT\Interface\{IID}\TypeLib, Version helpdir: HKEY_CLASSES_ROOT\TypeLib\{TLBID}\{version}\HELPDIR, default value resourceid: HKEY_CLASSES_ROOT\TypeLib\{TLBID}\{lcid}, the subkey name flags: HKEY_CLASSES_ROOT\TypeLib\{TLBID}\{version}\Flags, default value --&gt; &lt;typelib tlbid="{D27CDB6B-AE6D-11cf-96B8-444553540000}" version="1.0" helpdir="." resourceid="0" flags=""/&gt; &lt;!-- comInterfaceProxyStub elements iid: {IID} name: HKEY_CLASSES_ROOT\Interface\{IID}, default value tlbid: HKEY_CLASSES_ROOT\Interface\{IID}\TypeLib, default value baseInterface: HKEY_CLASSES_ROOT\Interface\{IID}\BaseInterface, default value numMethods: HKEY_CLASSES_ROOT\Interface\{IID}\NumMethods, default value proxyStubClsid32: HKEY_CLASSES_ROOT\Interface\{IID}\ProxyStubClsid32, default value threadingModel: HKEY_CLASSES_ROOT\CLSID\{ProxyStubClsid32}\InprocServer32, ThreadingModel --&gt; &lt;!-- I found no need for any comInterfaceProxyStub --&gt; &lt;/file&gt; &lt;!-- comInterfaceExternalProxyStub elements iid: {IID} baseInterface: HKEY_CLASSES_ROOT\Interface\{IID}\BaseInterface, default value numMethods: HKEY_CLASSES_ROOT\Interface\{IID}\NumMethods, default value name: HKEY_CLASSES_ROOT\Interface\{IID}, default value tlbid: HKEY_CLASSES_ROOT\Interface\{IID}\TypeLib, default value proxyStubClsid32: HKEY_CLASSES_ROOT\Interface\{IID}\ProxyStubClsid32, default value --&gt; &lt;!-- I found these lingering from the current Flash installation I have. Please check if they are the same for Flash 8. If you don't need them, just remove them. These are comInterfaceExternalProxyStub and not comInterfaceProxyStub, because both {00020420-0000-0000-C000-000000000046} (PSDispatch, IDispatch-based interfaces) and {00020424-0000-0000-C000-000000000046} (PSOAInterface, Type Library interfaces) come with Windows. --&gt; &lt;comInterfaceExternalProxyStub iid="{86230738-D762-4C50-A2DE-A753E5B1686F}" name="IFlashObject" tlbid="{D27CDB6B-AE6D-11CF-96B8-444553540000}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/&gt; &lt;comInterfaceExternalProxyStub iid="{D27CDB6C-AE6D-11CF-96B8-444553540000}" name="IShockwaveFlash" tlbid="{D27CDB6B-AE6D-11CF-96B8-444553540000}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/&gt; &lt;comInterfaceExternalProxyStub iid="{D27CDB6D-AE6D-11CF-96B8-444553540000}" name="_IShockwaveFlashEvents" tlbid="{D27CDB6B-AE6D-11CF-96B8-444553540000}" proxyStubClsid32="{00020420-0000-0000-C000-000000000046}"/&gt; &lt;/assembly&gt; </code></pre> <hr> <p>I tested with the following bare-bones example, and it seems to work. Using Process Explorer, I can see that it loads the local Flash8g.ocx:</p> <hr> <h3>my-application.cpp</h3> <pre class="lang-c prettyprint-override"><code>#include &lt;windows.h&gt; int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) { HRESULT hr; if (SUCCEEDED(hr = CoInitialize(NULL))) { CLSID clsid; // Both ways work if (SUCCEEDED(hr = CLSIDFromProgID(L"ShockwaveFlash.ShockwaveFlash.8", &amp;clsid))) { /*if (SUCCEEDED(hr = CLSIDFromString(L"{D27CDB6E-AE6D-11cf-96B8-444553540000}", &amp;clsid))) {*/ IDispatch *flash; // IID_PPV_ARGS is better, but doesn't exist in older SDKs /*if (SUCCEEDED(hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&amp;flash)))) {*/ if (SUCCEEDED(hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IDispatch, (void**)&amp;flash))) { OLECHAR name[] = L"ReadyState"; LPOLESTR names[] = { &amp;name[0] }; DISPID dispid; if (SUCCEEDED(hr = flash-&gt;GetIDsOfNames(IID_NULL, names, sizeof(names)/sizeof(names[0]), LOCALE_SYSTEM_DEFAULT, &amp;dispid))) { DISPPARAMS params; VARIANT result; EXCEPINFO excepinfo; UINT argerr; params.rgvarg = NULL; params.rgdispidNamedArgs = NULL; params.cArgs = 0; params.cNamedArgs = 0; // Initialize out args due to buggy IDispatch implementations VariantInit(&amp;result); excepinfo.wCode = 0; excepinfo.wReserved = 0; excepinfo.bstrSource = NULL; excepinfo.bstrDescription = NULL; excepinfo.bstrHelpFile = NULL; excepinfo.dwHelpContext = 0; excepinfo.pvReserved = NULL; excepinfo.pfnDeferredFillIn = NULL; excepinfo.scode = S_OK; argerr = 0; if (SUCCEEDED(hr = flash-&gt;Invoke(dispid, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET, &amp;params, &amp;result, &amp;excepinfo, &amp;argerr))) { MessageBox(NULL, "The example ran to completion.", "Flash test", MB_OK); VariantClear(&amp;result); SysFreeString(excepinfo.bstrSource); excepinfo.bstrSource = NULL; SysFreeString(excepinfo.bstrDescription); excepinfo.bstrDescription = NULL; SysFreeString(excepinfo.bstrHelpFile); excepinfo.bstrHelpFile = NULL; } } flash-&gt;Release(); flash = NULL; } } CoUninitialize(); } if (SUCCEEDED(hr)) { return 0; } else { return 1; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload