473,626 Members | 3,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Premature .dll loading caused by "Project Dependencies" options

I have a Visual Studio Solution .sln which contains multiple projects,
including an ODBC driver .dll and a client .exe.

The client .exe is a simple MFC query tool. Nothing I can find in the client
references the driver directly. It uses a connection string to access the
driver, and does not provide this string until the user has filled in a
login dialog.

But when I debug the .exe, I see that the ODBC driver .dll is being loaded
very early, well before InitInstance() is reached. In fact, it's just the
4th item in the load order shown below:

'MyClient.exe': Loaded
'C:\Dev\MyProje ct\Connector\OD BC\exe\debug\bi n\iwinnt\MyClie nt.exe', Symbols
loaded.
'MyClient.exe': Loaded 'C:\WINDOWS\sys tem32\ntdll.dll ', No symbols loaded.
'MyClient.exe': Loaded 'C:\WINDOWS\sys tem32\kernel32. dll', No symbols
loaded.
'MyClient.exe': Loaded
'C:\Dev\Siebel\ Connector\ODBC\ exe\debug\bin\i winnt\MyDriver. dll',
Symbolsloaded.
'MyClient.exe': Loaded 'C:\WINDOWS\sys tem32\version.d ll', No symbols loaded.
'MyClient.exe': Loaded 'C:\WINDOWS\sys tem32\user32.dl l', No symbols loaded.
'MyClient.exe': Loaded 'C:\WINDOWS\sys tem32\gdi32.dll ', No symbols loaded.
[etc.]

I can make the behavior go away by either:
(1) Compiling the client in its own, seperate .sln
or:
(2) Going into the .sln's "Project dependencies" dialog and unchecking the
box which makes the .exe dependent on the .dll.

The difference in the compiled result becomes more apparent when I look at
the .map files. When I leave the box unchecked or compile in a separate
..sln, the .map looks like:

0002:00037262 _SQLGetData@24 00459262 f
odbc32:ODBC32.d ll
0002:00037268 _SQLDriverConne ctW@32 00459268 f
odbc32:ODBC32.d ll
0002:0003726e _SQLColumnsW@36 0045926e f
odbc32:ODBC32.d ll

and the .dll loads as expected. But when I check the dependency box, it
looks like:

0002:000338ec _SQLGetData@24 004558ec f
oaodbcl:MyDrive r.dll
0002:000338f2 _SQLDriverConne ctW@32 004558f2 f
oaodbcl:MyDrive r.dll
0002:000338f8 _SQLColumnsW@36 004558f8 f
oaodbcl:MyDrive r.dll

The upshot of this is that my app crashes when I check the dependency box.
(Why? Not quite sure, there's some 3rd-party code involved, but it looks
like it's because the .dll is allocating some different TLS memory when it's
loaded, memory that becomes bogus by the time MFC tries to log in. This is
independent of a new MFC7.1 bug in the way it calls SQLDriverConnec t.)

Is this really by design? This seems like a Visual Studio nmake(?) bug to
me. I don't see anything in the documentation that would imply that a
generated .exe will actually change when you check a Visual Studio Project
dependencies box.

--
Eric Hirst, SSE

Sorry, I don't want to test my company's spam filters.
Please follow up to newsgroup, or send mail to the
following address, which I check occasionally:

s-p-a-r-k-y-d-o-o-d-l-e-d-o-o
y-a-h-o-o
c-o-m
Nov 17 '05 #1
1 2081
Hm, no response. But I suppose everyone who tried to read the first post
fell asleep long before the punch line, which was, essentially:

"Arranging multiple C++ projects (.vcproj) in a single solution (.sln), then
marking one .vcproj as dependent on another doesn't just affect the build
order. It actually can affect the binaries of the dependent projects,
sometimes causing them to behave in unexpected ways. This bothers me. Does
it bother you too?"

-Eric

"Eric Hirst" <sp**@spam.spam > wrote in message
news:e0******** ******@TK2MSFTN GP12.phx.gbl...
I have a Visual Studio Solution .sln which contains multiple projects,
including an ODBC driver .dll and a client .exe.

The client .exe is a simple MFC query tool. Nothing I can find in the client references the driver directly. It uses a connection string to access the
driver, and does not provide this string until the user has filled in a
login dialog.

But when I debug the .exe, I see that the ODBC driver .dll is being loaded
very early, well before InitInstance() is reached. In fact, it's just the
4th item in the load order shown below:

'MyClient.exe': Loaded
'C:\Dev\MyProje ct\Connector\OD BC\exe\debug\bi n\iwinnt\MyClie nt.exe', Symbols loaded.
'MyClient.exe': Loaded 'C:\WINDOWS\sys tem32\ntdll.dll ', No symbols loaded.
'MyClient.exe': Loaded 'C:\WINDOWS\sys tem32\kernel32. dll', No symbols
loaded.
'MyClient.exe': Loaded
'C:\Dev\Siebel\ Connector\ODBC\ exe\debug\bin\i winnt\MyDriver. dll',
Symbolsloaded.
'MyClient.exe': Loaded 'C:\WINDOWS\sys tem32\version.d ll', No symbols loaded. 'MyClient.exe': Loaded 'C:\WINDOWS\sys tem32\user32.dl l', No symbols loaded. 'MyClient.exe': Loaded 'C:\WINDOWS\sys tem32\gdi32.dll ', No symbols loaded.
[etc.]

