473,469 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

OS Loader lock exception

Hi,

I'm trying out the demo version of FastReports. All is running fine in a
small test project. I just copy my code from test project into a large
application to demonstrate tomorrow but have an error in this line:

dataSet = new TfrxUserDataSetClass();

This is the exception error:

Attempting managed execution inside OS Loader lock. Do not attempt to
run managed code inside a DllMain or image initialization function since
doing so can cause the application to hang.

It does only happen when running in the IDE (VS2005 pro). The same code
runs in a test project without errors. I have no idea where the
difference is or where to start debugging. I don't use DLL's (here and
there P/Invoke for Win32 of course) and I don't have images. Also the
target application uses Microsoft MapPoint if that could make any
difference.

Can someone give me some hints from where to start locating the source
of the problem ? I have no source code of the product.

--
rgds, Wilfried [MapPoint MVP]
http://www.mestdagh.biz
Nov 12 '06 #1
6 13388

"Wilfried Mestdagh" <wi******@mestdagh.bizwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
| Hi,
|
| I'm trying out the demo version of FastReports. All is running fine in a
| small test project. I just copy my code from test project into a large
| application to demonstrate tomorrow but have an error in this line:
|
| dataSet = new TfrxUserDataSetClass();
|
| This is the exception error:
|
| Attempting managed execution inside OS Loader lock. Do not attempt to
| run managed code inside a DllMain or image initialization function since
| doing so can cause the application to hang.
|
| It does only happen when running in the IDE (VS2005 pro). The same code
| runs in a test project without errors. I have no idea where the
| difference is or where to start debugging. I don't use DLL's (here and
| there P/Invoke for Win32 of course) and I don't have images. Also the
| target application uses Microsoft MapPoint if that could make any
| difference.
|
| Can someone give me some hints from where to start locating the source
| of the problem ? I have no source code of the product.
|
| --
| rgds, Wilfried [MapPoint MVP]
| http://www.mestdagh.biz

You are definitely calling into a mixed mode DLL (MapPoint stuff?), which at
his turn calls into managed code from within the DllMain function.
Check following page for details on how to diagnose and possibly solve the
issue:
http://msdn2.microsoft.com/en-us/lib...66(VS.80).aspx
Willy.

Nov 12 '06 #2
Hi Willy,

I traced down a little bit. It is not MapPoint. It happens when I use
Weifenluo dock panel in same project [
http://sourceforge.net/forum/forum.php?forum_id=402316 ]. The problem is
that if there is a bug in A that shows up in B, then both authors will
probably say there is no bug :( Anyway I try to contact both.

But how can the use of a component give that kind of an error in another
component ?

--
rgds, Wilfried [MapPoint MVP]
http://www.mestdagh.biz
Nov 12 '06 #3

"Wilfried Mestdagh" <wi******@mestdagh.bizwrote in message
news:OO**************@TK2MSFTNGP02.phx.gbl...
| Hi Willy,
|
| I traced down a little bit. It is not MapPoint. It happens when I use
| Weifenluo dock panel in same project [
| http://sourceforge.net/forum/forum.php?forum_id=402316 ]. The problem is
| that if there is a bug in A that shows up in B, then both authors will
| probably say there is no bug :( Anyway I try to contact both.
|
| But how can the use of a component give that kind of an error in another
| component ?
|
| --
| rgds, Wilfried [MapPoint MVP]
| http://www.mestdagh.biz

I can't believe it's DocPanel, IFAIK it's CSharp code only, the OS Loader
issue is a Mixed mode C++ thing, CS assemblies don't have a DllMain function
nor are they loaded by the OS loader.

Willy.
Nov 12 '06 #4
Hi Willy,
>I can't believe it's DocPanel, IFAIK it's CSharp code only, the OS Loader
issue is a Mixed mode C++ thing, CS assemblies don't have a DllMain function
nor are they loaded by the OS loader.
I started a new application, and added the offending code line in the
form's Load event. Project runs normal in IDE. Then I drop a dockpanel
to main form. Now I have the exception. I'm not sure what's next to try :(

--
rgds, Wilfried [MapPoint MVP]
http://www.mestdagh.biz
Nov 13 '06 #5

"Wilfried Mestdagh" <wi******@mestdagh.bizwrote in message
news:eq**************@TK2MSFTNGP02.phx.gbl...
| Hi Willy,
|
| >I can't believe it's DocPanel, IFAIK it's CSharp code only, the OS
Loader
| >issue is a Mixed mode C++ thing, CS assemblies don't have a DllMain
function
| >nor are they loaded by the OS loader.
|
| I started a new application, and added the offending code line in the
| form's Load event. Project runs normal in IDE. Then I drop a dockpanel
| to main form. Now I have the exception. I'm not sure what's next to try :(
|
| --
| rgds, Wilfried [MapPoint MVP]
| http://www.mestdagh.biz

You don't call into MapPoint code do you? Did you try to build the DocPanel
from source using VS2005?
Are you sure you and/or DocPanel doesn't call into managed C++ code?
Once again, the "OS loader lock" exception is thrown when you call into the
CLR from unmanaged code in a DllMain function, and this, only when running
in the debugger, so I would start by investigating investigate the call
stack.
Willy.
Nov 13 '06 #6
Hi Willy,
You don't call into MapPoint code do you?
No I used a brand new project as test with only this single line of code.
Did you try to build the DocPanel from source using VS2005?
Yes I did, but result was same.
Are you sure you and/or DocPanel doesn't call into managed C++ code?
YesI think so. As you already have mentioned docpanel is written in pure
C#. But I'm not sure the problem "is" in dockpanel. I think it is in
FastReport (I think it is written in Delphi.net). The problem is only
there when dockPanel is sitting on a form.

I have solved it temporary by creating the FastRecord component before
creating DockPanel. This seems to be ok now.
Once again, the "OS loader lock" exception is thrown when you call into the
CLR from unmanaged code in a DllMain function, and this, only when running
in the debugger, so I would start by investigating investigate the call
stack.
There is almost nothing in the call stack when I have the error. The
test program is only 1 line of code.

One more question: Can I tell the IDE to ignore this ?

--
rgds, Wilfried [MapPoint MVP]
http://www.mestdagh.biz
Nov 13 '06 #7

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

Similar topics

1
by: Roy Chastain | last post by:
I have read and re-read KB 814472. There appears to be a little 1984 New Speak in it. I am referring to option 3. DLL that contains consumers that use managed code and dll exports or managed...
0
by: Eric Twietmeyer | last post by:
Hello, My understanding is that if one has an assembly with external dllexport defined entry points, then because it is not appropriate to have _DllMainCrtStartup run when the dll is being...
0
by: Phil Atkin | last post by:
I'm really struggling with this issue. I can see it's complex, but given the difficulty in reproducing it it's really essential that the advice provided is bullet-proof and very clear. So far, I...
2
by: Luis F. Rodas | last post by:
When I use the debugger in Microsoft Visual Studio 2005 to debug my Microsoft Foundation Classes (MFC) class library application, I receive an error message: "Managed Debugging Assistant...
4
by: Joey | last post by:
Hi, I wrote a mixed-mode dll (with MFC and C++/CLI) which is called from a C#-EXE. Under special cirumstances (that is: another process sends a windows-message to my process - this message is...
4
by: Al Norman | last post by:
We have two separate DLLs that do not interact (directly, at least). One is an MFC extension DLL that was built back in VC++ 6 days (but has been recompiled with VS2005). The other is a DLL that...
1
by: Claudia Fong | last post by:
In my windows form I have a comboBox and a textBox. When I try to write something in the textBox it shows me the error message below: Attempting managed execution inside OS Loader lock. Do not...
5
by: Justin Rich | last post by:
LoaderLock was detected Message: Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause...
1
by: nileshchitale | last post by:
Hi, I have a third party unmanged dll in my application which is giving "LoaderLock was detected Message: Attempting managed execution inside OS Loader lock. Do not attempt to run managed code...
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
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...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.