Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. use of "SECTION" within a hook dll ..?

use of "SECTION" within a hook dll ..?

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    only_jack
    wrote on last edited by
    #1

    hi to all i want to store some string datas in a CString or similar variable and i need a int variable also this is a global hook dll and i want to update this variables at runtime and all applications should access to this variables which load this dll simly : i can say this dll will be a bridge between applications which load this dll i have found the following sample but i could not write a working one from it application exits with crash always note: the following sample copied from a C project and my dll is a MFC/C++ dll thank you

    #pragma data_seg(".shared")
    #pragma comment(linker, "/section:.shared,rws")

    HHOOK g_hHook = 0;
    HWND g_hwndNotify = 0;
    BOOL g_FirstInstance = FALSE;

    UINT g_nButtonCmdId[MAX_TITLE_BUTTONS] = { 0 };
    UINT g_nButtonResId[MAX_TITLE_BUTTONS] = { 0 };
    int g_nButtonCount = 0;

    WCHAR g_szBlackList[MAX_BLACKLIST][64] = { 1 };
    LONG g_nBlackListLen = 0;

    #pragma data_seg()

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups