473,663 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ 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 TfrxUserDataSet Class();

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 13407

"Wilfried Mestdagh" <wi******@mestd agh.bizwrote in message
news:%2******** ********@TK2MSF TNGP04.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 TfrxUserDataSet Class();
|
| 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******@mestd agh.bizwrote in message
news:OO******** ******@TK2MSFTN GP02.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******@mestd agh.bizwrote in message
news:eq******** ******@TK2MSFTN GP02.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
4710
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 entry points The minitialize and mterminate functions are straight forward and make sense. The problem is with the code
0
880
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 loaded, one specifies /NOENTRY to the linker and then it is necessary to basically provide functions to be called that will actually call _DllMainCrtStartup before any "real" work is done by code in the dll that may depend on globals or statics. ...
0
240
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 can't follow the advice. My situation is this: I have followed MS recommendations to convert my in-process COM server to a mixed-mode DLL that exposes managed objects to ..NET framework clients and COM objects to unmanaged COM clients. In fact,...
2
3194
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 'LoaderLock' has detected a problem in <filename.exe>. Additional Information: 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...
4
5034
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 processed by the native part and calls managed code in turn) a loader lock appears. I have tracked down the call stack - the interessting part: - mscorwks.dll (where the exception is raised)
4
5799
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 contains .Net functions wrapped in C++ (as described by Paul DiLascia -- see http://msdn.microsoft.com/msdnmag/issues/06/06/CAtWork/default.aspx). Both DLLs specify 'Use MFC in a shared DLL'. Since we have an old VC 6 application (large) that we...
1
2444
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 attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
5
3520
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 the application to hang. I have no idea what its talking about. it seems to be kicking this off when i do my remote registry read. Thanks
1
1259
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 inside a DllMain or image initialization function since doing so can cause the application to hang.". The same solutions works fine if i run it on my machine, but if i run this on the different machine it throws the above error. I tried...
0
8436
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8771
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8548
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7371
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5657
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.