erwin Posted April 6, 2010 Share Posted April 6, 2010 This is a wrapper wich allows you to write DVBViewer Plugins in the C# language (MS Visual Studio). DVBViewerPluginCSharpWrapper.zip Have fun erwin Quote Link to comment
LonelyPixel Posted April 6, 2010 Share Posted April 6, 2010 Interesting project design. But wouldn't it as well be possible to just create two projects in a VS solution, a C++ and a C# one, have them built as usual and add a [project reference to the C# project] to the C++ project? Would that result in two separate assembly files or just a single DLL for the C++ project? (I haven't worked with such multi-language solutions before.) Oh, and you can't create OSD plugins with this yet, can you? Just wondering about the missing COM interfaces in the C# section. This actually looks like a "regular" (unmanaged?) C++ plugin that can make use of .NET additions for certain tasks. But again, I'm not a managed C++ expert... (Grouping brackets added for readability reasons.) (Mit Deutsch wär das zur Abwechslung nicht passiert. ) Quote Link to comment
erwin Posted April 7, 2010 Author Share Posted April 7, 2010 But wouldn't it as well be possible to just create two projects in a VS solution, a C++ and a C# one, have them built as usual and add a [project reference to the C# project] to the C++ project? Would that result in two separate assembly files or just a single DLL for the C++ project? It should be possible, but as a multi-dll solution. Oh, and you can't create OSD plugins with this yet, can you? Just wondering about the missing COM interfaces in the C# section. This actually looks like a "regular" (unmanaged?) C++ plugin that can make use of .NET additions for certain tasks. You are right. The OSD-part is a outstanding task. I'm working on a C++-port of the Delphi OSD-COM sample source as you do for C#. Now (see the other thread) i'm hopeful you can contribute the port for C# and so this OSD stuff can be done in the C# part of this wrapper. BTW the C++ plugin is regular but managed (CLI). erwin Quote Link to comment
LonelyPixel Posted April 7, 2010 Share Posted April 7, 2010 I've just tried to compile it with Visual Studio 2005, after altering the version number in the sln and vcproj files. Here's the build error output: 1>------ Erstellen gestartet: Projekt: DVBViewerPlugin, Konfiguration: Debug Win32 ------ 1>Generate temp.netmodule 1>c:\KB\Computer\Source\DVBVC#\DVBViewerPlugin\C#\Source1.cs 1>c:\KB\Computer\Source\DVBVC#\DVBViewerPlugin\C#\Source2.cs 1> 1 Datei(en) kopiert. 1>Microsoft (R) Visual C# 2005, Compilerversion 8.00.50727.3053 1>für Microsoft (R) Windows (R) 2005 Framework, Version 2.0.50727 1>Copyright (C) Microsoft Corporation 2001-2005. Alle Rechte vorbehalten. 1>warning CS1668: Ungültiger Suchpfad C:\Programme\Microsoft Visual Studio 8\VC\atlmfc\lib\i386 in LIB-Umgebungsvariable -- Das System kann den angegebenen Pfad nicht finden. . 1>warning CS1668: Ungültiger Suchpfad C:\Programme\Microsoft Visual Studio 8\lib in LIB-Umgebungsvariable -- Das System kann den angegebenen Pfad nicht finden. . 1>Kompilieren... 1>DVBViewerPlugin.cpp 1>.\C++\DVBViewerPlugin.cpp(121) : warning C4793: "Deklaration innerhalb von #pragma unmanaged.": Systemeigener Code für die void doIt(void)-Funktion wird generiert. 1> .\C++\DVBViewerPlugin.cpp(105): Siehe Deklaration von 'doIt' 1>.\C++\DVBViewerPlugin.cpp(122) : error C3821: "DVBViewerPlugin::Source1 ^": Ein verwalteter Typ oder eine verwaltete Funktion kann nicht in einer nicht verwalteten Funktion verwendet werden. 1>.\C++\DVBViewerPlugin.cpp(122) : error C3821: "DVBViewerPlugin::Source1": Ein verwalteter Typ oder eine verwaltete Funktion kann nicht in einer nicht verwalteten Funktion verwendet werden. 1>.\C++\DVBViewerPlugin.cpp(122) : error C3642: 'DVBViewerPlugin::Source1::Source1(void)' : Mit der __clrcall-Aufrufkonvention aus systemeigenem Code kann keine Funktion aufgerufen werden. 1>.\C++\DVBViewerPlugin.cpp(122) : error C3175: 'DVBViewerPlugin::Source1::Source1': Eine Methode eines verwalteten Typs kann nicht von einer nicht verwalteten Funktion 'doIt' aufgerufen werden 1>.\C++\DVBViewerPlugin.cpp(123) : error C3821: "src1": Ein verwalteter Typ oder eine verwaltete Funktion kann nicht in einer nicht verwalteten Funktion verwendet werden. 1>.\C++\DVBViewerPlugin.cpp(123) : error C3821: "DVBViewerPlugin::Source1::ShowMessage": Ein verwalteter Typ oder eine verwaltete Funktion kann nicht in einer nicht verwalteten Funktion verwendet werden. 1>.\C++\DVBViewerPlugin.cpp(123) : error C3821: "System::String": Ein verwalteter Typ oder eine verwaltete Funktion kann nicht in einer nicht verwalteten Funktion verwendet werden. 1>.\C++\DVBViewerPlugin.cpp(123) : error C3642: 'void DVBViewerPlugin::Source1::ShowMessage(System::String ^)' : Mit der __clrcall-Aufrufkonvention aus systemeigenem Code kann keine Funktion aufgerufen werden. 1>.\C++\DVBViewerPlugin.cpp(123) : error C3175: 'DVBViewerPlugin::Source1::ShowMessage': Eine Methode eines verwalteten Typs kann nicht von einer nicht verwalteten Funktion 'doIt' aufgerufen werden 1>Das Buildprotokoll wurde unter "file://c:\KB\Computer\Source\DVBVC#\DVBViewerPlugin\Debug\BuildLog.htm" gespeichert. 1>DVBViewerPlugin - 9 Fehler, 1 Warnung(en) ========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ========== It doesn't like the managed/unmanaged thing at all it seems. Any idea? Quote Link to comment
erwin Posted April 8, 2010 Author Share Posted April 8, 2010 Visual Studio 2005 with errors - 2008 without. Strange! Maybe because the declaration of doIt() is in the scope of the "#pragma unmanaged" and the definition is in the scope of "#pragma managed"? Try to rearrange parts of the code or insert "#pragma managed" before the doIt() declaration and "#pragma unmanaged" after it. erwin Quote Link to comment
LonelyPixel Posted April 8, 2010 Share Posted April 8, 2010 I removed the forward declaration of doIt() and moved the doIt function implementation to its place, surrounded by #pragma {,un}managed. That did the trick. The plug-in did successfully compile and run. Quote Link to comment
nuts Posted December 2, 2010 Share Posted December 2, 2010 Kann es sein, dass mit visual studio (express) 2010 die Projektdateien nichtmehr geladen werden können? Oder bin ich nur zu doof? Quote Link to comment
erwin Posted December 6, 2010 Author Share Posted December 6, 2010 Soweit ich weiss, sind die EXPRESS Versionen jeweils nur für eine Sprache also entweder für C++ oder für C#. erwin Quote Link to comment
nuts Posted December 6, 2010 Share Posted December 6, 2010 Jap da hab ich schon die richtige installiert. Quote Link to comment
erwin Posted December 6, 2010 Author Share Posted December 6, 2010 EXPRESS Ja oder nein. Die Solution ist eine Mischsprachen (C++ und C#)-Lösung. Sollte also unter EXPRESS-Versionen (die ja jeweils nur eine Sprache unterstützen) nicht gehen. erwin Quote Link to comment
nuts Posted December 6, 2010 Share Posted December 6, 2010 Hm das wirds wohl sein Quote Link to comment
VinoRosso Posted August 2, 2011 Share Posted August 2, 2011 (edited) uralter thread, aber was kann man damit machen? mangels delphi und delphi kenntnissen kam ich bisher nicht in das vergnügen ein plugin zu schreiben ;-) ist es damit möglich per c# und visual studio die com schnittstelle anzusprechen? mehr bräuchte ich nämlich nicht.... MFG Vino Edited August 2, 2011 by VinoRosso Quote Link to comment
dbraner Posted August 3, 2011 Share Posted August 3, 2011 uralter thread, aber was kann man damit machen? mangels delphi und delphi kenntnissen kam ich bisher nicht in das vergnügen ein plugin zu schreiben ;-) ist es damit möglich per c# und visual studio die com schnittstelle anzusprechen? mehr bräuchte ich nämlich nicht.... MFG Vino Das geht mit C# oder auch C++ auch ohne das Plugin Framework. In C# einfach das DVBViewer Interface einbinden. Dann kann man die COM Schnittstelle z.B. so ansprechen: DVBViewer dvb = (DVBViewer)System.Runtime.InteropServices.Marshal.GetActiveObject("DVBViewerServer.DVBViewer"); dvb.OSD.ShowInfoinTVPic("Testmessage", 3000); Such mal in diesem Unterforum. Es gibt einige Beispiele, wie man das COM-Interface per C#, C++, VB-Script oder auch AutoIt anspricht. Quote Link to comment
VinoRosso Posted August 3, 2011 Share Posted August 3, 2011 Ja aber dann muss man mein Programm extra starten. that suxx ein Plugin wird mit dem Viewer gestartet, das ist was ich möchte.... und sowas ist imho momentan nur mit delphi möglich, und dat habsch ned. Quote Link to comment
erwin Posted August 6, 2011 Author Share Posted August 6, 2011 und sowas ist imho momentan nur mit delphi möglich, und dat habsch ned. Nein der oben genannte wrapper gestattet C#. Mit C/C++ gehts auch: http://www.DVBViewer.tv/forum/topic/33691-c-anfang/ Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.