15,901,035 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 15011436 (Top 4 by date)
Member 15011436
25-Mar-21 10:06am
View
Thanks,
Below code worked.
CRect programEditCntrlRect;
CWnd* prgEdit = GetDlgItem(IDC_EDIT_PrgTxt);
prgEdit->GetWindowRect(&programEditCntrlRect);
this->ScreenToClient(&programEditCntrlRect);
Member 15011436
26-Feb-21 10:18am
View
Using DLL is program design's demand.
I think I am done with most on dll, call back is set.
Application 1 can pass argument and events to dll. When DLL tries to call application 2 callback, it throws access violation error. Then I searched and found your remarks on a old question, that gives idea on shared memory.
Please advise "How to initialize the code for shared memory in generated code that does not have DllMain?" This answer will save my many old work in dll.
Member 15011436
26-Feb-21 8:25am
View
Deleted
C++
Copy
// The DLL code
#include <windows.h>
#include <memory.h>
#define SHMEMSIZE 4096
static LPVOID lpvMem = NULL; // pointer to shared memory
static HANDLE hMapObject = NULL; // handle to file mapping
// The DLL entry-point function sets up shared memory using a
// named file-mapping object.
BOOL WINAPI DllMain(HINSTANCE hinstDLL, // DLL module handle
DWORD fdwReason, // reason called
LPVOID lpvReserved) // reserved
{
Member 15011436
26-Feb-21 8:18am
View
Hi Richard, Thanks for your time.
I am trying to develop a DLL with capability of sharing data , events between two or more different MFC applications.
For example MFC Application 1 will send x, y, radius of sphere to the dll, then dll should pass these data with some draw sphere event to 2nd MFC application that will draw the sphere.
https://docs.microsoft.com/en-us/windows/win32/dlls/using-shared-memory-in-a-dynamic-link-library
BOOL WINAPI DllMain(HINSTANCE hinstDLL, // DLL module handle
DWORD fdwReason, // reason called
LPVOID lpvReserved) // reserved
{
This looks part of DLL.