I can make the behavior go away by either:
(1) Compiling the client in its own, seperate .sln
or:
(2) Going into the .sln's "Project dependencies" dialog and unchecking the
box which makes the .exe dependent on the .dll.

The difference in the compiled result becomes more apparent when I look at
the .map files. When I leave the box unchecked or compile in a separate
.sln, the .map looks like:

0002:00037262 _SQLGetData@24 00459262 f
odbc32:ODBC32.d ll
0002:00037268 _SQLDriverConne ctW@32 00459268 f
odbc32:ODBC32.d ll
0002:0003726e _SQLColumnsW@36 0045926e f
odbc32:ODBC32.d ll

and the .dll loads as expected. But when I check the dependency box, it
looks like:

0002:000338ec _SQLGetData@24 004558ec f
oaodbcl:MyDrive r.dll
0002:000338f2 _SQLDriverConne ctW@32 004558f2 f
oaodbcl:MyDrive r.dll
0002:000338f8 _SQLColumnsW@36 004558f8 f
oaodbcl:MyDrive r.dll

The upshot of this is that my app crashes when I check the dependency box.
(Why? Not quite sure, there's some 3rd-party code involved, but it looks
like it's because the .dll is allocating some different TLS memory when it's loaded, memory that becomes bogus by the time MFC tries to log in. This is
independent of a new MFC7.1 bug in the way it calls SQLDriverConnec t.)

Is this really by design? This seems like a Visual Studio nmake(?) bug to
me. I don't see anything in the documentation that would imply that a
generated .exe will actually change when you check a Visual Studio Project
dependencies box.

--
Eric Hirst, SSE

Sorry, I don't want to test my company's spam filters.
Please follow up to newsgroup, or send mail to the
following address, which I check occasionally:

s-p-a-r-k-y-d-o-o-d-l-e-d-o-o
y-a-h-o-o
c-o-m

Nov 17 '05 #2

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

Similar topics

0
1610
by: Kevin Schneider | last post by:
Please forgive me if this is a bit off topic, but I haven't had any takers in other forums. With ASP.NET projects, is it possible to have VS.NET automatically change the configuration options of the "Copy Project" dialog box based on the value selected in the "Solution Configurations" drop down list? I'd like to set up the project that when Release is selected and I select "Copy Project", my production server's values are filled in.
1
1949
by: Daniel | last post by:
loading web application project suddonly takes 5 mintues and says "Contacting server to open Web project.." wile it takes 5 minutes to load. how to fix? i tried reregistering asp.net and iisreset. no progres.
2
1657
by: Axel Dahmen | last post by:
Hi, I'd like to write a simple COM Automation Server in C# but couldn't find a matching project. I want to have the IDE maintain the IDL and the REG file automatically. Which project should I use to achieve this? TIA, Axel
5
1680
by: Marco Zapletal | last post by:
hi group, i am facing the following problem: i have a vs.net (c#) project, which compiles into a class library. now i wrote a kind of testcase (with a main method()) which i want to execute (and debug) from vs.net. but i found no possibility how to execute this testcase in my project... any help would be appreciated,
4
1595
by: Don Wash | last post by:
Hi There! I'm using "Copy Project" function of VS.NET to upload my ASP.NET application to my web server (not my own web server) and they have Front Page Server Extensions installed as well. However, when I run the "Copy Project" function, I get this error.... Anybody can help me figure out the problem please?
3
2349
by: Mark.V.Sullivan | last post by:
I have encountered the same problem another posted about several months ago. Unfortunately, there was no result posted on the old thread. I will let the original message text stand and ask if anyone can help me with this.. "I have created a deployment project for a .NET program which opens a file with a custom extension. I have added the file type to the deployment project. After installation, double clicking a file with that...
3
1638
by: GB | last post by:
Hi, I used VB2005 (VB.Net Apps) for about a year without problem. And all at a sydden, nothing works now : When starting a project in VB.net (debug mode), I get a strange message : "Error while trying to run project : unable to start debugging. Handle de liaison non valide" (The last sentence is in french and means someting like "Linking handle not valid.) This happens for ALL projects, including NEW projects without any added object...
1
1411
by: Tina | last post by:
I have a project that I designed to be a "template" for other projects. It has all of the authentication and security functionality but is otherwise an empty project. How can I create a new project from this "template" ? Do I have to create an empty project and then import everything? I've always found it difficult to rename a project. Thanks, T
0
1669
by: howkoss | last post by:
Hi, I've been very frustrated for 2 days trying to make this work. I started with a built-in template "Projects" that came with Access 2007. On the "Employee List" I can click on any cell and bring up the Employee Detail" corresponding to that particular cell. That works fine. I want to be able to open "Employee Detail" when I click on a cell in "Project Detail". I got to the point that "Employee Detail" opens but only to the frst record. PLEASE...
0
8266
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
8199
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
8638
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
8365
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
7196
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
6125
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
5574
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();...
0
4092
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.