473,399 Members | 4,177 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,399 software developers and data experts.

OpenFileMapping problem (Object does not exist)

Hi,
Good day! I have a problem opening a shared mem, the error code
of which is 2 (Object does not exist). This is my setup, a Windows
service calls a process A, process A creates successfully shared mem.
Then I have another app which runs on DOS prompt which tries to open
the shared mem but encounters error 2. The OS is Windows Server 2003
for Small Business Server (ServicePack 1). Since process A calls
another process (process B), i tested using OpenFilemapping (same open
code with DOS app) in process B and it successfully opened the shared
mem. Any ides?

TIA,
Roy

// Shared mem creation (NotQuiteNullDacl clss came from codeguru.com)
int maxlen = 256;
SECURITY_ATTRIBUTES MutexAttributes;
NotQuiteNullDacl Dacl;

bool bDaclOk = Dacl.Create();
ZeroMemory( &MutexAttributes, sizeof(MutexAttributes) );
MutexAttributes.nLength = sizeof( MutexAttributes );
MutexAttributes.bInheritHandle = FALSE;
SECURITY_DESCRIPTOR SD;
BOOL bInitOk = InitializeSecurityDescriptor( &SD,
SECURITY_DESCRIPTOR_REVISION );
BOOL bSetOk = SetSecurityDescriptorDacl( &SD,
TRUE,
Dacl.GetPDACL(),
FALSE );
MutexAttributes.lpSecurityDescriptor = &SD;
hmmf=CreateFileMapping((HANDLE) 0xFFFFFFFF,
&MutexAttributes,PAGE_READWRITE,0,maxlen,"MYSVCNAM E");

// Open shared mem
HANDLE hdltest = OpenFileMapping(FILE_MAP_READ, TRUE,"MYSVCNAME");

Mar 6 '07 #1
2 5168
iduniq wrote:
Hi,
Good day! I have a problem opening a shared mem, the error code
of which is 2 (Object does not exist). This is my setup, a Windows
service calls a process A, process A creates successfully shared mem.
Looks like you would be better off asking on a windows programming group.

--
Ian Collins.
Mar 6 '07 #2
On Mar 5, 9:33 pm, Ian Collins <ian-n...@hotmail.comwrote:
iduniq wrote:
Hi,
Good day! I have a problem opening a shared mem, the error code
of which is 2 (Object does not exist). This is my setup, a Windows
service calls a process A, process A creates successfully shared mem.

Looks like you would be better off asking on a windows programming group.
And/or one that discusses C++ (or whatever language the OP posted).
While it /may/ be C, there's just enough strangeness to make it not-C,
primarily around the use of functions as members of (uninitialized)
structures.
Mar 6 '07 #3

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

Similar topics

4
by: Mark D. Anderson | last post by:
About a month ago Richard Cornford did an interesting analysis of a memory leak in jscript (internet explorer) when there are "circular" references between DOM objects and (real) jscript objects:...
21
by: Jason Heyes | last post by:
I want to allow objects of my class to be read from an input stream. I am having trouble with the implementation. Here are the different approaches I have tried: // Version 1.0 - Default...
54
by: tshad | last post by:
I have a function: function SalaryDisplay(me) { var salaryMinLabel = document.getElementById("SalaryMin"); salaryMinLabel.value = 200; alert("after setting salaryMinLabel = " +...
0
by: Dirk Försterling | last post by:
Hi all, a few days ago, I upgraded from PostgreSQL 7.2.1 to 7.4, following the instructions in the INSTALL file, including dump and restore. All this worked fine without any error (message). ...
100
by: E. Robert Tisdale | last post by:
What is an object? Where did this term come from? Does it have any relation to the objects in "object oriented programming"?
8
by: ST | last post by:
Hello everyone, Can anyone help me with this error above when I debug my web app project in vstudio.net?? I can't figure it out! It was working fine for months, and now all of a sudden it's not!!...
12
by: Belebele | last post by:
Suppose that a class A depends on class B because an object of class B is passed into A's constructor. See below: class B { ... }; class A { public: A(B const& b); ... };
0
by: pkolinko | last post by:
Hi everyone, I am writing a small low level embedded USB application using C++/CLI windows Forms. I am sort of new to the C++/CLI and having trouble understanding what happens in this very...
14
by: Jeroen | last post by:
Hi all, I've got a question about writing a library. Let me characterize that library by the following: * there is a class A which is available to the user * there is a class B that is used...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...
0
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,...
0
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...

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.