Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Maui #1
Member since Sep 2007 · 9 posts · Location: Aachen
Group memberships: Members
Show profile · Link to this post
Subject: Porting agsXMPP.ui to .net Compact Framework
Hi there,

im currently working on a port of agsXMPP.ui for the .net Compact Framework.


However there seems to be a Problem with
        FieldType m_Type = field.Type;

within CreateField(), XDataControl.cs.

Using the Method with a Search result always results in a TypeLoad Exception.
Is this a known bug?

Greetings,

Maui
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

i would be helpful if you can post some more details and source code. Or attach a example test case.

Alex
Avatar
Maui #3
Member since Sep 2007 · 9 posts · Location: Aachen
Group memberships: Members
Show profile · Link to this post
My code is essentially based on the MiniClient(Desktop) example.

        private void OnSearchFieldsResult(object sender, IQ iq, object data)
        {
            if (InvokeRequired)
            {
                // Windows Forms are not Thread Safe, we need to invoke this :(
                // We're not in the UI thread, so we need to call BeginInvoke               
                BeginInvoke(new IqCB(OnSearchFieldsResult), new object[] { sender, iq, data });
                return;
            }

            if (iq.Type == IqType.result)
            {

                if (iq.Query is Search)
                {
                    Search search = iq.Query as Search;
                    if (search.Data != null)
                    {
                        xDataControl.CreateForm(search.Data);
                        // Enable the Search Button                       
                    }
                    else
                    {
                        // no xdata form returned from the search service.
                        // TODO should we add the old jabber search without xdata too? I don't think so.
                        //toolStripLabelForm.Text = String.Format("{0} returned no data form", iq.From.ToString());                       

                        _IsOldSearch = true;
                    }

                    btnSearch.Enabled = true;

                }
            }
            else if (iq.Type == IqType.error)
            {
          }

        }

xDataControl.CreateForm(search.Data); should fill the xDataControl with receieved xdata Fields from Server, therefore the call of CreateField().

But it seems the bug is not related to agXMPP.ui but to the base agsXMPP Package.

FieldType m_Type = field.Type; does also result in a  TypeLoad Exception if i try to parse the xdata result without the agsXMPP.ui objects.
Avatar
Alex #4
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
There must be something wrong with your port of agsXmpp.ui
Are you sure that you ported everything correct inside the CreateForm function?
Try to surround as many code blocks as possible with try catch to narrow down the line where the TypeLoadException occurs.

Quote by MSDN:
A TypeLoadException is thrown when the common language runtime cannot find the assembly, the type within the assembly, or cannot load the type.

Alex
Avatar
Koterpillar #5
Member since May 2007 · 32 posts · Location: Russia
Group memberships: Members
Show profile · Link to this post
Subject: CF bug
It's a CF bug, I remember the identical behavior and even reported some on the forums. You have to work around it.
nebohodimo IM developer
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS