INTERACT FORUM

Windows => Plug-in Development => Topic started by: KingSparta on March 25, 2007, 06:08:15 pm

Title: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on March 25, 2007, 06:08:15 pm
Someone Asked Me How To Create A Field In The JRiver SDK This Is A VB6 Sample, Along With VB6 Source Code.

I Hate .Net

You May Need To Tell MC Plug-In Manager To Show It

(http://www.spartasoftware.com/MC-Plugins/12/Create%20Field/Create%20Field%20-%2001.png)

Install Plug-In:

http://www.spartasoftware.com/MC-Plugins/12/Create%20Field/Create%20Field.exe (http://www.spartasoftware.com/MC-Plugins/12/Create%20Field/Create%20Field.exe)

VB6 Source Code:

http://www.spartasoftware.com/MC-Plugins/12/Create%20Field/Source%20Code/Create%20Field.Zip (http://www.spartasoftware.com/MC-Plugins/12/Create%20Field/Source%20Code/Create%20Field.Zip)

The Code

Code: [Select]
Public g_MC As MediaCenter.MCAutomation
Option Explicit
Dim MyBAllowEdit As Boolean
Dim MyBSaveInTag As Boolean

Public Function Init(ByVal MediaCenter As Object)
    On Error Resume Next           '
    ' set the global Media Jukebox object on init                    '
    ' (Media Jukebox will call this function when the plugin starts) '
    Set g_MC = MediaCenter
End Function
Private Sub CreateFieldCMD_Click()
    On Error Resume Next
    CreateFieldSub FieldNameTXT.Text, DisplayFieldNameTXT.Text
   
End Sub
Private Sub CreateFieldSub(MyStrFieldName As String, MyStrDisplayName As String)
    On Error GoTo ErrHdlr
    If Option1(1) = True Then
        MyBAllowEdit = False
    Else
        MyBAllowEdit = True
    End If
    If Option1(3) = True Then
        MyBSaveInTag = False
    Else
        MyBSaveInTag = True
    End If
    '
    Dim MCCreateField As IMJFieldsAutomation
    Set MCCreateField = g_MC.GetFields
    MCCreateField.CreateFieldSimple MyStrFieldName, MyStrDisplayName, MyBAllowEdit, MyBSaveInTag
    MsgBox ("Field Created")
    Exit Sub

ErrHdlr:
    MsgBox ("Error Creating Field")

End Sub
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on March 26, 2007, 01:04:54 pm
Actually I Don't Think This Is Working All That Good...

JRiver - Is Not bAllowEdit And bSaveInTag Boolean?

If It Is, Then there Is Something Wrong With The SDK

Where Edit Field Works But SaveInTag Does Not
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on March 26, 2007, 05:16:59 pm
Actually I Don't Think This Is Working All That Good...

JRiver - Is Not bAllowEdit And bSaveInTag Boolean?

If It Is, Then there Is Something Wrong With The SDK

Where Edit Field Works But SaveInTag Does Not

Agreed
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on March 26, 2007, 05:20:13 pm
i take it you have the same results
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on March 26, 2007, 05:23:41 pm
Yup =)  You'd think we were using the same SDK or something ;-)

I've added a link to your code to the sticky post btw.
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on March 27, 2007, 02:58:41 pm
Can you be more explicit? I created a field, with bSaveInTag true, and it saved it in the tag part of the file...

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on March 27, 2007, 04:13:17 pm
If you create a field with bSaveInTag set to true,
then go to options and look at the library field,
the tick box isn't checked saying that it will be stored in the tags where possible.
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on March 27, 2007, 04:48:21 pm
If you create a field with bSaveInTag set to true,
then go to options and look at the library field,
the tick box isn't checked saying that it will be stored in the tags where possible.

Correct

Edit: As In A Star Trek Show (Voyager) I Seen Today

"We Are Borg, Our thoughts are one"
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on March 28, 2007, 10:49:34 am
Sorry, it's working fine for me. Maybe I'm not borgish enough?
Are you using the latest version?

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on March 28, 2007, 10:59:54 am
I'm testing on Build 196.
I'm using the .NET script plugin, which still uses the MC11 interface dll,
since I've not got round to updating the .NET  Wrapper assembly as yet.

