2010-11-28, 05:49 PM
(This post was last modified: 2010-11-28, 06:50 PM by kindt nick.)
Hi,
I'm trying to make a LCD/VFD interface plugin for all iMon.
Problem is that the API should be written in C++...
I already got the code for IEventNotification up and running but only in c#...
Would anybody care to help me out (short) converting this code to c++ code?
I've been trying all day but sinds I'm an embedded programmer, no luck...
Also searched in the forum, downloaden source code from the wiki... still crap...
It is based on the code that was generated here:
http://forums.gbpvr.com//showthread.php?47939-NPVR-IEventNotification&p=388441&highlight=#post388441
I already have this:
But I can't seem to figure out how to convert the following lines into cc++ code:
also, am I working the correct way? Declaring the entire class in the header and just create an instance int the code file?
Thx in advance!
Nick
I'm trying to make a LCD/VFD interface plugin for all iMon.
Problem is that the API should be written in C++...
I already got the code for IEventNotification up and running but only in c#...
Would anybody care to help me out (short) converting this code to c++ code?
I've been trying all day but sinds I'm an embedded programmer, no luck...
Also searched in the forum, downloaden source code from the wiki... still crap...
It is based on the code that was generated here:
http://forums.gbpvr.com//showthread.php?47939-NPVR-IEventNotification&p=388441&highlight=#post388441
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using NUtility;
using NUtility.Base;
using NUtility.Controls;
namespace nPVR_iMON_API
{
public class TestEventNotify : IEventNotification
{
//
public TestEventNotify()
{
Logger.Debug("nPVR_iMON_API: Testing; Debug Message System...");
Logger.Error("nPVR_iMON_API: Testing; Error Message System...");
Logger.Info("nPVR_iMON_API: TestEventNotify v" + this.GetType().Assembly.GetName().Version.ToString() + " called by 'nPVR_iMON_API'-plugin");
EventBus.GetInstance().AddListener(this);
}
public void Notify(string eventType, object eventText)
{
try
{
Logger.Debug("nPVR_iMON_API: EventType; " + eventType.ToString());
Logger.Debug("nPVR_iMON_API: EventText; " + eventText.ToString());
}
catch (Exception ex)
{
Logger.Error("nPVR_iMON_API: Exception Message; " + ex.Message);
Logger.Error("nPVR_iMON_API: Exception; " + ex.ToString());
}
}
}
}
I already have this:
Code:
using namespace System::Text;
using namespace NUtility;
using namespace NUtility::Base;
using namespace NUtility::Controls;
using namespace std;
public ref class cTestEventNotify : public IEventNotification // Defining the class
{
public:
cTestEventNotify(); // Constructor
//~cTestEventNotify(); // Destructor
virtual void Notify(System::String^ eventType,
System::Object^ eventText);
};
///Constructors can accept arguments, but this one does not
cTestEventNotify::cTestEventNotify()
{
Logger::Debug("nPVR_iMON_API: Testing; Debug Message System...");
Logger::Error("nPVR_iMON_API: Testing; Error Message System...");
//Logger::Info("nPVR_iMON_API: TestEventNotify v" + this::GetType()::Assembly.GetName()::Version::ToString() + " called by 'nPVR_iMON_API'-plugin");
//EventBus::GetInstance();
//EventBus::AddListener(this);
};
void cTestEventNotify::Notify(System::String^ eventType,
System::Object^ eventText)
{
};
// This is the main DLL file.
#include "stdafx.h"
#include "nPVR_iMON_API_cpp.h"
//cTestEventNotify fTestEventNotify;
But I can't seem to figure out how to convert the following lines into cc++ code:
Code:
[COLOR=darkred]EventBus.GetInstance().AddListener(this);[/COLOR]
Logger.Info("nPVR_iMON_API: TestEventNotify v" + this.GetType().Assembly.GetName().Version.ToString() + " called by 'nPVR_iMON_API'-plugin");
also, am I working the correct way? Declaring the entire class in the header and just create an instance int the code file?
Thx in advance!
Nick