473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

ExecutionEngineException

Hello,

if I try to call my function:

public static string GetDisplayNameFromPidl(IntPtr Pidl)
{
SHFILEINFOBYTE fileinfobyte = new SHFILEINFOBYTE(true);
try
{
SHGetFileInfoPidl(
(uint) Pidl,
0,
out fileinfobyte,
(uint) Marshal.SizeOf(fileinfobyte),
SHGFI.SHGFI_PIDL | SHGFI.SHGFI_DISPLAYNAME);
}
// ExecutionEngineException
catch(ExecutionEngineException ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
catch(Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
return(fileinfobyte.szDisplayName);
}
/////////////
dll import:
////////////

[DllImport("shell32.dll",EntryPoint="SHGetFileInfoA ", CharSet=CharSet.Auto)]
private static extern int SHGetFileInfoPidl(
uint Pidl,
uint FileAttributes,
out SHFILEINFOBYTE fib,
uint FileInfo,
SHGFI Flags);

//////////////////////
Struct SHFILEINFOBYTE
//////////////////////

[StructLayout(LayoutKind.Sequential)]
private struct SHFILEINFOBYTE
{
public SHFILEINFOBYTE(bool b)
{
hIcon=IntPtr.Zero;iIcon=0;dwAttributes=0;szDisplay Name="";szTypeName="";
}
public IntPtr hIcon;
public int iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.LPStr, SizeConst=260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.LPStr,SizeConst=80)]
public string szTypeName;
}
I get an uncatchable ExecutionEngineException and my program crashs.
It there any way to bring that to work?
Does anyone know any solutions?

The whole project can be found here:
http://tinyurl.com/62a3y

Thanks,
Benjamin
Jul 21 '05 #1
0 1358

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John O'Neill | last post by:
Hi I have been having a strange problem with a c# application I have been developing. My application detects when a Pocket PC device has been connected (via ActiveSyc) and queries the registry...
6
by: Magnus Ullberg | last post by:
How do i convert the following structure declaration from c++ to c#? #pragma pack(push,1) //Byte alignment struct TtsrPlayerInfo { int PlayerID; int ChannelID; char NickName; int...
2
by: TT (Tom Tempelaere) | last post by:
Hi people, In my code I get an ExecutionEngineException. I don't know what to do with it, and I can't seem to get rid of it. How can I figure out what is causing it? It always appears on the...
3
by: NormD | last post by:
An exception 'System.ExecutionEngineException' has occurred in servername I have deployed a windows application on a server; I'm running the same on my pc using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.