Click here to Skip to main content
15,349,119 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Accessing and displaying semaphore count Pin
Victor Nijegorodov22-May-22 6:15
MemberVictor Nijegorodov22-May-22 6:15 
GeneralRe: Accessing and displaying semaphore count Pin
coco24322-May-22 7:17
Membercoco24322-May-22 7:17 
QuestionOwnerDraw Combox Pin
ForNow18-May-22 14:28
MemberForNow18-May-22 14:28 
AnswerRe: OwnerDraw Combox Pin
Victor Nijegorodov18-May-22 21:13
MemberVictor Nijegorodov18-May-22 21:13 
QuestionC++ code for Gomoku Pin
Lesego Molelekoa18-May-22 5:58
MemberLesego Molelekoa18-May-22 5:58 
AnswerRe: C++ code for Gomoku Pin
Richard MacCutchan18-May-22 6:01
mveRichard MacCutchan18-May-22 6:01 
AnswerRe: C++ code for Gomoku Pin
Victor Nijegorodov18-May-22 9:25
MemberVictor Nijegorodov18-May-22 9:25 
QuestionSecurity Check Stack overflow compiler GS option Pin
ForNow16-May-22 2:16
MemberForNow16-May-22 2:16 
Hi
I put my ownerdraw code in a C dll upon exiting it I got a Security check stack overflow. I turned the /GS complier option off looked to work fine under VS debugger. The Calling code is MFC C/C++

The DLL is in C

Here is the MFC code

C++
CMystatic::CMystatic()
{
    width = 0;
    mod = LoadLibrary(TEXT("C:\\SYSADATA\\SYSADATA\\x64\\Debug\\SYSADATA.DLL"));
    drawptr = (fownerdraw)GetProcAddress(mod, "ownerdraw");
    strsize.cx = 0;
    strsize.cy = 0;
    myexitparm = &exitparm;
}

void CMystatic::DrawItem(LPDRAWITEMSTRUCT pdi)
{
    
    exitparm.pdi = pdi;
    exitparm.sizeptr = &strsize;
    
    (drawptr)(myexitparm);
    
}



Here is the C DLL

C++
 typedef struct EXITPARM
{
    LPDRAWITEMSTRUCT pdi;
    SIZE* sizeptr;

};
// void  ownerdraw(exitparmptr);
typedef struct EXITPARM* exitparmptr;
__declspec(dllexport) void ownerdraw(exitparmptr parmptr);

void  ownerdraw(exitparmptr parmptr)
{
    
    LPDRAWITEMSTRUCT pdi = parmptr->pdi;
   // (char*)myexit += 8;
    SIZE* mysize = parmptr->sizeptr;

AnswerRe: Security Check Stack overflow compiler GS option Pin
Victor Nijegorodov16-May-22 3:08
MemberVictor Nijegorodov16-May-22 3:08 
GeneralRe: Security Check Stack overflow compiler GS option Pin
ForNow16-May-22 3:22
MemberForNow16-May-22 3:22 
QuestionHow can i define cardinalization in c++? Pin
Member 1563777116-May-22 1:38
MemberMember 1563777116-May-22 1:38 
AnswerRe: How can i define cardinalization in c++? Pin
Mircea Neacsu16-May-22 1:54
mvaMircea Neacsu16-May-22 1:54 
GeneralRe: How can i define cardinalization in c++? Pin
David Crow16-May-22 2:13
MemberDavid Crow16-May-22 2:13 
AnswerRe: How can i define cardinalization in c++? Pin
Randor 16-May-22 4:25
professional Randor 16-May-22 4:25 
QuestionConverting from MFC to Native Windows C Pin
ForNow12-May-22 12:48
MemberForNow12-May-22 12:48 
AnswerRe: Converting from MFC to Native Windows C Pin
Richard MacCutchan13-May-22 0:29
mveRichard MacCutchan13-May-22 0:29 
GeneralRe: Converting from MFC to Native Windows C Pin
ForNow13-May-22 1:34
MemberForNow13-May-22 1:34 
GeneralRe: Converting from MFC to Native Windows C Pin
Richard MacCutchan13-May-22 2:05
mveRichard MacCutchan13-May-22 2:05 
GeneralRe: Converting from MFC to Native Windows C Pin
ForNow13-May-22 3:10
MemberForNow13-May-22 3:10 
GeneralRe: Converting from MFC to Native Windows C Pin
Richard MacCutchan13-May-22 3:48
mveRichard MacCutchan13-May-22 3:48 
Questionmy problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Member 1563347212-May-22 0:17
MemberMember 1563347212-May-22 0:17 
AnswerRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
OriginalGriff12-May-22 0:26
mveOriginalGriff12-May-22 0:26 
QuestionRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Member 1563347212-May-22 0:43
MemberMember 1563347212-May-22 0:43 
AnswerRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Richard Deeming12-May-22 0:54
mveRichard Deeming12-May-22 0:54 
AnswerRe: my problem is output for this weight conversion pounds to kilogram that starts from 100 to 300. Pin
Michael Hulthin12-May-22 1:06
MemberMichael Hulthin12-May-22 1:06 

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.