473,471 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

LoadLibrary failing with GetLastError = 5

92 New Member
Working in some managed code that is trying to load one of my DLLs. This seems to work fine in release builds outside the context of my version amangement system. But inside it fails witha code of 5, whcih seems to be 'Access denied' which is silly since its there and full rights. So my code is ismply:
Expand|Select|Wrap|Line Numbers
  1. loaded_instance = LoadLibrary ("z:\sys\mydblib.dll);
  2.     if (!loaded_instance)
  3.         {
  4.         return_code = GetLastError ();
  5.         FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, 0, return_code, 0, windows_error_string, 255, NULL);
  6.         }
  7.  
Any ideas why this may fail? I even launched depends from the same command prompt and opened my DLL and everything looks fine in there. No broken links, no problems with the libs. I also tried giving write privleges to the DLLs linked to this one and still no joy. I did this since I used to have some old DLLs that would not work unless the linked in ones had RW access, which seems odd since code should never write to the DLL, right? Any ideas?
Sep 7 '07 #1
1 9699
Benny the Guard
92 New Member
Ok figured something out here. The issue seems to be that the Clearcase view I am using is on a Linux machine and therefore is not a native Windows directory. So it appears this means I have to set the executable bit for a DLL (even though its not an executable). Furthermore, for some reason windows does not load the libs if they also do not have Write privleges, which is odd, its a DLL , do we really need to write to it? Maybe something in the library (Sybase DB libs). So if I do a chmod 666 on them everything loads properly. Odd, truely odd....
Sep 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: db2inst2 | last post by:
Hi all, I am using win2K db2 8.1 fixpak 2. lately db2syscs.exe started using 100% CPU. This will be the load on the DB. An application will connect to the machine every 10minutes and do few...
0
by: Simon Jefferies | last post by:
Hello, I am using the LoadLibrary to load a DLL I've written, but the return value is NULL and GetLastError returns ERROR_INVALID_ADDRESS. The error happens under Release build. Any ideas...
8
by: ATS | last post by:
HOWTO Implement LoadLibrary\GetProcAdrress\FreeLibrary in C# Please help, I want to fully implement LoadLibrary\GetProcAdrress\FreeLibrary in C#, and be able to call functions that I use...
3
by: ATS | last post by:
HOWTO Implement LoadLibrary, GetProcAdress, and FreeLibrary. Below is code that I want to be able to use simple LoadLibrary\GetProcAddress\FreeLibrary technqiues on. I've used the code that was...
11
by: tomrmgc | last post by:
I have a dll that was working in VC6, but isn't loading after being built in VC71. LoadLibrary() returns null and the error code (from GetLastError()) is -2147483645 "One or more arguments are...
2
by: Lars Netzel | last post by:
I'm trying to make my own custom error page... but when using Try lblErrormessage.Text = Server.GetLastError.Message lblErrormessage.Text += "<br>" & Server.GetLastError.StackTrace ...
3
by: Michael Tissington | last post by:
I'm using LoadLibrary to import a DLL in a asp.net application. The dll was written in c++ and is located in the bin folder I have been testing the website on my development machine and our...
1
by: PLS | last post by:
I hope someone can explain why this piece of code is failing: CHARSETINFO csi; BOOL brc = TranslateCharsetInfo(&cf.locale, &csi, TCI_SRCLOCALE); cf.locale is an LCID with value 0x00000409....
1
by: sachinv1821 | last post by:
hi all , i am getting this Problem i am Unable to Load the DLL/ACM, the Problem with this (DLL /ACM ) is its a C code but this DLL using the C++ library i written a wrapper for C++ library and...
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
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...
0
muto222
php
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.