Missing Assembly Reference :(

sitajony

Active Member
Licensed User
[Solved] Missing Assembly Reference

Hello, I've some problems, it worked since yesterday and now it doesn't work, It didn't work with OpenNETCF too...

And I just copied my Dll files and not the source code...
I copied this assembly everywhere (Program Files>Basic4PPC, My app folder, TZor, Librairie, NETCF2.0 folder...) but it doesn't work and it worked before...

What can I do?

Thanks for your replies!

Source code:
B4X:
using System;
using MAPIdotnet;
using System.Windows.Forms;
namespace SMS
{
    public class OutilsSim
    {
        IMAPIFolder dossier = null;
        public TableSortOrder TriPlusPetitAuPlusGrand = TableSortOrder.TABLE_SORT_ASCEND;
        public TableSortOrder TriPlusGrandAuPlusPatit = TableSortOrder.TABLE_SORT_DESCEND;
        public TableSortOrder TriNormal = TableSortOrder.TABLE_SORT_COMBINE;
        MAPI mapi = new MAPI();
        String[] envoyeur;
        String[] msg;
        String[] dates;
        public void RefreshSMS(String Dossier,String Tri,TableSortOrder Ordre)
        {
            IMAPIMsgStore[] messageStores = mapi.MessageStores;
            for (int b = 0; b < messageStores.Length; b++)
            {
                IMAPIMsgStore store = messageStores[b];
                if (store.DisplayName == @"SMS")
                {

                    if (Dossier == "recu")
                    {
                        dossier = store.ReceiveFolder.OpenFolder();
                    }
                    else if (Dossier == "envoyé")
                    {
                        dossier = store.OutboxFolder.OpenFolder();
                    }
                    else
                    {
                        dossier = store.TrashFolder.OpenFolder();
                    }
                    trier(Tri, Ordre);
  //                  MessageBox.Show("a");
                    IMAPIMessage[] messages = dossier.GetNextMessages((int)dossier.NumSubItems);
//                    MessageBox.Show("b");
                    msg = new String[messages.Length];
                    envoyeur = new String[messages.Length];
                    dates = new String[messages.Length];
                    for (int a = 0; a < messages.Length; a++)
                    {
                        msg[a]=messages[a].Subject;
                        envoyeur[a]=messages[a].Sender.FullAddress;
                        dates[a]=messages[a].LocalDeliveryTime.ToString();
                    }
                    b = messageStores.Length;
                    return;
                }
            }
        }
        public String[] SMSMessage(String Quoi)
        {
            if (Quoi == "envoyeur")
            {
                return envoyeur;
            }
            else if (Quoi == "msg")
            {
                return msg;
            }
            else
            {
                return dates;
            }
        }
        public void trier(String tri, TableSortOrder Ordre)
        {
            if (tri != "")
            {
                if (tri == "envoyeur")
                {
                    dossier.SortMessagesBySenderName(Ordre);
                }
                else if (tri == "date")
                {
                    dossier.SortMessagesByDeliveryTime(Ordre);
                }
                else if (tri == "taille")
                {
                    dossier.SortMessagesBySize(Ordre);
                }
            }
        }
        
    }
}
MAPIDotnet is copied in a lot of folders coz apparently it doesn't work so maybe I forgot a folder?
 
Last edited:

agraham

Expert
Licensed User
Longtime User
More information needed.

1) What type of object is "osms" and what dll is it declared in? With a property like "VeryLittleToVerBig" I guess it's one that you wrote.

2) If it's your dll then are you trying to merge the source in the exe or are you using it as a dll?

3) If you are trying to merge the source then try removing the source from the Libraries folder and compile with the dll in the project folder. Does that work?
 

sitajony

Active Member
Licensed User
Yes it's "MoreLittleToBig" osms it's assigned to OutisSim class, I've not copied the source code, just the Dll on Librairie folder cause I has got some problem when I copy the source code and it worked but now it doesn't work so just the Dll "SMS.Dll" is copied on Librairie folder and "MAPIDotnet.dll" on my app folder... and it was the same thing with OpenNETCF...
Note: It worked very well since few days, I've my EXE with SMS.dll who work great and I just changed few function on My SMS.dll but globaly it's the same thing... It's strange why it doesn't work anymore?


Don't take care with the modified date, it's not refreshed...
 

Attachments

  • sms.jpg
    71.7 KB · Views: 287
Last edited:

agraham

Expert
Licensed User
Longtime User
You will have compilation problems with that posted source code of the dll in the Libraries folder, I won't try to explain why until it works as a stand-alone dll so make sure that your source codes are not in the Libraries folder.

What is SMS.dll. Is it your code or a third party library? If so the only place it should be for now is in your project folder. If you have copies in the Libraries folder or anywhere else remove them.

What is MAPIDotnet.dll. Is it your code or a third party library? If so the only place it should be for now is in your project folder. If you have copies in the Libraries folder or anywhere else remove them.

Now what happens?
 

sitajony

Active Member
Licensed User
I've to go somewhere, I come back in few hours, I'll edit this post when I'll come back...
MAPIDotnet.dll use OpenNETCF.dll (who is in my app folder) and SMS.Dll (my own library) use MAPIDotnet.dll who use also OpenNETCF.dll
So I must remove every SMS.Dll and MAPIDotnet.dll that I've copied?

I'll tell you what happens when I'll come back...
 

sitajony

Active Member
Licensed User
I deleted every dll file for SMS.Dll (OpenNETCF et MAPIDotnet) and SMS.Dll from Librairie folder and it return the same thing... When I delete MAPIDotnet from my app folder it return an error when I open the SBP file (unable to load one dependance...) Maybe it doesn't find MAPIDotnet coz it's in use by Basic4PPC no?

Edit: And my code source is not merged I just copied SMS.Dll in my app folder...
But if there're 2 Dll files who use the same Lib (MAPIDotnet) it doesn't matter?
 
Last edited:

agraham

Expert
Licensed User
Longtime User
Lets get the information correct. You are trying to compile an sbp on the desktop for the device and the compilation is failing. Check the following.

You have SMS.Dll, OpenNETCF.dll and MAPIDotnet.dll in your project folder and nowhere else.

There is no source code for any of those dlls in your library folder.

You have only SMS.dll added as a component, not either of the other two, and SMS.dll is added as a component to both desktop and device.

If all the above is correct and compilation still fails try placing a copy of OpenNETCF.dll and MAPIDotnet.dll in the "Basic4ppc Desktop".

If that fails then post the dlls and sbp and I'll see if I can reproduce the problem.
 

sitajony

Active Member
Licensed User
There's SMS.Dll in Librairie folder and OpenNETCF + MAPIDotnet are only on my project folder, no source code about sms, OpenNETCF and MAPIDotnet are in Librairie folder.
I've just add SMS.Dll in componements.
And i also tried to don't add an object assigned to OutilsSIM (from SMS.Dll) but it doesn't work...
I can't send the source code, it's too big, I did 44 dll file and never I encounter this problem... And yesterday it worked, I've my compiled EXE who use SMS.Dll without problems... But I've updated my SMS.Dll and now it doesn't work... Maybe should copy once more time OpenNETCF.dll and MAPIDotnet coz when I recompiled my dll file I've just copied SMS.Dll in Librairie folder that all...
I try a stuff and tell you if it works finally...
 

sitajony

Active Member
Licensed User
I found!
In fact it was apparently the third parametter... I've now to type this:
B4X:
        public TableSortOrder ordredetri = TableSortOrder.TABLE_SORT_COMBINE;
        public TableSortOrder TriPlusPetitAuPlusGrand
        {
            get
            {
                return TableSortOrder.TABLE_SORT_ASCEND;
            }
        }
        public TableSortOrder TriPlusGrandAuPlusPatit
        {
            get
            {
                return TableSortOrder.TABLE_SORT_DESCEND;
            }
        }

        public TableSortOrder TriNormal
        {
            get
            {
                return TableSortOrder.TABLE_SORT_COMBINE;
            }
        }
        MAPI mapi = new MAPI();
        String[] envoyeur;
        String[] msg;
        String[] dates;
        public void RefreshSMS(String Dossier,String Tri)
        {
And apparently it's ok... I test and will edit this post if it works

Edit:
In fact it doesn't work either, I must change the order from a string and not return directly the TableSortOrder value who is unknow...

Edit:
This is my new code who normaly works:
B4X:
using System;
using MAPIdotnet;
using System.Windows.Forms;
namespace SMS
{
    public class OutilsSim
    {
        IMAPIFolder dossier = null;
        TableSortOrder ordredetri = TableSortOrder.TABLE_SORT_COMBINE;
        public Int32 changeTri
        {
            set
            {
                if (value == 1)
                {
                    ordredetri = TableSortOrder.TABLE_SORT_ASCEND;
                }
                else if (value == 2)
                {
                    ordredetri = TableSortOrder.TABLE_SORT_DESCEND;
                }
                else
                {
                    ordredetri = TableSortOrder.TABLE_SORT_COMBINE;
                }
            }
        }
        public Int32 TriPlusPetitAuPlusGrand
        {
            get
            {
                return 1;
            }
        }
        public Int32 TriPlusGrandAuPlusPetit
        {
            get
            {
                return 2;
            }
        }

        public Int32 TriNormal
        {
            get
            {
                return 3;
            }
        }
        MAPI mapi = new MAPI();
        String[] envoyeur;
        String[] msg;
        String[] dates;
        public void RefreshSMS(String Dossier,String Tri)
        {
            IMAPIMsgStore[] messageStores = mapi.MessageStores;
            for (int b = 0; b < messageStores.Length; b++)
            {
                IMAPIMsgStore store = messageStores[b];
                if (store.DisplayName == @"SMS")
                {

                    if (Dossier == "recu")
                    {
                        dossier = store.ReceiveFolder.OpenFolder();
                    }
                    else if (Dossier == "envoyé")
                    {
                        dossier = store.OutboxFolder.OpenFolder();
                    }
                    else
                    {
                        dossier = store.TrashFolder.OpenFolder();
                    }
                    trier(Tri);
  //                  MessageBox.Show("a");
                    IMAPIMessage[] messages = dossier.GetNextMessages((int)dossier.NumSubItems);
//                    MessageBox.Show("b");
                    msg = new String[messages.Length];
                    envoyeur = new String[messages.Length];
                    dates = new String[messages.Length];
                    for (int a = 0; a < messages.Length; a++)
                    {
                        msg[a]=messages[a].Subject;
                        envoyeur[a]=messages[a].Sender.FullAddress;
                        dates[a]=messages[a].LocalDeliveryTime.ToString();
                    }
                    b = messageStores.Length;
                    return;
                }
            }
        }
        public String[] SMSMessage(String Quoi)
        {
            if (Quoi == "envoyeur")
            {
                return envoyeur;
            }
            else if (Quoi == "msg")
            {
                return msg;
            }
            else
            {
                return dates;
            }
        }
        public void trier(String tri)
        {
            if (tri != "")
            {
                if (tri == "envoyeur")
                {
                    dossier.SortMessagesBySenderName(ordredetri);
                }
                else if (tri == "date")
                {
                    dossier.SortMessagesByDeliveryTime(ordredetri);
                }
                else if (tri == "taille")
                {
                    dossier.SortMessagesBySize(ordredetri);
                }
            }
        }
        
    }
}
I try and I'll tell you if it's ok...

Edit:
It works! So Now i've to type this in B4P:
B4X:
                osms.changeTri=osms.TriPlusGrandAuPlusPetit
                    osms.RefreshSMS("supprimé",StrToLower(ag(1)))
Thanks for your help, it's a strange soluce but it works...
Hum apparently there's no SMS Library here, when I'll finish my program I'll make a clean library in english of cource for read any SMS on your device...
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
Hum apparently there's no SMS Library here, when I'll finish my program I'll make a clean library in english of cource for read any SMS on your device...


Actually there is... Its called outlook.dll and apart of accessing the contacts, it intercepts sms....
 

sitajony

Active Member
Licensed User
Actually there is... Its called outlook.dll and apart of accessing the contacts, it intercepts sms....
Yes I know but it can't read the sms receive, trash, sent... folder...
With my lib I'll can also delete sms, delete folders and create folders... There'll be more featues than Outlook.dll who can just show a sms in receiving...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…