Since Kings using VB6 though which doesn't use
a wrapper, I doubt it's that.
I used the following code
____________________________________________________
Imports System
' //css_reference System.dll;
' //css_reference MediaCenter.dll;
Module Script       
   
    Sub Init( mediaCenterInterface as MediaJukebox.MJAutomation, outputTextBox as object)
                 
        CreateFieldSub(mediaCenterInterface, "TestField", "TestDisplayName", true, true)
       
    End Sub     
   
    Private Sub CreateFieldSub(ByVal mediaCenterInterface as MediaJukebox.MJAutomation, ByVal MyStrFieldName As String, ByVal MyStrDisplayName As String, ByVal MyBAllowEdit As Boolean, ByVal MyBSaveInTag As Boolean)
        Dim MCCreateField As MediaJukebox.IMJFieldsAutomation
        MCCreateField = mediaCenterInterface.getfields
        MCCreateField.CreateFieldSimple(MyStrFieldName, MyStrDisplayName, MyBAllowEdit, MyBSaveInTag)
    End Sub

   
End Module
________________________________

Then went to the Configure Library Field Area.
And here's what came up.

Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on March 28, 2007, 11:23:26 am
Your true value isn't anything peculiar I take it?
The field MyBSaveInTag is coming up as an integer.
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on March 28, 2007, 12:10:45 pm
Anything non-zero is true.

I've stuck a logging line in to make sure the right value is getting passed. When the next version comes out, give it a try and post the SDK log here.

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on March 28, 2007, 05:32:44 pm
The results are in....

0054304: 4348: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0054304: 4348: SDK: CMJFieldsAutomation::CreateFieldSimple: Save In Tag: TRUE
0054320: 4348: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (16 ms)
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on March 28, 2007, 05:55:38 pm
And you double-checked to make sure the box isn't checked (in the display box showing the field details), right?

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on March 28, 2007, 06:04:06 pm
The Log States True

But The Box Is Not Checked

PS: Sue Is Resting In The Hosp Overnight, I Just Got Home.

I Hope I Can Bring Her Home Tomorrow.
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on March 28, 2007, 06:07:18 pm
And you double-checked to make sure the box isn't checked (in the display box showing the field details), right?

j


Yup, and it's Exactly the same as shown in my screenshot above,
for the previous run.
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on March 28, 2007, 06:14:33 pm
It kind of reminds me of the commercial where the guy is flipping the switch to see what it goes to, but the wife said nope it's not working.

Two houses down the street the garage door is opening and closing on the hood of this ladies car.

Maybe True turns on and off the wrong switch
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on March 28, 2007, 08:23:25 pm
But it is working for me... I'll put some more logging in tomorrow, we'll track it down eventually.

King - best wishes for you and Sue...

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on March 29, 2007, 06:08:44 am
I slept with my dogs last night, they kept licking me, Climbing on me, and stepping on my head when I was sleeping.

They were happy

0062797: 2892: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0062797: 2892: SDK: CMJFieldsAutomation::CreateFieldSimple: Save In Tag: TRUE
0062797: 2892: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (0 ms)

(http://www.spartasoftware.com/MC-Plugins/12/Create Field/Configure Library Field - 01.png)
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on March 29, 2007, 12:04:22 pm
Quote
King - best wishes for you and Sue...

She Is Home Now, Walking Like She Has Been Riding A Horse 24\7 For A Week.
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on March 29, 2007, 01:56:27 pm
Figured it out: when the field already existed with the bSaveInTag being false, creating it would ignore the true value.
Fixed in the next build.

Hope Sue is walking better now, that sounds really painful...

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on March 29, 2007, 02:19:21 pm
Quote
Hope Sue is walking better now, that sounds really painful...

As the beatles sang (sort of) She will get by with a little help from her friend (Oxycodone\Acetaminophen & Ibuprofen 800 MG)
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on March 29, 2007, 08:10:07 pm
Quote
Figured it out: when the field already existed with the bSaveInTag being false, creating it would ignore the true value.
Fixed in the next build.

Still Not Working...
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on March 29, 2007, 09:52:41 pm
I thought I'd fixed it, I'll take another look tomorrow...

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 02, 2007, 03:21:12 pm
Sorry for the delay, it's been very hectic.

Would y'all try a test or two for me:

Create a brand new field with a brand new name, a name you've never used before. Make sure the bSaveInTag is true. Does it work?

Now do the same thing - again with a brand new name, but bSaveInTag is false. Then without deleting the field, create it with bSaveInTag as true. Does that work?

Thanks,

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on April 02, 2007, 03:47:20 pm
>> Create a brand new field with a brand new
>> name, a name you've never used before. Make sure the bSaveInTag is

Field: Test89246986901219827910

>> true. Does it work?
No

>> Now do the same thing - again with a brand new name, but
>> bSaveInTag is false. Then without deleting the field, create it
>> with bSaveInTag as true.

Field:Test089703e80972038702

>> Does that work?

No

Code: [Select]
Changed Code:

From:

MCCreateField.CreateFieldSimple MyStrFieldName, MyStrDisplayName, MyBAllowEdit, MyBSaveInTag

To

MCCreateField.CreateFieldSimple MyStrFieldName, MyStrDisplayName, MyBAllowEdit, True

Normally True Was Being Sent by A Option Button This Way I Forced Fed A True

It Still Does Not Work

Code: [Select]
Changed Code:

From:

MCCreateField.CreateFieldSimple MyStrFieldName, MyStrDisplayName, MyBAllowEdit, True

To:

MCCreateField.CreateFieldSimple MyStrFieldName, MyStrDisplayName, MyBAllowEdit, 1

Forcing a "1" Works And The Box Is Checked

I Take It MC12 Is Not Taking the Boolean "True" Or "False" setting


Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 02, 2007, 03:57:17 pm
Field: Test89246986901219827910

I think you used that name before  ;D

So, if I understand: using the word True in your code fails, but using the number 1 works?

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on April 02, 2007, 04:06:26 pm
I think you used that name before  ;D

So, if I understand: using the word True in your code fails, but using the number 1 works?

j


This Was with 12.0.202 by the way

Yes "True" Fails, But "1" Works
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 02, 2007, 04:52:57 pm
Okay, I've added some logging. Unfortunately, it won't be in the next build. Try 205 or later...

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 03, 2007, 10:37:48 am
Hi King... I thought you might not want to wait for a whole day, so I did a test build (sent via e-mail).

Mr. Chriz if you want in on the fun, let me know...

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 03, 2007, 11:04:01 am
Sent you a PM

I'm always up for more testing!  ;D
I get the same thing with the 1 for representing true working btw.

Cheers
Chris.
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 03, 2007, 11:28:33 am
Not sure if this is official but a quick test reveals that in .NET
true has a value of -1
false has a value of 0

Wikipedia reveals the same is the case for VB6.

Actually this seems to me to show a flaw in the .NET framework.
A boolean value shouldn't be seen to have an integer value in a modern
bubble wrapped coding system like .NET.

Technically it will have behind the scenes, but
by stopping you use it code remains more cross-platform compatible
and less likely to cause issues with different compilers etc.

In .NET you cannot cast a boolean to an integer. (Good)
However.... you can send a boolean to a function with an integer
parameter. (Not so good!)  The compiler should stop this really.

_________________________________________________

Looking at wiki entrys C++'s built in True maybe equal to 1
hence the reason why it's now working.   In which case....
you could say it's just the documenation that needs updating?
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on April 03, 2007, 12:45:32 pm
Thats Why It Does Not Work!

MC Should Check For False (Not True)

So If Not False (False=0) It Must be True

From VB6 Help

Code: [Select]
When othernumeric types are converted to Boolean values, 0 becomes False and all other values become True. When Boolean values are converted to otherdata types, False becomes 0 and True becomes -1.
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 03, 2007, 01:03:47 pm
A true value is non-zero, a false value is zero.
The constant 'true' is usually -1 (all bits set to 1).
Saying:
int foo = some boolean expression
if(foo)
is okay, it will do the correct thing if foo = 1, 3, -92 or -1.
Saying:
int foo = some boolean expression
if(foo == TRUE)
is incorrect. It will only do the correct thing for foo = 0 or -1.

But, the first thing I looked for was incorrect tests like that. They aren't there...

It's a red herring.

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 03, 2007, 01:29:03 pm
0003812: 4492: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0003812: 4492: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to ffffffff
0003812: 4492: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (0 ms)

_______________________________________________________

If you wanna try this yourself John and save the trying all the logging stuff
Here's a link to install my script plugin
http://yabb.jriver.com/interact/index.php?topic=38693.msg263180#new
The script I'm using is here
http://yabb.jriver.com/interact/index.php?topic=39660.msg270567#msg270567

Hit the new script button, select VB script,
then paste the code from the above link over the template code
Then hit the run button.


Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 03, 2007, 02:09:45 pm
Mr ChriZ,
Sorry, I wasn't clear: I need two runs, one with "true" and one with "1"

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 03, 2007, 02:17:16 pm
Run 1
_____________________________
0011391: 4700: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0011391: 4700: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to 1
0011391: 4700: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (0 ms)
_____________________________

Run True
_____________________________
0005625: 4700: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0005625: 4700: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to ffffffff
0005625: 4700: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (0 ms)
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 03, 2007, 03:01:16 pm
There's another version to try.
Use a brand new name for each test (one test is 'true', one test is '-1').
After creating the variable, go to the library field dialog to see if it is correct or not.
Post the log and the result here...

Thanks,

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 03, 2007, 03:20:44 pm
Is this new new version in the same place as the old new version?
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 03, 2007, 03:26:47 pm
yes, sorry...

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 03, 2007, 03:41:01 pm
New version downloaded.
New field typed in.
First test
Using true
Log Says:
______________________________________________________
0006890: 5752: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0006922: 5752: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to ffffffff
0006922: 5752: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (32 ms)
______________________________________________________
Field Says Store in Tags not ticked. 

Second Test
Using 1
Log Says
_____________________________________________________
0012531: 5752: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Start
0012531: 5752: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Setting m_bStoreInTags to 1
0012531: 5752: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Finish (0 ms)
_____________________________________________________
Field says Store in Tags Ticked.

3rd Test
Using -1
Log Says
______________________________________________________
0003265: 5752: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0003265: 5752: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to ffffffff
0003265: 5752: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (0 ms)
______________________________________________________
Field Says Store in Tags not ticked. 
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 03, 2007, 04:04:05 pm
Your log files are not complete. There should be CMJFieldsAutomation::CreateFieldSimple and CDatabaseFieldDlg::CDatabaseFieldDlg lines for each test.

Could you run it again?

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 03, 2007, 04:57:41 pm
Hi John.
I've just checked the logs, but those aren't in there.
I definitley redownloaded from the link you sent me in the email,
and reinstalled...  :-\
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 03, 2007, 10:18:24 pm
I'm really confused now. When you call CreateFieldSimple - the logging should be there, and it is, some of the time.

When you view the field dialog box, the logging should be there, and it is some of the time.

Sorry to ask this, but please try again, following the steps very carefully:
1) Clear the log.
2) Create the field
3) View the dialog box
4) View the log.

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 04, 2007, 01:37:28 pm
Sorry didn't see where you were going with this and done it in the wrong
order originally looking at the log before going to the dialogue.
Test -1
Tick box unticked
_____________________________________________________
0003922: 1956: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0003922: 1956: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to ffffffff
0003922: 1956: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (0 ms)

