Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Shared memory

, 28 Sep 2002
Share variables in the shared memory across processes
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
    "#define _AFX_NO_OLE_RESOURCES\r\n"
    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
    "\r\n"
    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
    "#ifdef _WIN32\r\n"
    "LANGUAGE 9, 1\r\n"
    "#pragma code_page(1252)\r\n"
    "#endif //_WIN32\r\n"
    "#include ""res\\TestSM.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
    "#include ""afxres.rc""         // Standard components\r\n"
    "#endif\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME           ICON    DISCARDABLE     "res\\TestSM.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 265, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About Test CSharedMemory"
FONT 8, "MS Sans Serif"
BEGIN
    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,21,20
    LTEXT           "Test CSharedMemory Version 1.0, Martin Ziacek",
                    IDC_STATIC,40,10,154,8,SS_NOPREFIX
    LTEXT           "Copyright (C) 2001 Martin Ziacek",IDC_STATIC,40,25,119,
                    8
    DEFPUSHBUTTON   "OK",IDOK,208,7,50,14,WS_GROUP
END

IDD_TESTSM_DIALOG DIALOGEX 0, 0, 549, 231
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Test CSharedMemory"
FONT 8, "MS Sans Serif"
BEGIN
    CONTROL         "List4",IDC_SHAREDMEMORY,"SysListView32",LVS_REPORT | 
                    LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOSORTHEADER | 
                    WS_BORDER | WS_TABSTOP,7,7,388,217
    PUSHBUTTON      "Increment",IDC_INCREMENT,400,7,65,14
    PUSHBUTTON      "Decrement",IDC_DECREMENT,400,26,65,14
    PUSHBUTTON      "Exchange",IDC_EXCHANGE,400,45,65,14
    PUSHBUTTON      "TestExchange",IDC_TESTEXCHANGE,400,64,65,14
    PUSHBUTTON      "CompareExchange",IDC_COMPAREEXCHANGE,400,83,65,14
    PUSHBUTTON      "ExchangeAdd",IDC_EXCHANGEADD,400,102,65,14
    PUSHBUTTON      "Read",IDC_READ,400,140,65,14
    PUSHBUTTON      "Add ...",IDC_ADD,477,7,65,14
    PUSHBUTTON      "Delete",IDC_DEL,477,26,65,14
    PUSHBUTTON      "Refresh",IDC_REFR,477,45,65,14
    PUSHBUTTON      "Set value ...",IDC_SETVAL,477,64,65,14
    PUSHBUTTON      "Wait for var.",IDC_WAITFORCHANGE,477,83,65,14
    PUSHBUTTON      "Wait for mem.",IDC_WAITMEM,477,102,65,14
    PUSHBUTTON      "Write",IDC_WRITE,477,140,65,14
    LTEXT           "Total allocated size:",IDC_STATIC,400,159,65,8
    RTEXT           "0",IDC_MEMORYSIZE,477,159,65,8
    LTEXT           "Used by data:",IDC_STATIC,400,171,65,8
    RTEXT           "0",IDC_USEDSIZE,477,171,65,8
    LTEXT           "Number of variables:",IDC_STATIC,400,183,65,8
    RTEXT           "0",IDC_VARIABLESCOUNT,477,183,65,8
    LTEXT           "Total bytes used:",IDC_STATIC,400,195,65,8
    RTEXT           "0",IDC_TOTALUSAGE,477,195,65,14
    DEFPUSHBUTTON   "Close",IDOK,477,210,65,14
    PUSHBUTTON      "Wait for multi",IDC_WAITFORMULTIVARCHANGE,401,121,65,14
END

IDD_ADDVALUE DIALOG DISCARDABLE  0, 0, 186, 47
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Add value"
FONT 8, "MS Sans Serif"
BEGIN
    LTEXT           "Name:",IDC_STATIC,7,11,22,8
    EDITTEXT        IDC_NAME,45,7,80,14,ES_AUTOHSCROLL
    LTEXT           "Size:",IDC_STATIC,7,29,16,8
    EDITTEXT        IDC_VALSIZE,45,26,40,14,ES_AUTOHSCROLL | ES_NUMBER
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
END

IDD_SETVALUE DIALOG DISCARDABLE  0, 0, 186, 46
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Set text value"
FONT 8, "MS Sans Serif"
BEGIN
    LTEXT           "Value:",IDC_STATIC,7,9,21,8
    EDITTEXT        IDC_NEWVALUE,45,7,80,14,ES_AUTOHSCROLL
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
END


#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,1
 PRODUCTVERSION 1,0,0,1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904B0"
        BEGIN
            VALUE "CompanyName", "\0"
            VALUE "FileDescription", "TestSM MFC Application\0"
            VALUE "FileVersion", "1, 0, 0, 1\0"
            VALUE "InternalName", "TestSM\0"
            VALUE "LegalCopyright", "Copyright (C) 2000\0"
            VALUE "LegalTrademarks", "\0"
            VALUE "OriginalFilename", "TestSM.EXE\0"
            VALUE "ProductName", "TestSM Application\0"
            VALUE "ProductVersion", "1, 0, 0, 1\0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

#endif    // !_MAC


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE 
BEGIN
    IDD_ABOUTBOX, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 258
        TOPMARGIN, 7
        BOTTOMMARGIN, 48
    END

    IDD_TESTSM_DIALOG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 542
        VERTGUIDE, 250
        VERTGUIDE, 395
        VERTGUIDE, 400
        VERTGUIDE, 465
        VERTGUIDE, 470
        TOPMARGIN, 7
        BOTTOMMARGIN, 224
        HORZGUIDE, 21
        HORZGUIDE, 26
        HORZGUIDE, 40
        HORZGUIDE, 45
        HORZGUIDE, 59
        HORZGUIDE, 64
        HORZGUIDE, 78
        HORZGUIDE, 83
        HORZGUIDE, 97
        HORZGUIDE, 102
        HORZGUIDE, 116
        HORZGUIDE, 121
        HORZGUIDE, 135
        HORZGUIDE, 140
        HORZGUIDE, 154
        HORZGUIDE, 159
        HORZGUIDE, 172
        HORZGUIDE, 184
    END

    IDD_ADDVALUE, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        VERTGUIDE, 45
        VERTGUIDE, 125
        VERTGUIDE, 130
        TOPMARGIN, 7
        BOTTOMMARGIN, 40
        HORZGUIDE, 21
        HORZGUIDE, 26
    END

    IDD_SETVALUE, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        VERTGUIDE, 45
        VERTGUIDE, 125
        TOPMARGIN, 7
        BOTTOMMARGIN, 39
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE DISCARDABLE 
BEGIN
    IDS_ABOUTBOX            "&About TestSM..."
    IDS_VARIABLE            "Name"
    IDS_WAIT                "Select wait variables"
    IDS_WAITFOR             "Wait for All?"
    IDS_SELECT_ALL          "Select all variables"
END

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// English (U.K.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_EXCHANGE_DLG DIALOG DISCARDABLE  0, 0, 186, 46
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "InterlockedExchange()"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
    LTEXT           "New value:",IDC_STATIC,7,9,37,8
    EDITTEXT        IDC_NEWVALUE,63,7,40,14,ES_AUTOHSCROLL
END

IDD_TESTEXCH_DLG DIALOG DISCARDABLE  0, 0, 186, 47
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "InterlockedTestExchange()"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
    LTEXT           "Old value:",IDC_STATIC,7,10,33,8
    EDITTEXT        IDC_OLDVALUE,50,7,40,14,ES_AUTOHSCROLL
    LTEXT           "New value:",IDC_STATIC,7,29,37,8
    EDITTEXT        IDC_NEWVALUE,50,26,40,14,ES_AUTOHSCROLL
END

IDD_CMPEXCH_DLG DIALOG DISCARDABLE  0, 0, 186, 47
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "InterlockedCompareExchange()"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
    LTEXT           "Exchange:",IDC_STATIC,7,9,35,8
    EDITTEXT        IDC_EXCH,50,7,40,14,ES_AUTOHSCROLL
    LTEXT           "Comperand:",IDC_STATIC,7,28,39,8
    EDITTEXT        IDC_CMP,50,26,40,14,ES_AUTOHSCROLL
END

IDD_EXCHADD_DLG DIALOG DISCARDABLE  0, 0, 186, 46
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "InterlockedExchangeAdd()"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
    LTEXT           "Increment:",IDC_STATIC,7,9,34,8
    EDITTEXT        IDC_ADD,50,7,40,14,ES_AUTOHSCROLL
END

IDD_WRITE_DLG DIALOG DISCARDABLE  0, 0, 297, 87
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Write()"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,240,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,240,24,50,14
    EDITTEXT        IDC_WRITESTRING,7,7,225,58,ES_MULTILINE | ES_AUTOHSCROLL | 
                    ES_WANTRETURN | WS_VSCROLL
    LTEXT           "Offset",IDC_STATIC,7,69,20,8
    EDITTEXT        IDC_OFFSET,35,67,40,14,ES_AUTOHSCROLL
END

IDD_WAITMULTIVARCH_DLG DIALOGEX 0, 0, 386, 199
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Wait for multiple variable"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,193,170,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,142,170,50,14
    CONTROL         "List2",IDC_MULTIVAR_LIST,"SysListView32",LVS_REPORT | 
                    LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,6,3,374,149,
                    WS_EX_STATICEDGE
    CONTROL         "Wait for all",IDC_WAIT_FOR_ALL,"Button",BS_AUTOCHECKBOX | 
                    WS_TABSTOP,125,156,54,8
    CONTROL         "Select all variables",IDC_SELECT_ALL,"Button",
                    BS_AUTOCHECKBOX | WS_TABSTOP,186,156,75,9
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE 
BEGIN
    IDD_EXCHANGE_DLG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        TOPMARGIN, 7
        BOTTOMMARGIN, 39
    END

    IDD_TESTEXCH_DLG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        VERTGUIDE, 50
        TOPMARGIN, 7
        BOTTOMMARGIN, 40
        HORZGUIDE, 21
        HORZGUIDE, 26
    END

    IDD_CMPEXCH_DLG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        VERTGUIDE, 50
        TOPMARGIN, 7
        BOTTOMMARGIN, 40
        HORZGUIDE, 21
        HORZGUIDE, 26
    END

    IDD_EXCHADD_DLG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        VERTGUIDE, 50
        TOPMARGIN, 7
        BOTTOMMARGIN, 39
    END

    IDD_WRITE_DLG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 290
        TOPMARGIN, 7
        BOTTOMMARGIN, 80
    END

    IDD_WAITMULTIVARCH_DLG, DIALOG
    BEGIN
        LEFTMARGIN, 1
        RIGHTMARGIN, 384
        TOPMARGIN, 1
        BOTTOMMARGIN, 195
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//

IDB_CHECKBOXES          BITMAP  DISCARDABLE     "res\\checkboxes.bmp"
#endif    // English (U.K.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\TestSM.rc2"  // non-Microsoft Visual C++ edited resources
#include "afxres.rc"         // Standard components
#endif

/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Martin Ziacek
Software Developer (Senior)
United Kingdom United Kingdom
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150327.1 | Last Updated 29 Sep 2002
Article Copyright 2001 by Martin Ziacek
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid