INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: .NET control building procedure  (Read 3975 times)

Cephlen

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 98
  • someday I will find a pic that looks good...
.NET control building procedure
« on: November 21, 2002, 10:36:13 am »

Ok.. I have my control that builds ok.

However, I am not able to add it to MJ9.  I goto plugins, and select add new.  I navigate to the location of my DLL and select it.  I get an error message:
Unsupported plugin type.  The plugin can not be installed.

This code is pretty much a copy n paste with some porting from vb to C#.

Just wondering what needs to be done / is different.

Thanks..
Logged
All ICQ's are ignored unless I have added you.

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41934
  • Shoes gone again!
Re: .NET control building procedure
« Reply #1 on: November 22, 2002, 05:49:59 am »

I'm not sure "Plugin Manager->Add" works for interface plugins. (though should make it so it does)

So, you'll need to add info to the registry to tell MJ the plugin exists.  Check out some of the samples in the Developer's Zone for an example.
Logged
Matt Ashland, JRiver Media Center

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20048
Re: .NET control building procedure
« Reply #2 on: November 22, 2002, 08:32:36 am »

Something RhinoBanga Helped me with

Note the [Registry] thats where the Install tells MJ the plugin Exists.

I basicly took what he had and played with it untill it worked.


; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
Compression=bzip
OutputBaseFilename=Chart Finder - Installer
AppName=Media Jukebox Chart Finder
AppVerName=Media Jukebox Chart Finder 1.0.15
AppPublisher=Mark Farmer
AppPublisherURL=http://home.nc.rr.com/mycddblookup/index.html
AppSupportURL=http://home.nc.rr.com/mycddblookup/index.html
AppUpdatesURL=http://home.nc.rr.com/mycddblookup/index.html
DefaultDirName={pf}\Mark Farmer\Chart Finder
DefaultGroupName=Mark Farmer\Chart Finder
AlwaysCreateUninstallIcon=yes

[Files]
Source: "C:\00 - MJ Plug-Ins\Chart Finder\ChartFinder.ocx"; DestDir: "{app}"; CopyMode: alwaysoverwrite; Flags: restartreplace regserver

Source: "C:\00 - MJ Plug-Ins\Chart Finder\Top 100 Billboard.csv"; DestDir: "{app}"; CopyMode: alwaysoverwrite
Source: "C:\00 - MJ Plug-Ins\Chart Finder\U.K. Top 40.csv"; DestDir: "{app}"; CopyMode: alwaysoverwrite
Source: "C:\00 - MJ Plug-Ins\Chart Finder\U.S.A. Country Countdown.csv"; DestDir: "{app}"; CopyMode: alwaysoverwrite
Source: "C:\00 - MJ Plug-Ins\Chart Finder\Rick Dees Top Hits.csv"; DestDir: "{app}"; CopyMode: alwaysoverwrite
Source: "C:\00 - MJ Plug-Ins\Chart Finder\Argentina Top Hits.csv"; DestDir: "{app}"; CopyMode: alwaysoverwrite

Source: "C:\WINNT\system32\mscomctl.ocx"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: restartreplace sharedfile regserver
Source: "C:\WINNT\system32\msstkprp.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: restartreplace sharedfile regserver

Source: "C:\WINNT\system32\tabctl32.ocx"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: restartreplace sharedfile regserver
Source: "C:\WINNT\system32\comct232.ocx"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: restartreplace sharedfile regserver

[Registry]
Root: HKCU; Subkey: "Software\Mark Farmer"; Flags: uninsdeletekeyifempty
Root: HKCU; Subkey: "Software\Mark Farmer\Chart Finder"
Root: HKCU; Subkey: "Software\JRiver\Music Exchange\1.0\Media Jukebox\Plugins\Interface\Chart Finder"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\JRiver\Music Exchange\1.0\Media Jukebox\Plugins\Interface\Chart Finder"; ValueName: "IVersion"; Flags: uninsdeletevalue; valuetype: dword; valuedata: 1;
Root: HKCU; Subkey: "Software\JRiver\Music Exchange\1.0\Media Jukebox\Plugins\Interface\Chart Finder"; ValueName: "Company"; Flags: uninsdeletevalue; ValueType: string; valuedata: "KingSparta Software, Inc";
Root: HKCU; Subkey: "Software\JRiver\Music Exchange\1.0\Media Jukebox\Plugins\Interface\Chart Finder"; ValueName: "Version"; Flags: uninsdeletevalue; ValueType: string; valuedata: "1.0.15";
Root: HKCU; Subkey: "Software\JRiver\Music Exchange\1.0\Media Jukebox\Plugins\Interface\Chart Finder"; ValueName: "URL"; Flags: uninsdeletevalue; ValueType: string; valuedata: "http://home.nc.rr.com/mycddblookup/index.html";
Root: HKCU; Subkey: "Software\JRiver\Music Exchange\1.0\Media Jukebox\Plugins\Interface\Chart Finder"; ValueName: "Copyright"; Flags: uninsdeletevalue; ValueType: string; valuedata: "Copyright (c) 2002, KingSparta.";
Root: HKCU; Subkey: "Software\JRiver\Music Exchange\1.0\Media Jukebox\Plugins\Interface\Chart Finder"; ValueName: "PluginMode"; Flags: uninsdeletevalue; ValueType: dword; valuedata: 1;
Root: HKCU; Subkey: "Software\JRiver\Music Exchange\1.0\Media Jukebox\Plugins\Interface\Chart Finder"; ValueName: "ProdID"; Flags: uninsdeletevalue; ValueType: string; valuedata: "ChartFinder.ChartFinderCtrl";

[InstallDelete]
Type: filesandordirs; name: "{group}"
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio
https://MyAAGrapevines.com
Fayetteville, NC, USA

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41934
  • Shoes gone again!
Re: .NET control building procedure
« Reply #3 on: November 22, 2002, 09:05:58 am »

For plugin installation in version 9,

HKCU\Software\JRiver\Music Exchange\1.0\Media Jukebox\Plugins

should be:

HKLM\Software\JRiver\Media Jukebox\Plugins

Settings should still go in HKCU.

Hope that helps.
Logged
Matt Ashland, JRiver Media Center

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20048
Re: .NET control building procedure
« Reply #4 on: November 22, 2002, 10:00:57 am »

Just So I Am Straight

So:

Root: HKCU; Subkey: "Software\JRiver\Music Exchange\1.0\Media Jukebox\Plugins\Interface\Chart Finder"

Should Be: (for MJ9)

Root: HKLM; Subkey: "Software\JRiver\Media Jukebox\Plugins\Interface\Chart Finder"

Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio
https://MyAAGrapevines.com
Fayetteville, NC, USA

Cephlen

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 98
  • someday I will find a pic that looks good...
Re: .NET control building procedure
« Reply #5 on: November 22, 2002, 10:36:26 am »

Ok guys,

I go into VS.net and choose new project.  I select a language, and Windows Control Library.

I add reference to the MJ TLB.

I add the
Dim g_MJ As MediaJukebox.MJAutomation
Public Function Init(ByVal MediaJukebox As Object)
     Set g_MJ = MediaJukebox
End Function

lines, build.   Copy into MJ plugin dir.  Run MJ,  Tools->plugins->add plugin.

I get the error.

I create a registry, and can see it in the tree, select it, same error.

What am I doing wrong?
Logged
All ICQ's are ignored unless I have added you.

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41934
  • Shoes gone again!
Re: .NET control building procedure
« Reply #6 on: November 22, 2002, 10:44:37 am »

King, that's right.  However, we copy any stuff in the old folder on startup, so you might not have to change the plugin.

Cephlen, ifyou install the Sleep Timer, you can see an example of what needs to be in the registry.  But keep in mind, the Sleep Timer is putting the entries in the old spot, because it hasn't been updated yet.  Sorry it's all a bit messy still...
Logged
Matt Ashland, JRiver Media Center

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20048
Re: .NET control building procedure
« Reply #7 on: November 22, 2002, 11:42:26 am »

>> However, we copy any stuff in the old folder on
>> startup, so you might not have to change the plugin.
Ok
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio
https://MyAAGrapevines.com
Fayetteville, NC, USA

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20048
Re: .NET control building procedure
« Reply #8 on: November 22, 2002, 11:46:52 am »

>> What am I doing wrong?

If your just copying the plugin to the plugin dir

Create The Registry.reg file should be in sample, edit it, and run it from within the Plug-ins dir (Dbl Click on it)
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio
https://MyAAGrapevines.com
Fayetteville, NC, USA

Cephlen

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 98
  • someday I will find a pic that looks good...
Re: .NET control building procedure
« Reply #9 on: November 25, 2002, 10:54:55 am »

Its a no go...

I can not get a new blank/empty .net dll control to work inside MJ9.

I guess I will have to continue work in VB.
Logged
All ICQ's are ignored unless I have added you.

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20048
Re: .NET control building procedure
« Reply #10 on: November 25, 2002, 03:58:23 pm »

I played with .Net a bit not sure I like it, maybe the next version will be better.

I Also think I need more books to read and just set down one week off and just play with it.
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio
https://MyAAGrapevines.com
Fayetteville, NC, USA

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41934
  • Shoes gone again!
Re: .NET control building procedure
« Reply #11 on: November 26, 2002, 04:30:55 am »

Cephlen,

I'm not sure if .NET objects work where COM objects are expected, so it may be impossible.

Can a .NET object be built in a "backwards compatible" way, or can you make a .NET project that's an old-style COM object?

Sorry we're in the dark... maybe someone else will know more.
Logged
Matt Ashland, JRiver Media Center

salsbst1

  • Regular Member
  • World Citizen
  • ***
  • Posts: 244
Re: .NET control building procedure
« Reply #12 on: April 29, 2003, 02:49:47 pm »

Quote
Cephlen,

I'm not sure if .NET objects work where COM objects are expected, so it may be impossible.

Can a .NET object be built in a "backwards compatible" way, or can you make a .NET project that's an old-style COM object?

Sorry we're in the dark... maybe someone else will know more.


.NET objects do not have COM interfaces.  One can get around this, though.  See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkcominteroppart2cservertutorial.asp

I would assume that this will work for MC.

Also, the registry paths above are now outdated.  Can't recall the correct ones now, but there's info in another thread (or just look in your registry!).

Regards,
Stuart
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:.NET control building procedure
« Reply #13 on: October 14, 2003, 01:36:27 am »

Dont know if this has been addressed since it was posted, but I've just successfuly built a .net plugin.

You need to make sure that you've got your plugin registered for COM Interop. To do this, right click on your control library in the solution explorer, hit properties, goto configuration properties->build and check "Register for COM Interop"

Also make sure your ProdID in your registry import is of the format "[ControlLibraryName].[ControlName]' , eg. MyControlLib.MyControl

Oh, and make sure to change the line that reads "Public Class UserControl1" to "Public Class [ControlName]".

Um, I think thats it.. I may have forgotten something.


Scott
Logged

mi5

  • Regular Member
  • Recent member
  • *
  • Posts: 16
Re: .NET control building procedure
« Reply #14 on: October 27, 2003, 03:45:49 pm »

Cephlen,

I'm not sure if .NET objects work where COM objects are expected, so it may be impossible.

Can a .NET object be built in a "backwards compatible" way, or can you make a .NET project that's an old-style COM object?

Sorry we're in the dark... maybe someone else will know more.

Matt,  .NET works with Assemblies rather than COM objects, but it can generate something called a Com-Callable Wrapper (CCW) around an Assemblie to make it look like a COM object. Now, whether this is completely compatible with MJ is not a given, but the wrapper is registered in the same way as a COM object.  I'm assuming that the original poster has done that, since he was referring to registry entries.

By the way, I was attempting to go in the opposite direction, to get to COM-based functions of MJ via a standalone .NET EXE  (Still trying to list all the MP3 files in your database).  It looks like I may have misinterpreted some of the posts here, cause I haven't been able to access Automation methods via the standalone EXE.  I've referred to that in another thread, so I'll try to follow up in that thread:

http://yabb.jriver.com/interact/index.php?board=6;action=display;threadid=16371
Logged
Pages: [1]   Go Up