Click here to Skip to main content
15,914,071 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can i get the Window Handle... Pin
Renjith Ramachandran17-Oct-02 0:57
Renjith Ramachandran17-Oct-02 0:57 
GeneralRe: How can i get the Window Handle... Pin
Tomasz Sowinski17-Oct-02 0:58
Tomasz Sowinski17-Oct-02 0:58 
GeneralRe: How can i get the Window Handle... Pin
Renjith Ramachandran17-Oct-02 1:00
Renjith Ramachandran17-Oct-02 1:00 
GeneralRe: How can i get the Window Handle... Pin
Tomasz Sowinski17-Oct-02 1:08
Tomasz Sowinski17-Oct-02 1:08 
GeneralRe: How can i get the Window Handle... Pin
Renjith Ramachandran17-Oct-02 1:58
Renjith Ramachandran17-Oct-02 1:58 
GeneralRe: How can i get the Window Handle... Pin
Tomasz Sowinski17-Oct-02 2:05
Tomasz Sowinski17-Oct-02 2:05 
GeneralRe: How can i get the Window Handle... Pin
Renjith Ramachandran17-Oct-02 6:05
Renjith Ramachandran17-Oct-02 6:05 
QuestionHow to create a StartDialog Pin
AnTri16-Oct-02 23:55
AnTri16-Oct-02 23:55 
AnswerRe: How to create a StartDialog Pin
Tomasz Sowinski17-Oct-02 0:02
Tomasz Sowinski17-Oct-02 0:02 
GeneralRe: How to create a StartDialog Pin
AnTri17-Oct-02 0:22
AnTri17-Oct-02 0:22 
GeneralRe: How to create a StartDialog Pin
Tomasz Sowinski17-Oct-02 0:26
Tomasz Sowinski17-Oct-02 0:26 
AnswerRe: How to create a StartDialog Pin
Renjith Ramachandran17-Oct-02 0:51
Renjith Ramachandran17-Oct-02 0:51 
GeneralMCI Pin
Gian16-Oct-02 23:10
Gian16-Oct-02 23:10 
GeneralRe: MCI Pin
Tomasz Sowinski17-Oct-02 0:09
Tomasz Sowinski17-Oct-02 0:09 
GeneralRe: MCI Pin
Gian17-Oct-02 1:52
Gian17-Oct-02 1:52 
GeneralRe: MCI Pin
Steve S17-Oct-02 2:33
Steve S17-Oct-02 2:33 
GeneralSubclassing Listbox Pin
suresh_sathya16-Oct-02 22:56
suresh_sathya16-Oct-02 22:56 
GeneralRe: Subclassing Listbox Pin
Tomasz Sowinski16-Oct-02 23:26
Tomasz Sowinski16-Oct-02 23:26 
GeneralCaret not positioned in Richedit Pin
insanely42016-Oct-02 22:56
insanely42016-Oct-02 22:56 
QuestionHow to share an object on the level of the OS? Pin
Raphael Kindt16-Oct-02 21:41
Raphael Kindt16-Oct-02 21:41 
AnswerRe: How to share an object on the level of the OS? Pin
Paul M Watt16-Oct-02 22:01
mentorPaul M Watt16-Oct-02 22:01 
You can use a pointer inside of your Memory mapped file, you will just need to manager the memory yourself.

So if you create your initial object, then decide that you want to allocate 50 bytes for a string, you can place that 50 bytes anywhere in your memory mapped file, however you will need to keep track somehow that it is being used so you do not reallocate it for another pointer.

Another solution is to use your memory mapped files for you objects, and any pointers you could allocate with GlobalAlloc. This allows you to share the allocated pointers between processes, however you will need to lock the pointer in place for each process before you attempt to use it. This solution is a little more cumbersome than new, but it may be better for you than writing your own memory manager for the file mapping scheme.

One other thing, if you decide to do GlobalAlloc, you could make you one single object that is shared by all apps, in your single DLL, a global object inside of a shared data section. That would save you the trouble of setting up and deleting the memory mapped file.

You can declare a variable in a shared data section simply by declaring it like this:
<br />
#pragma comment(linker, "/SECTION:.shr,RWS")<br />
#pragma data_seg(".shr")<br />
//C: This variable is shared among all process that load this DLL now.<br />
OBJECT g_obj;<br />
#pragma data_seg()<br />


Good Luck


Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: How to share an object on the level of the OS? Pin
Raphael Kindt17-Oct-02 1:31
Raphael Kindt17-Oct-02 1:31 
Questionmore than one help file???? Pin
Mistermr16-Oct-02 21:03
Mistermr16-Oct-02 21:03 
AnswerRe: more than one help file???? Pin
Tomasz Sowinski16-Oct-02 23:33
Tomasz Sowinski16-Oct-02 23:33 
GeneralTrackMouseEvent little example Pin
Joan M16-Oct-02 20:20
professionalJoan M16-Oct-02 20:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.