Click here to Skip to main content
15,898,938 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: Debuge the COM(ATL) Pin
Stuart Dootson16-Apr-09 20:40
professionalStuart Dootson16-Apr-09 20:40 
QuestionActiveX [modified] Pin
siva45515-Apr-09 23:16
siva45515-Apr-09 23:16 
QuestionSTL vector, search for a sequence Pin
kaminem13-Apr-09 22:16
kaminem13-Apr-09 22:16 
AnswerRe: STL vector, search for a sequence Pin
Stuart Dootson14-Apr-09 22:46
professionalStuart Dootson14-Apr-09 22:46 
AnswerRe: STL vector, search for a sequence Pin
Stephen Hewitt15-Apr-09 0:58
Stephen Hewitt15-Apr-09 0:58 
GeneralRe: STL vector, search for a sequence Pin
Stuart Dootson16-Apr-09 20:34
professionalStuart Dootson16-Apr-09 20:34 
GeneralRe: STL vector, search for a sequence Pin
Stephen Hewitt19-Apr-09 4:43
Stephen Hewitt19-Apr-09 4:43 
QuestionAtlAxAttachControl - An outgoing call cannot be made since the application is dispatching an input-synchronous call. Pin
bfoo759-Apr-09 13:19
bfoo759-Apr-09 13:19 
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(&hdcSurface);
	if (FAILED(hr))
		return;
	SetMapMode(hdcSurface, MM_TEXT);
	OleDraw(this->mFlashCtrl, DVASPECT_CONTENT, hdcSurface, &rect);
	lpdds->ReleaseDC(hdcSurface);
}


When debugging - the console displays two First-chance exceptions as soon as AtlAxAttachControl() is called... Both are 0x8001010D: An outgiong call cannot be made since the application is dispatching an input-syncronous call.

This problem is totally driving me crazy... PLEASE SOMEONE HELP.
AnswerRe: AtlAxAttachControl - An outgoing call cannot be made since the application is dispatching an input-synchronous call. Pin
Stuart Dootson14-Apr-09 22:14
professionalStuart Dootson14-Apr-09 22:14 
GeneralRe: AtlAxAttachControl - An outgoing call cannot be made since the application is dispatching an input-synchronous call. Pin
bfoo7521-Apr-09 11:07
bfoo7521-Apr-09 11:07 
GeneralRe: AtlAxAttachControl - An outgoing call cannot be made since the application is dispatching an input-synchronous call. Pin
Stuart Dootson21-Apr-09 11:16
professionalStuart Dootson21-Apr-09 11:16 
GeneralRe: AtlAxAttachControl - An outgoing call cannot be made since the application is dispatching an input-synchronous call. Pin
bfoo7522-Apr-09 9:45
bfoo7522-Apr-09 9:45 
AnswerRe: AtlAxAttachControl - An outgoing call cannot be made since the application is dispatching an input-synchronous call. Pin
weir750343-Feb-10 17:30
weir750343-Feb-10 17:30 
QuestionCan CAxWindow's subclass implement in a dll, and create in exe program? Pin
SearchDream30-Mar-09 23:39
SearchDream30-Mar-09 23:39 
AnswerRe: Can CAxWindow's subclass implement in a dll, and create in exe program? Pin
Stuart Dootson31-Mar-09 6:56
professionalStuart Dootson31-Mar-09 6:56 
GeneralRe: Can CAxWindow's subclass implement in a dll, and create in exe program? Pin
SearchDream31-Mar-09 18:25
SearchDream31-Mar-09 18:25 
QuestionIs there anyway to authenticate the COM client? Pin
lucyh3h30-Mar-09 6:05
lucyh3h30-Mar-09 6:05 
AnswerRe: Is there anyway to authenticate the COM client? Pin
Stuart Dootson30-Mar-09 6:57
professionalStuart Dootson30-Mar-09 6:57 
GeneralRe: Is there anyway to authenticate the COM client? Pin
lucyh3h30-Mar-09 10:37
lucyh3h30-Mar-09 10:37 
GeneralRe: Is there anyway to authenticate the COM client? Pin
Stuart Dootson30-Mar-09 11:28
professionalStuart Dootson30-Mar-09 11:28 
GeneralRe: Is there anyway to authenticate the COM client? Pin
lucyh3h31-Mar-09 4:19
lucyh3h31-Mar-09 4:19 
GeneralRe: Is there anyway to authenticate the COM client? Pin
Stuart Dootson31-Mar-09 6:43
professionalStuart Dootson31-Mar-09 6:43 
QuestionIs forward declaration of ATL autogenerated _com_ptr_t possible? Pin
Stone Free26-Mar-09 4:17
Stone Free26-Mar-09 4:17 
AnswerRe: Is forward declaration of ATL autogenerated _com_ptr_t possible? Pin
Stuart Dootson26-Mar-09 4:37
professionalStuart Dootson26-Mar-09 4:37 
GeneralRe: Is forward declaration of ATL autogenerated _com_ptr_t possible? Pin
Stone Free26-Mar-09 5:34
Stone Free26-Mar-09 5:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.