0008672: 1956: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Start
0008672: 1956: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Setting m_bStoreInTags to ffffffff
0008672: 1956: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Finish (0 ms)

0010563: 1956: SDK: CDatabaseFieldDlg::OnO: Start
0010563: 1956: SDK: CDatabaseFieldDlg::OnO: Setting m_bSavedInTag to 0 (user)
0010625: 1956: SDK: CDatabaseFieldDlg::OnO: Finish (62 ms)

_____________________________________________________


Test 1
Tick Box Ticked
_____________________________________________________
0003844: 1956: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0003859: 1956: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to 1
0003859: 1956: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (15 ms)

0009563: 1956: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Start
0009563: 1956: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Setting m_bStoreInTags to 1
0009563: 1956: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Finish (0 ms)

0011141: 1956: SDK: CDatabaseFieldDlg::OnO: Start
0011141: 1956: SDK: CDatabaseFieldDlg::OnO: Setting m_bSavedInTag to 1 (user)
0011219: 1956: SDK: CDatabaseFieldDlg::OnO: Finish (78 ms)

_____________________________________________________

Test True
Tick box unticked
_____________________________________________________
0005734: 1956: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0005734: 1956: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to ffffffff
0005750: 1956: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (16 ms)

0011125: 1956: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Start
0011125: 1956: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Setting m_bStoreInTags to ffffffff
0011125: 1956: SDK: CDatabaseFieldDlg::CDatabaseFieldDlg: Finish (0 ms)

0013171: 1956: SDK: CDatabaseFieldDlg::OnO: Start
0013171: 1956: SDK: CDatabaseFieldDlg::OnO: Setting m_bSavedInTag to 0 (user)
0013265: 1956: SDK: CDatabaseFieldDlg::OnO: Finish (94 ms)
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 04, 2007, 03:27:00 pm
Ok, I think I've fixed it (again!). This time it was a Microsoft function that took a boolean, but expected the boolean to be "1" or "0". It should be in the next build...

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on April 04, 2007, 03:42:27 pm
This Is How Homer Takes Care of Bugs.

It May Be Painful, But At The End You Get A Reward

Or Do You....

http://www.youtube.com/watch?v=jpyjsFEt0xM (http://www.youtube.com/watch?v=jpyjsFEt0xM)
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on April 04, 2007, 05:20:34 pm
Version 12.0.206

Nope...

Don't Work Unless You Have A "1" In The BSaveInTag Parm
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 04, 2007, 05:30:34 pm
Nope sorry still there.  :-\
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on April 04, 2007, 05:35:22 pm
As I Said It Still Is Not Checked

I Created A Sub That Will Send The Values In This Order, The Sub Fires One Right After Another

1. -1
2. 0
3. 1
4. True
5. False


Like So

Code: [Select]
    MCCreateField.CreateFieldSimple "Test '1' -1: " & MyStrFieldName, "Test '1' -1: " & MyStrDisplayName, MyBAllowEdit, -1
    MCCreateField.CreateFieldSimple "Test '2' 0: " & MyStrFieldName, "Test '2' 0: " & MyStrDisplayName, MyBAllowEdit, 0
    MCCreateField.CreateFieldSimple "Test '3' 1: " & MyStrFieldName, "Test '3' 1: " & MyStrDisplayName, MyBAllowEdit, 1
    MCCreateField.CreateFieldSimple "Test '4' True: " & MyStrFieldName, "Test '4' True: " & MyStrDisplayName, MyBAllowEdit, True
    MCCreateField.CreateFieldSimple "Test '5' False: " & MyStrFieldName, "Test '5' False: " & MyStrDisplayName, MyBAllowEdit, False

The Log

Code: [Select]
Media Center; Version: 12.0.206; Types: 4

0010687: 1200: SDK: CMJPlaybackAutomation::OnFinalRelease: All objects released
0010687: 1200: SDK: CMJPlaybackAutomation::~CMJPlaybackAutomation: Global Count: 0
0010687: 1200: SDK: CMJCurPlaylistAutomation::CMJCurPlaylistAutomation: Global Count: 1
0010687: 1200: SDK: CMJCurPlaylistAutomation::OnFinalRelease: All objects released
0010687: 1200: SDK: CMJCurPlaylistAutomation::~CMJCurPlaylistAutomation: Global Count: 0
0011031: 1200: SDK: CMJPlaybackAutomation::CMJPlaybackAutomation: Global Count: 1
0011031: 1200: SDK: CMJPlaybackAutomation::OnFinalRelease: All objects released
0011031: 1200: SDK: CMJPlaybackAutomation::~CMJPlaybackAutomation: Global Count: 0
0011031: 1200: SDK: CMJCurPlaylistAutomation::CMJCurPlaylistAutomation: Global Count: 1
0011031: 1200: SDK: CMJCurPlaylistAutomation::OnFinalRelease: All objects released
0011031: 1200: SDK: CMJCurPlaylistAutomation::~CMJCurPlaylistAutomation: Global Count: 0

Sent: -1

0011156: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0011172: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to ffffffff
0011172: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (16 ms)

Sent: 0

0011172: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0011172: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to 0
0011172: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (0 ms)

Sent: 1

0011172: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0011172: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to 1
0011187: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (15 ms)

Sent: True

0011187: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0011187: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to ffffffff
0011187: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (0 ms)

Sent: False

0011187: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Start
0011187: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Setting m_bSavedInTag to 0
0011203: 1200: SDK: CMJFieldsAutomation::CreateFieldSimple: Finish (16 ms)

0011375: 1200: SDK: CMJPlaybackAutomation::CMJPlaybackAutomation: Global Count: 1
0011375: 1200: SDK: CMJPlaybackAutomation::OnFinalRelease: All objects released
0011375: 1200: SDK: CMJPlaybackAutomation::~CMJPlaybackAutomation: Global Count: 0
0011375: 1200: SDK: CMJCurPlaylistAutomation::CMJCurPlaylistAutomation: Global Count: 1
0011375: 1200: SDK: CMJCurPlaylistAutomation::OnFinalRelease: All objects released
0011375: 1200: SDK: CMJCurPlaylistAutomation::~CMJCurPlaylistAutomation: Global Count: 0
0011719: 1200: SDK: CMJPlaybackAutomation::CMJPlaybackAutomation: Global Count: 1
0011719: 1200: SDK: CMJPlaybackAutomation::OnFinalRelease: All objects released
0011719: 1200: SDK: CMJPlaybackAutomation::~CMJPlaybackAutomation: Global Count: 0
0011719: 1200: SDK: CMJCurPlaylistAutomation::CMJCurPlaylistAutomation: Global Count: 1
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 05, 2007, 12:29:24 pm
This Is How Homer Takes Care of Bugs.

Sorry y'all, it was a Homer moment for me. I fixed the problem, but didn't save it. Sigh...
Next build...

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 05, 2007, 01:33:13 pm
This morning I was doing a project in Visual Studio 2005.

I worked on it for four hours.  I've got VS to save my work
everytime I recompile, so  I don't worry to much about the power
failing or whatever.

At about mid-day i had a bright spark idea of replacing all ""
in my code with string.Empty

No real reason just one of those sort of OO type moods.
So I did a find and replace on the entire project.
The only problem being that I replaced ("")
with string.Empty, when I should have replaced it with
(string.Empty)

Anyhow that in itself shouldn't have been to major a problem.
Apart from the fact I then had the genius idea of hitting the
global undo button which should have undone the find and replace.

Big mistake.  It would seem there is a bug in VS 2005,
and when you do stuff in the order I just did it doesn't just undo
the last action..

Oh no it undoes all actions since opening the editor.
So effectively all my work for the morning had been undone.

At this point if I had realised it had done this I could have tried
the global redo, or just closed VS and not save the files...
Unfortunatley I didn't.  I recompiled the code, thus saving the changes,
and so undoing four hours of work.

One day I'm going to learn.  Never trust a clever feature in VS
until you've tried it lots and lots and lots of times, on stuff that really
doesn't matter!
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on April 05, 2007, 02:32:39 pm
I need to find someone selling VS for cheap, i can't deal with that Microsoft Price.

I get a headache every-time i go near the Buy button
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 05, 2007, 05:55:03 pm
Wahey! It works!
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 05, 2007, 07:32:32 pm
Finally. Sorry it took so long, and thanks for the story. I've done a few similar things. There's a feeling I know very well: it happens about 2 seconds after you hit <return> or click the <ok> button, and realize you just erased who knows how many hours/days/weeks of work, that sinking feeling in your stomach.  :P

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on April 05, 2007, 08:10:10 pm
Eureka
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: John Gateley on April 05, 2007, 08:20:39 pm
 :)

How's Sue?

j
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: KingSparta on April 05, 2007, 09:10:34 pm
:)

How's Sue?

j


Doing Good...

I Told Her You And JimH Wished Her Well

She Said To Tell The JRiver Crew Thanks For The Well Wishes....
Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: robydago on April 20, 2007, 04:15:16 am

I need to find someone selling VS for cheap, i can't deal with that Microsoft Price.

king,
you should check this out, it's free:
http://www.icsharpcode.net/OpenSource/SD/

Title: Re: Create Field - Source Code For MC12 And VB6 (Sample)
Post by: Mr ChriZ on April 20, 2007, 04:47:21 am
I need to take another look at #Develop.
It seems to be a really active project and come along way.
Last time I looked at it I was impressed compared to Visual Studio 2003.
Then MS released Visual Studio 2005, which kinda blew it away.
It looks like it's catching up again however.  :)