473,383 Members | 1,716 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,383 software developers and data experts.

Cannot use .NET in thread created by _beginthread_ex under IIS with Visual Studio 2003 but works with VS 2002.

In the code below (called from an ASPX page), does someone known why a 'System.DllNotFoundException' exception is throw when the thread created by 'cppextension::MyExtension::Test()' starts to execute the function 'managedFunc' that use .NET code ?

This piece of code works when I use Visual Studio 2002.

The same code compiled in a console application works with Visual Studio 2003.

The code executes under IIS 5.1 on Windows XP.

#pragma managed

void managedFunc()
{

System::String *s=S"";

}

#pragma unmanaged

unsigned __stdcall threadFunc( void* pArguments )

{

free(malloc(10)); // call some unmanaged functions.

managedFunc(); // call a function that uses .NET code.

return 0;

}

#pragma managed

void cppextension::MyExtension::Test()

{

HANDLE hThread;

unsigned threadID;

hThread = (HANDLE)_beginthreadex( NULL, 0, &threadFunc, NULL, 0, &threadID );

::Sleep(40000);

}
Exception:

An unhandled exception of type 'System.DllNotFoundException' occurred in Unknown Module.

Additional information: Exception from HRESULT: 0x80131524.

Nov 16 '05 #1
1 1758
Is there anybody at Microsoft ?

"Lionel Schiepers" <Li************************************@hotmail.co m> wrote in message news:Ov**************@tk2msftngp13.phx.gbl...
In the code below (called from an ASPX page), does someone known why a 'System.DllNotFoundException' exception is throw when the thread created by 'cppextension::MyExtension::Test()' starts to execute the function 'managedFunc' that use .NET code ?

This piece of code works when I use Visual Studio 2002.

The same code compiled in a console application works with Visual Studio 2003.

The code executes under IIS 5.1 on Windows XP.

#pragma managed

void managedFunc()
{

System::String *s=S"";

}

#pragma unmanaged

unsigned __stdcall threadFunc( void* pArguments )

{

free(malloc(10)); // call some unmanaged functions.

managedFunc(); // call a function that uses .NET code.

return 0;

}

#pragma managed

void cppextension::MyExtension::Test()

{

HANDLE hThread;

unsigned threadID;

hThread = (HANDLE)_beginthreadex( NULL, 0, &threadFunc, NULL, 0, &threadID );

::Sleep(40000);

}
Exception:

An unhandled exception of type 'System.DllNotFoundException' occurred in Unknown Module.

Additional information: Exception from HRESULT: 0x80131524.

Nov 16 '05 #2

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

Similar topics

4
by: Daisy | last post by:
Hi, Can I install Visual Studio .NET 2003 on Windows 2000 with Service Pack 4 machine? Or Will I have to upgrade to a newer version of the MS Windows operating system. Please provide the...
1
by: Daniel A. Thomas | last post by:
License required Maybe you don't have this but have one of the products that qualifies for the upgrade such as ... Visual Studio .NET 2003 Professional Visual Studio .NET 2003 Professional...
3
by: Jag | last post by:
My Visual Studio .NET is the 2002 enviroment. And I want to open a project created in 2003. when i attempt to open the project, it gives an error and says i need a newer version. Is there...
1
by: | last post by:
Hi, I'm running VC++ 2002 and i've just got VB 2003. I have a large application in C++ and wanted to build a small VB component that I could call from it. I have a feeling that this is not...
11
by: PÃ¥l Eilertsen | last post by:
Hi, I have recently installed Visual Studio .Net 2003 and am trying to compile and run a simple windows form app (used the VS wizard). When trying to run I get an error message telling me:...
5
by: Francis Shanahan | last post by:
Folks, I have a base page which is the grand-daddy of all my pages. It inherits from System.UI.Web.Page From this I inherit a layout page. From this I inherit the individual pages themselves....
1
by: Jon H | last post by:
Whenever I try to create an asp.net webapplication, I keep getting the error: Cannot find the components for communicating with the frontpage server extensions. I tried reinstalling Visual Studio...
1
by: Anindya C via DotNetMonster.com | last post by:
When i want to open vs.net 2002 professional edition, a window installer message box appears saying: "Please wait while windows configures Microsoft Visual Studio .NET professional _english". After...
3
by: =?Utf-8?B?SmVmZnJleQ==?= | last post by:
Just got the book, ASP.NET by Greg Buczek (Osborne). The first part of book listed many aspx codes, not created by VS 2003 or VS 2005. How can these aspx files be coded? NotePad or VB 6? The...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.