NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 27 28 29 30 31 … 93 Next »
Newbies needs help writing plugin!

 
  • 0 Vote(s) - 0 Average
Newbies needs help writing plugin!
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#1
2008-11-25, 10:00 PM
Made you look! OK. I've asked this so many times, even I'm getting sick of it, but I'm ready to start digging into making a plugin/skin.

Problem is the very first thing: I don't get the concept of my development space, program files, compiling, test environment...

In the VB6, non-plugin days, I write, I compile onto my production machine, and try it out.

Now I have a dll, a skin, and tricking GB-PVR into believing my dev tools is a compiled dll.

I'm thinking of getting my ideas (and stealing heavily) from the DVD ripper in VB.net.

I believe it's already been converted into vb.net, so that's the hard part (I think)

But what's a braod view of how I'll be developing, compiling and testing...?

Thanks.
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#2
2008-11-25, 10:15 PM
Developing:
http://www.microsoft.com/express/product/default.aspx

Debugging:
Change project output to the gbpvr/plugins/yourplugin
Set pvrx2.exe as the 'start up exe' in project properties.

Best advice is to look at some examples:
http://gbpvr.com/pmwiki/pmwiki.php/Devel...odeSamples
http://gbpvr.com/pmwiki/pmwiki.php/Plugin/Games
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#3
2008-11-26, 12:35 AM
OK. Here goes. Downloaded Hello World (VB.net)

I'm using VB express 2008 so it needs to convert. No errors..

Won't run (compile and run) that's cuz it's a dll and needs to be called.

I can build into the Plugin/HelloWorld Directory (Also created example skin in skin2 dir)

GB-PVR config shows it's there.

Now when I try to 'set pvrx2.exe to start up' I'm stumped. I assume that I'm making this reference so that when I debug/ compile/run it also starts PVRX2 so I can test it, and that the compile process is satisfied that there is a host app. I might be wrong.

I looked this up: First hit

http://social.msdn.microsoft.com/Forums/...db936a3cc/

Well it's telling me to create a new Windows form App, with maybe a button to call some code off the class. But I don't think I want to recreate the wheel (sub's done such a good job)... so I can't find where I tell my ide to launch the proper PVRX2.

I thought maybe adding pvrx2 to references, but that's a stab...

I believe I have confirmed that the app knows the paths to the gbpvr specific dlls.

There is command line parameters and working directory, but I think I'm in the wrong place...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#4
2008-11-26, 01:10 AM
Since you are using the express version, the dialogs for setting the startup .exe are disabled.

You will have to hack the project file. I don't know how to do that for VB, but it is probably similar to the C# project file. There are some instructions for C# in the WizTools walkthru document.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,591
Threads: 386
Joined: Dec 2004
#5
2008-11-26, 01:11 AM
I don't try to debug from within the VS IDE - I'm not sure how to do it either.

Just make sure you're generating a pdb file and it's being output to the plugin folder. Log everything you think needs logging to a .log file, try...catch blocks around everything that does anything clever.

When you do this just fire up pvrx2 and use the plugin - if the pdb file is there and your catch block is logging the exceptions, it will show the line of code that generated the exception.
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#6
2008-11-26, 01:29 AM
For C#, the project file has the .csproj extension. The section that needs to be updated is as follows:

Code:
<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">[COLOR=red]Debug[/COLOR]</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.21022</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{88C6D285-9154-4A79-89F9-7E4CD496CC4E}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>SearchWizX2</RootNamespace>
    <AssemblyName>SearchWizX2</AssemblyName>
[B][COLOR=red]<StartProgram>$(GBPVR)\pvrx2.exe</StartProgram>[/COLOR][/B]
[B][COLOR=red]<StartAction>Program</StartAction>[/COLOR][/B]
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
    <OldToolsVersion>2.0</OldToolsVersion>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
  </PropertyGroup>

Where $GBPVR resolves to the gbpvr root directory.

I've also created another section (Debug Config), where the startup EXE is config.exe. This allows me to debug the config form for my plugin.

Code:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug [COLOR=red]Config[/COLOR]|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\Debug Config\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugType>full</DebugType>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
[B][COLOR=red]  <StartProgram>$(GBPVR)\config.exe</StartProgram>[/COLOR][/B]
[B][COLOR=red]  <StartAction>Program</StartAction>[/COLOR][/B]
  </PropertyGroup>
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#7
2008-11-26, 04:53 AM
JavaWiz Wrote:Where $GBPVR resolves to the gbpvr root directory.

That's a variable I had to set?

I'm pretty sure that I can hack the VB file in the same way, Only guessing though.

Why do you want to set the startup app. Isn't the dll (or pdb) called when GB-PVR calls it?
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#8
2008-11-26, 04:58 AM
zehd Wrote:That's a variable I had to set?
Yes. In my environment, it is set as:
GBPVR=c:\Program Files\devnz\gbpvr
Quote:I'm pretty sure that I can hack the VB file in the same way, Only guessing though.

Why do you want to set the startup app. Isn't the dll (or pdb) called when GB-PVR calls it?
What that means is, when in the IDE you select 'Start Debugging', it launches pvrx2.exe (or config.exe), as it hits the first breakpoint in your DLL, the process stops, and the editor position on the breakpoint line. At that point, you can interrogate (or change) variables, single step, reset the execution point,...
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#9
2008-11-26, 05:36 AM
Actually, just found an easier way to enable debugging (based on this article)

In a nutshell, create a text file with the same name as your project file with .user on the end (for example SearchWizX2.vbproj.user). Paste the following in that file:

Code:
<Project xmlns="[URL]http://schemas.microsoft.com/developer/msbuild/2003[/URL]">
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>$(GBPVR)\pvrx2.exe</StartProgram>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug Config|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>$(GBPVR)\config.exe</StartProgram>
  </PropertyGroup>
</Project>
Now you can debug either the Plugin DLL by selecting the "Debug" configuration, or the plugin config form by selecting the "Debug Config" configuration.

This template will work for any plugin, you simply have to copy to target directory and rename.

Also, this solution works for C# (the project file extension is .csproj.user instead of .vbproj.user)
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#10
2008-11-26, 03:43 PM
JavaWiz Wrote:Actually, just found an easier way to enable debugging (based on this article)

In a nutshell, create a text file with the same name as your project file with .user on the end (for example SearchWizX2.vbproj.user). Paste the following in that file:

Code:
<Project xmlns="[URL]http://schemas.microsoft.com/developer/msbuild/2003[/URL]">
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>$(GBPVR)\pvrx2.exe</StartProgram>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug Config|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>$(GBPVR)\config.exe</StartProgram>
  </PropertyGroup>
</Project>
Now you can debug either the Plugin DLL by selecting the "Debug" configuration, or the plugin config form by selecting the "Debug Config" configuration.

This template will work for any plugin, you simply have to copy to target directory and rename.

Also, this solution works for C# (the project file extension is .csproj.user instead of .vbproj.user)

BTW, thanks all so far. This is silly difficult because it's so alien. I'm working on it...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 3,065 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,545 2020-11-14, 08:01 PM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 3,627 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,993 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,859 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,310 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 2,020 2013-03-12, 06:48 AM
Last Post: psycik
  Plugin problems with started from the command line mvallevand 11 5,213 2012-08-12, 07:56 PM
Last Post: sub
  Get NextPVR data directory from outside a plugin McBainUK 3 2,329 2012-02-11, 05:42 PM
Last Post: mvallevand
  Weather Plugin imilne 0 1,497 2012-01-15, 08:33 PM
Last Post: imilne

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode