473,395 Members | 1,623 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,395 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
Nov 22 '05 #1
0 705

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

Similar topics

0
by: Prasad | last post by:
We are invoking a SQL DTS component (lets call it Comp1) built by us in another component (Comp2).Comp1 was built by creating the DTS package using the SQL DTS wizard and then saving it as a VB...
0
by: michael | last post by:
So I have a fairly large VB.Net application, lots of objects, lots of yucky OLEDB code. One day I started converting some Singles to Decimals because I wanted to make some calculations as precise...
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: pat magee | last post by:
have written an app to query a heterogenous network of Win98/WinME/XP/Win2000 machines. I can connect to WMI using the WMI CIM Studio but I get an ExecutionEngineException whenever I try to...
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...
14
by: TT (Tom Tempelaere) | last post by:
Hi people, The code that follows throws an ExecutionEngineException. This was written in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE 7.1 (7.1.3088). The framework is .NET...
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...
3
by: Stephen Flynn | last post by:
If I run my program on another machine I get the following error An unhandled exception of type 'System.ExecutionEngineException' occurred in System.Data.dll This happens with I try to open an...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.