Click here to Skip to main content
15,895,142 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralHelp needed to start developing an InHouse Application Pin
Sardarindianpunjabi16-Nov-04 8:58
Sardarindianpunjabi16-Nov-04 8:58 
GeneralRe: Help needed to start developing an InHouse Application Pin
benjymous18-Nov-04 22:41
benjymous18-Nov-04 22:41 
GeneralRe: Help needed to start developing an InHouse Application Pin
Sardarindianpunjabi19-Nov-04 7:33
Sardarindianpunjabi19-Nov-04 7:33 
GeneralRe: Help needed to start developing an InHouse Application Pin
The Man from U.N.C.L.E.2-Dec-04 4:49
The Man from U.N.C.L.E.2-Dec-04 4:49 
GeneralDeployment of COM Interop Pin
skrishnasarma15-Nov-04 21:48
skrishnasarma15-Nov-04 21:48 
GeneralRe: Deployment of COM Interop Pin
CodeWell17-Nov-04 20:12
CodeWell17-Nov-04 20:12 
GeneralRe: Deployment of COM Interop Pin
tvkrao23-Nov-04 22:49
tvkrao23-Nov-04 22:49 
GeneralEmbedding WMP9 - InvalidActiveXStateException Pin
Michael Rosati15-Nov-04 10:13
Michael Rosati15-Nov-04 10:13 

Hello all. Much Googling has yielded no satisfactory answer to this, and I'm hoping someone here knows how I might solve my problem.

I'm trying to embed Windows Media Player 9 in my Windows Forms application using MC++. If I drop it on the form and run, it's happy. But as soon as I try to set any WMP-specific properties, I get the error

An unhandled exception of type 'InvalidActiveXStateException' occurred in axinterop.wmplib.dll

Here's my InitializeComponent() function:

void InitializeComponent(void)
{
            System::Resources::ResourceManager *  resources = new System::Resources::ResourceManager(__typeof(TMVideo::TMVideoControl));
            this->axWindowsMediaPlayer1 = new AxInterop::WMPLib::AxWindowsMediaPlayer();
            (__try_cast<System::ComponentModel::ISupportInitialize *  >(this->axWindowsMediaPlayer1))->BeginInit();
            this->SuspendLayout();
            // 
            // axWindowsMediaPlayer1
            // 
            this->axWindowsMediaPlayer1->Enabled = true;
            this->axWindowsMediaPlayer1->Location = System::Drawing::Point(48, 40);
            this->axWindowsMediaPlayer1->Name = S"axWindowsMediaPlayer1";
            this->axWindowsMediaPlayer1->OcxState = (__try_cast<System::Windows::Forms::AxHost::State *  >(resources->GetObject(S"axWindowsMediaPlayer1.OcxState")));
            this->axWindowsMediaPlayer1->Size = System::Drawing::Size(232, 216);
            this->axWindowsMediaPlayer1->TabIndex = 0;
            this->axWindowsMediaPlayer1->enableContextMenu = false;
>>>         this->axWindowsMediaPlayer1->uiMode = S"none";

            // 
            // TMVideoControl
            // 
            this->Controls->Add(this->axWindowsMediaPlayer1);
            this->Name = S"TMVideoControl";
            this->Size = System::Drawing::Size(368, 336);
            (__try_cast<System::ComponentModel::ISupportInitialize *  >(this->axWindowsMediaPlayer1))->EndInit();
            this->ResumeLayout(false);
}

I added the two lines where enableContextMenu and uiMode are being set. Without those, the control loads and displays without a crash - but it's not the behavior I want from it.

Does anyone know what I'm doing wrong?

Thanks,
Mike





"We've reached the point where the first duty of intelligent men is to restate the obvious."
-- George Orwell
GeneralRemoting that doesn't work on SP2 Pin
lordavenger15-Nov-04 7:15
lordavenger15-Nov-04 7:15 
GeneralAutomated Builds Pin
Alberto Bar-Noy15-Nov-04 3:28
Alberto Bar-Noy15-Nov-04 3:28 
GeneralRe: Automated Builds Pin
Steven Campbell15-Nov-04 7:46
Steven Campbell15-Nov-04 7:46 
GeneralDeploying 1.1 app on 1.0 framework Pin
slaars13-Nov-04 14:17
slaars13-Nov-04 14:17 
GeneralRe: Deploying 1.1 app on 1.0 framework Pin
Charlie Williams13-Nov-04 14:27
Charlie Williams13-Nov-04 14:27 
GeneralClipboard Pin
Matthias Glemser13-Nov-04 4:38
Matthias Glemser13-Nov-04 4:38 
GeneralRe: Clipboard Pin
Matthias Glemser15-Nov-04 8:17
Matthias Glemser15-Nov-04 8:17 
GeneralCOM+ : exporting to type library(com+ to com) Pin
Sendilkumar.M11-Nov-04 23:30
Sendilkumar.M11-Nov-04 23:30 
GeneralRe: COM+ : exporting to type library(com+ to com) Pin
CodeWell17-Nov-04 20:16
CodeWell17-Nov-04 20:16 
GeneralBinding Collection to DataGrid Pin
Derec Roofie11-Nov-04 1:24
Derec Roofie11-Nov-04 1:24 
GeneralRe: Binding Collection to DataGrid Pin
Steven Campbell11-Nov-04 15:01
Steven Campbell11-Nov-04 15:01 
GeneralRe: Binding Collection to DataGrid Pin
satya chhikara22-Nov-04 23:30
satya chhikara22-Nov-04 23:30 
QuestionHow to determine parent class Pin
Derec Roofie11-Nov-04 1:17
Derec Roofie11-Nov-04 1:17 
AnswerRe: How to determine parent class Pin
Colin Angus Mackay12-Nov-04 9:39
Colin Angus Mackay12-Nov-04 9:39 
QuestionHow to we add C++ code to .NET Application? Pin
pubududilena10-Nov-04 22:00
pubududilena10-Nov-04 22:00 
QuestionMDAC needed? Pin
the last free name10-Nov-04 21:38
the last free name10-Nov-04 21:38 
AnswerRe: MDAC needed? Pin
Steven Campbell11-Nov-04 15:07
Steven Campbell11-Nov-04 15: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.