home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
USB Analogue video capture - C++ plugin
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="dmxlight" data-source="post: 857007" data-attributes="member: 121196"><p>Hello,</p><p> </p><p>Many years ago I wrote in Pascal, more recently I have been learning C++ using Visual Studio 2010.</p><p>I have a stand alone video recorder app I wrote in C++ to copy my old video tapes onto mpeg.</p><p>I am planning to integrate this app into a MP plugin.</p><p>I have created a dll in C# from the tutorial on the MP wiki, this works ok, it reads the author and captures button presses.</p><p>I have converted that C# code to C++ and compiled a new dll, MP see's the dll, it reads the author and plugin name ok, but the problem is that the dll will not capture the button presses from MP.</p><p>I am sure I have made a simple mistake but I cannot figure it out.</p><p> </p><p>I looked on the forum for C++ example code but could not find any, so when I am finished I will submit mu code as an example for others wanting to use C++ for dll's.</p><p> </p><p>The code I have for capturing the buttons onclick events is shown below.</p><p>I have only pasted just the button related code to keep the post short, I am sure I have just missed a ^ or : somewhere.</p><p> </p><p>C++ .h file</p><p> </p><p>public ref class Class1 : GUIWindow, ISetupForm</p><p>{</p><p>public:</p><p>[SkinControlAttribute(2)] GUIButtonControl ^buttonOne;</p><p> </p><p>public:</p><p>virtual void OnClicked(int controlId, GUIControl ^control, MediaPortal::GUI::Library::Action::ActionType ^actionType) override;</p><p> </p><p>private:</p><p>void OnButtonOne();</p><p> </p><p> </p><p>C++ .cpp file</p><p> </p><p>void Class1::OnClicked(int controlId, GUIControl ^control, MediaPortal::GUI::Library::Action::ActionType ^actionType)</p><p>{</p><p>if (control == buttonOne) OnButtonOne();</p><p>GUIWindow::OnClicked(controlId, control, *actionType);</p><p>}</p><p> </p><p>void Class1::OnButtonOne()</p><p>{</p><p>MessageBox:<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite5" alt=":confused:" title="Confused :confused:" loading="lazy" data-shortname=":confused:" />how("button one clicked");</p><p>GUIDialogOK ^dlg = safe_cast<GUIDialogOK^>(GUIWindowManager::GetWindow(safe_cast<int>(GUIWindow::Window::WINDOW_DIALOG_OK)));</p><p>dlg->SetHeading("Button has been pressed");</p><p>dlg->SetLine(1, "You pressed button 1");</p><p>dlg->SetLine(2, String::Empty);</p><p>dlg->SetLine(3, String::Empty);</p><p>dlg->DoModal(GUIWindowManager::ActiveWindow);</p><p>}</p><p> </p><p>Many thanks,</p><p>Mike</p></blockquote><p></p>
[QUOTE="dmxlight, post: 857007, member: 121196"] Hello, Many years ago I wrote in Pascal, more recently I have been learning C++ using Visual Studio 2010. I have a stand alone video recorder app I wrote in C++ to copy my old video tapes onto mpeg. I am planning to integrate this app into a MP plugin. I have created a dll in C# from the tutorial on the MP wiki, this works ok, it reads the author and captures button presses. I have converted that C# code to C++ and compiled a new dll, MP see's the dll, it reads the author and plugin name ok, but the problem is that the dll will not capture the button presses from MP. I am sure I have made a simple mistake but I cannot figure it out. I looked on the forum for C++ example code but could not find any, so when I am finished I will submit mu code as an example for others wanting to use C++ for dll's. The code I have for capturing the buttons onclick events is shown below. I have only pasted just the button related code to keep the post short, I am sure I have just missed a ^ or : somewhere. C++ .h file public ref class Class1 : GUIWindow, ISetupForm { public: [SkinControlAttribute(2)] GUIButtonControl ^buttonOne; public: virtual void OnClicked(int controlId, GUIControl ^control, MediaPortal::GUI::Library::Action::ActionType ^actionType) override; private: void OnButtonOne(); C++ .cpp file void Class1::OnClicked(int controlId, GUIControl ^control, MediaPortal::GUI::Library::Action::ActionType ^actionType) { if (control == buttonOne) OnButtonOne(); GUIWindow::OnClicked(controlId, control, *actionType); } void Class1::OnButtonOne() { MessageBox::Show("button one clicked"); GUIDialogOK ^dlg = safe_cast<GUIDialogOK^>(GUIWindowManager::GetWindow(safe_cast<int>(GUIWindow::Window::WINDOW_DIALOG_OK))); dlg->SetHeading("Button has been pressed"); dlg->SetLine(1, "You pressed button 1"); dlg->SetLine(2, String::Empty); dlg->SetLine(3, String::Empty); dlg->DoModal(GUIWindowManager::ActiveWindow); } Many thanks, Mike [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
USB Analogue video capture - C++ plugin
Contact us
RSS
Top
Bottom