Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. AtlAxAttachControl - An outgoing call cannot be made since the application is dispatching an input-syncronous call.

AtlAxAttachControl - An outgoing call cannot be made since the application is dispatching an input-syncronous call.

Scheduled Pinned Locked Moved COM
announcementc++adobehelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bfoo75
    wrote on last edited by
    #1

    I'm at the end of my rope here... I've been bashing my head on my keyboard for the last week trying to figure out this issue. I'm trying to display a flash control on a DirectDraw surface and my call to AtlAxAttachControl fails - preventing the flash player from appearing within the control. Here's a stripped down version of my code:

    #pragma once

    #include <string>
    #include <windows.h>
    #include <exdisp.h>
    #include <mshtmlc.h>

    #include <atlbase.h>
    #include <atlcom.h>
    #include <atlwin.h>

    using std::string;

    #import "PROGID:ShockwaveFlash.ShockwaveFlash" no_namespace raw_interfaces_only

    typedef HRESULT (WINAPI *LPAtlAxWinInit) ();
    typedef HRESULT (WINAPI *LPAtlAxGetControl)(HWND hwnd, IUnknown** unk);

    class FlashViewer
    {
    public:
    FlashViewer();
    ~FlashViewer();

    bool Init(int Width, int Height);
    
    void OpenFlash(const char\* filename);
    
    void DrawToSurface(LPDIRECTDRAWSURFACE7 lpdds);
    

    private:
    int mViewerWidth;
    int mViewerHeight;

    HWND mViewerWnd;
    IShockwaveFlash\* mFlashCtrl;
    

    };

    FlashViewer::FlashViewer()
    {
    mViewerWidth = 0;
    mViewerHeight = 0;

    mViewerWnd = 0;
    mFlashCtrl = NULL;
    

    }

    FlashViewer::~FlashViewer()
    {
    DestroyWindow(this->mViewerWnd);
    if (this->mFlashCtrl != NULL)
    {
    this->mFlashCtrl->Release();
    this->mFlashCtrl = NULL;
    }
    }

    bool FlashViewer::Init(int width, int height)
    {
    LPAtlAxWinInit AtlAxWinInit3 = (LPAtlAxWinInit)GetProcAddress(LoadLibrary("atl"), "AtlAxWinInit");
    LPAtlAxGetControl AtlAxGetControl3 = (LPAtlAxGetControl)GetProcAddress(LoadLibrary("atl"), "AtlAxGetControl");

    MSG msg;
    HRESULT hr = AtlAxWinInit3();
    
    HWND hwnd = CreateWindow("AtlAxWin", "", WS\_VISIBLE|WS\_POPUP, 0, 0, 1024, 768, 0, 0, 0, 0);
    
    IShockwaveFlash\* flash = 0;
    
    hr = CoCreateInstance(\_\_uuidof(ShockwaveFlash), 0, CLSCTX\_ALL, \_\_uuidof(IShockwaveFlash), (void \*\*)&flash);
    hr = flash->put\_WMode(L"transparent");
    hr = flash->put\_Loop(true);
    
    hr = AtlAxAttachControl(flash, hwnd, NULL);
    hr = flash->put\_Movie(L"c:\\\\FrontEnd.swf");
    
    long pVal = -1;
    flash->get\_ReadyState(&pVal);
    
    return true;
    

    }

    void FlashViewer::OpenFlash(const char *filename)
    {
    this->mFlashCtrl->LoadMovie(0, _bstr_t(filename));
    }

    void FlashViewer::DrawToSurface(LPDIRECTDRAWSURFACE7 lpdds)
    {
    if (this->mViewerWnd == NULL)
    return;
    RECT rect = {0, 0, this->mViewerWidth, this->mViewerHeight};
    HDC hdcSurface;
    HRESULT hr = lpdds->GetDC(&am

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups