Examples from the Majestic Qur'an of Prophets addressing the deceased:
Prophet Shu'aib
فَأَخَذَتْهُمُ الرَّجْفَةُ فَأَصْبَحُواْ فِي دَارِهِمْ جَاثِمِينَالَّذِينَ كَذَّبُواْ شُعَيْبًا كَأَن لَّمْ يَغْنَوْاْ فِيهَا الَّذِينَ كَذَّبُواْ شُعَيْبًا كَانُواْ هُمُ الْخَاسِرِينَفَتَوَلَّى عَنْهُمْ وَقَالَ يَا قَوْمِ لَقَدْ أَبْلَغْتُكُمْ رِسَالاَتِ رَبِّي وَنَصَحْتُ لَكُمْ فَكَيْفَ آسَى عَلَى قَوْمٍ كَافِرِينَ
007.091 But the earthquake took them unawares, and they lay prostrate in their homes before the morning!
007.092 The men who reject Shu’aib became as if they had never been in the homes where they had flourished: the men who rejected Shu’aib - it was they who were ruined!
007.093 So Shu’aib left them, saying: "O my people! I did indeed convey to you the messages for which I was sent by my Lord: I gave you good counsel, but how shall I lament over a people who refuse to believe!"
Prophet Salih:
فَعَقَرُواْ النَّاقَةَ وَعَتَوْاْ عَنْ أَمْرِ رَبِّهِمْ وَقَالُواْ يَا صَالِحُ ائْتِنَا بِمَا تَعِدُنَا إِن كُنتَ مِنَ الْمُرْسَلِينَفَأَخَذَتْهُمُ الرَّجْفَةُ فَأَصْبَحُواْ فِي دَارِهِمْ جَاثِمِينَفَتَوَلَّى عَنْهُمْ وَقَالَ يَا قَوْمِ لَقَدْ أَبْلَغْتُكُمْ رِسَالَةَ رَبِّي وَنَصَحْتُ لَكُمْ وَلَكِن لاَّ تُحِبُّونَ النَّاصِحِينَ
007.077 Then they ham-strung the she-camel, and insolently defied the order of their Lord, saying: "O Salih! bring about thy threats, if thou art an apostle (of Allah)!
"007.078 So the earthquake took them unawares, and they lay prostrate in their homes in the morning!
007.079 So Salih left them, saying: "O my people! I did indeed convey to you the message for which I was sent by my Lord: I gave you good counsel, but ye love not good counsellors!"