Click here to Skip to main content
15,895,557 members
Home / Discussions / COM
   

COM

 
Questionerror "Missing file: ---- Urgent Pin
shantanusenin14-Apr-09 18:44
shantanusenin14-Apr-09 18:44 
QuestionRe: Call C# DLL using C++ - "Not enough storage is available to complete this operation" [modified] Pin
mla15414-Apr-09 8:42
mla15414-Apr-09 8:42 
AnswerRe: Call C# DLL using C++ - "Not enough storage is available to complete this operation" Pin
mla15415-Apr-09 10:55
mla15415-Apr-09 10:55 
QuestionUnable to emit assembly: Referenced assembly 'Interop.ADODB' does not have a strong name Pin
MarcelloTurnbull14-Apr-09 6:37
MarcelloTurnbull14-Apr-09 6:37 
AnswerRe: Unable to emit assembly: Referenced assembly 'Interop.ADODB' does not have a strong name Pin
mla15415-Apr-09 7:53
mla15415-Apr-09 7:53 
Questionout process server crash......... Pin
contactjey13-Apr-09 6:11
contactjey13-Apr-09 6:11 
QuestionTAPI Looking for minimum required code for making outgoing calls Pin
Ron Segijn12-Apr-09 0:30
Ron Segijn12-Apr-09 0:30 
QuestionAtlAxAttachControl - An outgoing call cannot be made since the application is dispatching an input-syncronous call. Pin
bfoo759-Apr-09 13:20
bfoo759-Apr-09 13:20 
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 outgoing call cannot be made since the application is dispatching an input-syncronous call.

This problem is totally driving me crazy... PLEASE SOMEONE HELP.
QuestionHow to create new object in C# for reading COM port. Pin
gaurav_quexst9-Apr-09 1:57
gaurav_quexst9-Apr-09 1:57 
AnswerRe: How to create new object in C# for reading COM port. [modified] Pin
Vozzie29-Apr-09 6:23
Vozzie29-Apr-09 6:23 
QuestionAdd-in express.. Pin
gothic_coder9-Apr-09 1:11
gothic_coder9-Apr-09 1:11 
QuestionIs VariantChangeType() have problem with BSTR to VT_I4 conversion with even numbers and odd numbers Pin
Shankarcodebase8-Apr-09 5:48
Shankarcodebase8-Apr-09 5:48 
AnswerRe: Is VariantChangeType() have problem with BSTR to VT_I4 conversion with even numbers and odd numbers Pin
Ujjwal Gangwal11-Jun-19 6:05
professionalUjjwal Gangwal11-Jun-19 6:05 
QuestionDLL missing? Pin
tom5720078-Apr-09 2:49
tom5720078-Apr-09 2:49 
AnswerRe: DLL missing? Pin
tom5720078-Apr-09 2:57
tom5720078-Apr-09 2:57 
QuestionVB ActiveX in C# Pin
tvks8-Apr-09 2:13
tvks8-Apr-09 2:13 
Questionhow to fix the IWebBrowser2 refresh problem Pin
benpeng2-Apr-09 22:56
benpeng2-Apr-09 22:56 
QuestionFree threaded model Pin
_80862-Apr-09 21:25
_80862-Apr-09 21:25 
AnswerRe: Free threaded model Pin
Roger Stoltz2-Apr-09 21:50
Roger Stoltz2-Apr-09 21:50 
GeneralRe: Free threaded model Pin
_80862-Apr-09 22:43
_80862-Apr-09 22:43 
GeneralRe: Free threaded model Pin
_80862-Apr-09 22:53
_80862-Apr-09 22:53 
AnswerRe: Free threaded model Pin
Roger Stoltz2-Apr-09 23:04
Roger Stoltz2-Apr-09 23:04 
GeneralRe: Free threaded model Pin
_80862-Apr-09 23:16
_80862-Apr-09 23:16 
QuestionHow to set the URL property of a WMP object in a Word .doc file? Pin
wangdave2-Apr-09 14:49
wangdave2-Apr-09 14:49 
QuestionLooking for links, books, articles on building .NET assemblies for use as COM servers Pin
cpkilekofp2-Apr-09 10:07
cpkilekofp2-Apr-09 10:07 

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.