CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
Go Back  Xtreme Visual Basic Talk > > > CreateFileMapping (Shared mem) - Strange error


Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2017, 02:05 PM
Mathimagics's Avatar
MathimagicsCreateFileMapping (Shared mem) - Strange error Mathimagics is offline
Algorithms 'R' Us

Forum Leader
* Guru *
 
Join Date: Jun 2002
Location: Canberra
Posts: 4,152
Default CreateFileMapping (Shared mem) - Strange error


I have 2 apps that communicate via shared memory in the normal way:

Code:
   mHandle = CreateFileMappingA(&HFFFFFFFF, ByVal 0, 4&, 0, TableSize, MapName)
   pShared = MapViewOfFile(mHandle, 7&, 0, 0, TableSize)
Both apps use exactly the same code. This has been working happily for some time.

Now, all of a sudden, it works in one app but not the other. The failing app gets a 0 returned from CreateFileMappingA. One would expect an error code to be available via GetLastError, but that returns 0 also.

It's really weird!
__________________
Cogito, ergo codo
Reply With Quote
  #2  
Old 01-17-2017, 02:29 PM
Mathimagics's Avatar
MathimagicsCreateFileMapping (Shared mem) - Strange error Mathimagics is offline
Algorithms 'R' Us

Forum Leader
* Guru *
 
Join Date: Jun 2002
Location: Canberra
Posts: 4,152
Default

Well, it turns out that some IDIOT changed "TableSize" from a Const to a variable in one app, but forgot to assign it ...

When I catch up with him he'll be sorry!!
__________________
Cogito, ergo codo
Reply With Quote
  #3  
Old 01-18-2017, 12:15 PM
Cerian Knight's Avatar
Cerian KnightCreateFileMapping (Shared mem) - Strange error Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,169
Default

Same issue with a Const changed to a variable just a few days ago. There was code to populate the variable, but the initialization Sub wasn't being called.

I caught up with the guy who did it... I'm actually on my way now to get new glasses for him.
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
Reply

Tags
code, tablesize, app, apps, shared, error, failing, returned, sudden, expect, returns, confused, weird, getlasterror, createfilemappinga, normal, mhandle, byval, memory, communicate, mem, strange, mapname, pshared, createfilemapping


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
 
CreateFileMapping (Shared mem) - Strange error
CreateFileMapping (Shared mem) - Strange error
 
-->