Click here to Skip to main content
15,886,763 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: control RESOURCE definition Pin
Mircea Neacsu26-Jan-22 10:08
Mircea Neacsu26-Jan-22 10:08 
GeneralRe: control RESOURCE definition Pin
ForNow26-Jan-22 10:13
ForNow26-Jan-22 10:13 
GeneralRe: control RESOURCE definition Pin
Victor Nijegorodov26-Jan-22 22:56
Victor Nijegorodov26-Jan-22 22:56 
AnswerRe: control RESOURCE definition Pin
Victor Nijegorodov26-Jan-22 2:20
Victor Nijegorodov26-Jan-22 2:20 
GeneralRe: control RESOURCE definition Pin
ForNow26-Jan-22 2:24
ForNow26-Jan-22 2:24 
QuestionHow to sign pdf and verify the signature using a C++ open source library Pin
Member 1114733825-Jan-22 16:45
Member 1114733825-Jan-22 16:45 
AnswerRe: How to sign pdf and verify the signature using a C++ open source library Pin
Richard MacCutchan25-Jan-22 21:53
mveRichard MacCutchan25-Jan-22 21:53 
QuestionStack Overflow exeception Pin
ForNow25-Jan-22 1:41
ForNow25-Jan-22 1:41 
Im getting a stack over flow execption its not from an ASSERT but storage on my stack frame is corrupted. I have a thread Waitting on event to be notified when a socket read is pending

I trace socket number upon entry and its ok I initialize a WSABUF which 15 entires and its fine somewhere when I do the WaitforSingleObject the stack frame gets corrupted

I did a data break point on the socket and its was somewhere in UserCallwinprocccheckwow.

best to post my code some where in the WaiforSingleObject sonething happens to my stack frame

here is the code for notification
int ret1 = WSAEventSelect(mysocket, socksevent, FD_READ | FD_CLOSE);

here is the createthread

struct threadparm thethreads;
thethreads.thesocket = mysocket;
thethreads.sendwidow = pFrame->m_hWnd;
thethreads.messge = WM_STORAGE;
thethreads.sockevent = socksevent;
struct threadparm* parmptr = &thethreads;

HANDLE threadhandle = ::CreateThread(NULL, 0, SocketThread, (LPVOID)parmptr, 0, &threadid);


the thread with Waitforsingleobect were somewhere threadptr->thesocket gets corrupted


DWORD WINAPI SocketThread(LPVOID lphadleparater)
{
WSANETWORKEVENTS socknetwork;
struct threadparm* threadptr;
threadptr = (threadparm *)lphadleparater;
WSABUF DataBuf[15];
DWORD recived;
int i, j;
DWORD flags = 0;
WSAOVERLAPPED myoverlap;
char* sendcopy = new char[3825];
char* holdptr = sendcopy;
j = 0;
for (i = 0; i < 15; i++)
{
DataBuf[i].buf = new char[255];
DataBuf[i].len = 255;
}
struct _WSABUF* tcpip = &DataBuf[0];

DWORD dwWaitStatus = WaitForSingleObject(threadptr->sockevent, INFINITE);
switch (dwWaitStatus)
		/* a read is pending */
	    	case WAIT_OBJECT_0 + 0:
	{
		int return_code = WSAEnumNetworkEvents(threadptr->thesocket, threadptr->sockevent, &socknetwork);

AnswerRe: Stack Overflow exeception Pin
Greg Utas25-Jan-22 1:58
professionalGreg Utas25-Jan-22 1:58 
GeneralRe: Stack Overflow exeception Pin
ForNow25-Jan-22 2:14
ForNow25-Jan-22 2:14 
GeneralRe: Stack Overflow exeception Pin
Greg Utas25-Jan-22 2:32
professionalGreg Utas25-Jan-22 2:32 
GeneralRe: Stack Overflow exeception Pin
ForNow25-Jan-22 2:46
ForNow25-Jan-22 2:46 
GeneralRe: Stack Overflow exeception Pin
Graham Breach25-Jan-22 7:47
Graham Breach25-Jan-22 7:47 
AnswerRe: Stack Overflow exeception Pin
Mircea Neacsu25-Jan-22 2:11
Mircea Neacsu25-Jan-22 2:11 
GeneralRe: Stack Overflow exeception Pin
ForNow25-Jan-22 2:20
ForNow25-Jan-22 2:20 
Questionfunction translated to ASM Pin
Calin Negru24-Jan-22 23:42
Calin Negru24-Jan-22 23:42 
AnswerRe: function translated to ASM Pin
CPallini25-Jan-22 0:10
mveCPallini25-Jan-22 0:10 
GeneralRe: function translated to ASM Pin
Calin Negru25-Jan-22 11:24
Calin Negru25-Jan-22 11:24 
GeneralRe: function translated to ASM Pin
CPallini25-Jan-22 20:00
mveCPallini25-Jan-22 20:00 
AnswerRe: function translated to ASM Pin
trønderen25-Jan-22 0:51
trønderen25-Jan-22 0:51 
GeneralRe: function translated to ASM Pin
Fly Gheorghe25-Jan-22 8:59
Fly Gheorghe25-Jan-22 8:59 
GeneralRe: function translated to ASM Pin
trønderen25-Jan-22 23:23
trønderen25-Jan-22 23:23 
GeneralRe: function translated to ASM Pin
Fly Gheorghe28-Jan-22 3:39
Fly Gheorghe28-Jan-22 3:39 
GeneralRe: function translated to ASM Pin
Richard Andrew x6430-Jan-22 4:48
professionalRichard Andrew x6430-Jan-22 4:48 
AnswerRe: function translated to ASM Pin
k505430-Jan-22 5:11
mvek505430-Jan-22 5:11 

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.