|
GetUserName API will help you in this case...
Regards,
Rane
|
|
|
|
|
Thank you for helping..I got the result
|
|
|
|
|
Hi,
i am using customized buttons in a dialog.
1: i am handling a set of 36 buttons click . it's not at all called on click of any of the buttons with in this range.
2: Crash at draw item. here is the call stack
CButton::DrawItem(tagDRAWITEMSTRUCT * 0x0012e204) line 72 + 25 bytes
CButton::OnChildNotify(unsigned int 43, unsigned int 2449, long 1237508, long * 0x00000000) line 84
CWnd::SendChildNotifyLastMsg(long * 0x00000000) line 2694
CWnd::ReflectLastMsg(HWND__ * 0x000a0a66, long * 0x00000000) line 2732
CWnd::OnDrawItem(int 2449, tagDRAWITEMSTRUCT * 0x0012e204) line 1167 + 14 bytes
CWnd::OnWndMsg(unsigned int 43, unsigned int 2449, long 1237508, long * 0x0012e0a4) line 1941
CWnd::WindowProc(unsigned int 43, unsigned int 2449, long 1237508) line 1596 + 30 bytes
AfxCallWndProc(CWnd * 0x0012ec10 {CCustColorDialog hWnd=???}, HWND__ * 0x000a0a6a, unsigned int 43, unsigned int 2449, long 1237508) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x000a0a6a, unsigned int 43, unsigned int 2449, long 1237508) line 379
AfxWndProcBase(HWND__ * 0x000a0a6a, unsigned int 43, unsigned int 2449, long 1237508) line 220 + 21 bytes
USER32! 77e3a454()
USER32! 77e16382()
USER32! 77e17361()
USER32! 77e3b66b()
USER32! 77e2b788()
USER32! 77e3b7b6()
USER32! 77e2e106()
USER32! 77e3a454()
USER32! 77e16b41()
USER32! 77e16b64()
CWnd::DefWindowProcA(unsigned int 296, unsigned int 196610, long 0) line 1011 + 32 bytes
CWnd::WindowProc(unsigned int 296, unsigned int 196610, long 0) line 1597 + 26 bytes
AfxCallWndProc(CWnd * 0x0012ec70 {CCustButton hWnd=???}, HWND__ * 0x000a0a66, unsigned int 296, unsigned int 196610, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x000a0a66, unsigned int 296, unsigned int 196610, long 0) line 379
AfxWndProcBase(HWND__ * 0x000a0a66, unsigned int 296, unsigned int 196610, long 0) line 220 + 21 bytes
USER32! 77e3a454()
USER32! 77e14750()
USER32! 77e155b0()
NTDLL! 77f91baf()
USER32! 77e29302()
USER32! 77e2d428()
USER32! 77e16b41()
USER32! 77e16b64()
CWnd::DefWindowProcA(unsigned int 296, unsigned int 196610, long 0) line 1011 + 32 bytes
CWnd::WindowProc(unsigned int 296, unsigned int 196610, long 0) line 1597 + 26 bytes
AfxCallWndProc(CWnd * 0x0012ec10 {CCustColorDialog hWnd=???}, HWND__ * 0x000a0a6a, unsigned int 296, unsigned int 196610, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x000a0a6a, unsigned int 296, unsigned int 196610, long 0) line 379
AfxWndProcBase(HWND__ * 0x000a0a6a, unsigned int 296, unsigned int 196610, long 0) line 220 + 21 bytes
USER32! 77e3a454()
USER32! 77e16382()
USER32! 77e1504b()
USER32! 77e29302()
USER32! 77e2d428()
USER32! 77e16b41()
USER32! 77e16b64()
CWnd::DefWindowProcA(unsigned int 295, unsigned int 196610, long 0) line 1011 + 32 bytes
CWnd::WindowProc(unsigned int 295, unsigned int 196610, long 0) line 1597 + 26 bytes
AfxCallWndProc(CWnd * 0x0012ec10 {CCustColorDialog hWnd=???}, HWND__ * 0x000a0a6a, unsigned int 295, unsigned int 196610, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x000a0a6a, unsigned int 295, unsigned int 196610, long 0) line 379
AfxWndProcBase(HWND__ * 0x000a0a6a, unsigned int 295, unsigned int 196610, long 0) line 220 + 21 bytes
USER32! 77e3a454()
USER32! 77e16382()
USER32! 77e2eaf2()
USER32! 77e2f46b()
CWnd::IsDialogMessageA(tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 182
CWnd::PreTranslateInput(tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 3435
CDialog::PreTranslateMessage(tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 92
CWnd::WalkPreTranslateTree(HWND__ * 0x001206c4, tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 2678 + 18 bytes
CWinThread::PreTranslateMessage(tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 672 + 18 bytes
CWinThread::PumpMessage() line 848 + 30 bytes
CWnd::RunModalLoop(unsigned long 4) line 3489 + 19 bytes
CDialog::DoModal() line 539 + 12 bytes
CCQPreWnd::OnLButtonDownView(unsigned int 1, CPoint {x=58 y=458}) line 8400
CCQPrWnd::OnLButtonDown(unsigned int 1, CPoint {x=58 y=458}) line 529
CWnd::OnWndMsg(unsigned int 513, unsigned int 1, long 30015546, long * 0x0012fbcc) line 1975
CWnd::WindowProc(unsigned int 513, unsigned int 1, long 30015546) line 1596 + 30 bytes
AfxCallWndProc(CWnd * 0x01915fe3 {CCQPressStatusWnd hWnd=???}, HWND__ * 0x000a0a44, unsigned int 513, unsigned int 1, long 30015546) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x000a0a44, unsigned int 513, unsigned int 1, long 30015546) line 379
AfxWndProcBase(HWND__ * 0x000a0a44, unsigned int 513, unsigned int 1, long 30015546) line 220 + 21 bytes
USER32! 77e3a454()
USER32! 77e14605()
USER32! 77e1a7f2()
USER32! 77e2f46b()
CWnd::IsDialogMessageA(tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 182
CWnd::PreTranslateInput(tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 3435
CDialog::PreTranslateMessage(tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 92
CPropertyViewPage::PreTranslateMessage(tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 167
CWnd::WalkPreTranslateTree(HWND__ * 0x001206c4, tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 2678 + 18 bytes
CWinThread::PreTranslateMessage(tagMSG * 0x00882450 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 672 + 18 bytes
CWinThread::PumpMessage() line 848 + 30 bytes
CWinThread::Run() line 487 + 11 bytes
CWinApp::Run() line 400
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x0014356c, int 1) line 49 + 11 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x0014356c, int 1) line 30
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 7c5989d5()
Regards,
Kdevloper
|
|
|
|
|
kDevloper wrote: CButton::DrawItem(tagDRAWITEMSTRUCT * 0x0012e204) line 72 + 25 bytes
So what is at line 72? Didn't you debug?
|
|
|
|
|
I too know it's in line no 72, but am asking how to fix it ..
|
|
|
|
|
kDevloper wrote: I too know it's in line no 72, but am asking how to fix it Smile ..
Quote Selected Text
But we dont know what is on line 72 so you might want to post some code here???
Naveen asked that did you debug line 72 to check what is causing crash??
Regards,
Sandip.
|
|
|
|
|
Please understand that we dont have any super powers to know what you have written on line 72....
So if you want some answer paste you code here and tell which line is 72..
|
|
|
|
|
I dont think this is not the right way to answer some one.. n e ways am not here to see or ask for any super power or paste the answer for me by some one. u shud 1st read before answering some one.
How to get an answer to your question by Chris Maunder
|
|
|
|
|
kDevloper wrote: I dont think this is not the right way to answer some one
I know. But you didnt left me a choice.
kDevloper wrote: or paste the answer for me by some one
But If some one wants to point out the mistake, they should know the code..right? When I asked for the code..what did you say..?
kDevloper wrote: How to get an answer to your question by Chris Maunder
Actually I am supposed to you tell you that...
|
|
|
|
|
The first point to get an answeer is to post a answerable question.
We all suspect that you have a file tha on its 72th line calls the haed of the stack you post, passing a wrong paramenter or a paramenter carrying wrong values.
But the only way for us to know abuit it is to see that line and at least the 10 liens before it.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
During the conversation n fighting session i got the answer to my pbm..
Thanks For the info.
Regards,
KDevloper
|
|
|
|
|
Why you down voted naveen's replies ??
To satisfy your ego ??? Down voting will not give answer to your problem
Regards,
Sandip.
|
|
|
|
|
Thanks for the vote pal..
|
|
|
|
|
kDevloper wrote: I dont think this is not the right way to answer some one..
you f*ckin idiot. Is that better ?
so, you think coming and asking crap will bring you the solution to you problem, always ?
come on, be serious, and grow up a bit. Naveen wasn't aggressive at all. the point with super powers is that you just don't give us all the informations we need to understand what's going on at Line 72, and still you don't show it after request. What are you hoping man ?
kDevloper wrote: n e ways
that's not a proper way to talk on a forum either. you have to write full words, no SMS.
kDevloper wrote: u shud 1st read before answering some one
I believe YOU should read the answers and be more modest instead of being rude with someone with much more experience than you.
If he asked you what was on Line 72, it's because he read all your huge errors report pasted (which I personnally didn't bother to read entierely at first), don't you think ?
kDevloper wrote: How to get an answer to your question by Chris Maunder
again, it's something YOU should read AND understand. Also, try to put on our place. would you be able to help someone asking for help if he brings a crappy error report without any code sample to analyze ?
|
|
|
|
|
Hi,
I am getting the following error when I login as a Standard User. I have created as DSN under System DSN section so that it is common to all the users. But still I am unable to connect to database when I login as a standard user..
ERROR: --------------- Database Error Information ---------------
ERROR: Server (wwlbs-03) Database (master) ODBC Data Source (u1)
ERROR: ODBC ( Data source name not found and no default driver specified )
ERROR: ODBC ( State:IM002,Native,Origin:[Microsoft][ODBC Driver Manager] )
ERROR: Unrecognized ODBC RETCODE = -1
ERROR: Dataset Name -- d1 -- not found
I am using VC++ . Any help would be appreciated.
Thanks,
Venkat
|
|
|
|
|
Hello,
I have written a client server application using sockets.
In this application, server will send data to client. I have used CSocket(MFC) for this purpose.
Server side application is working fine but problems start as soon as i had intoduced threading inside it.
Below is my code:
///////////////////////////////////////////////////////////
UINT __cdecl ThreadProc( LPVOID pParam ); // Signature of thread proc
AfxSocketInit(NULL);
CSocket sockSrvr;
sockSrvr.Create(PORT);
BOOL bListen = sockSrvr.Listen();
while (1)
{
CSocket sockRecv;
sockSrvr.Accept(sockRecv);
AfxBeginThread(ThreadProc, &sockRecv);
Sleep(5000);
}
///////////////////////////////////////////////////////////
I pass address of CSocket as parameter of 'ThreadProc' and as soon as control enters 'ThreadProc'
iget a debug assertion faliure from sockcore.cpp at the following line:
ASSERT(pState->m_hSocketWindow != NULL);
Can anybody of you please help me i am not able to understan wats wrong to this code?
Thanks in Advance!!
Regards
Tony
|
|
|
|
|
tony_udz wrote: while (1)
{
CSocket sockRecv;
sockSrvr.Accept(sockRecv);
AfxBeginThread(ThreadProc, &sockRecv);
Sleep(5000);
}
I think problem is you are creating sockRecv on stack.
As soon as you create the thread it will go out of scope and destructor will be called and connection will close. Try this
CSocket *sockRecv = new CSocket();
dont forget to delete the socket in the thread after the operations are complete.
I hope it helps.
I did not know that we can not use the worker thread with the CSocket
See Roger's Reply
Regards,
Sandip.
modified on Thursday, September 4, 2008 4:56 AM
|
|
|
|
|
You cannot use a worker thread for MFC sockets, you have to use a UI-thread with a message pump. Read more here[^].
When it comes to CSocket it's virtually useless when developing anything other than toy applications. Mostly because it is blocking when both reading and writing.
Use CAsyncSocket instead and you probably won't even need a secondary thread.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: You cannot use a worker thread for MFC sockets, you have to use a UI-thread with a message pump. Read more here[^].
Thanks for the update about CSocket I was not aware of this.
Regards,
Sandip.
|
|
|
|
|
SandipG wrote: Thanks for the update about CSocket I was not aware of this.
You're welcome Sandip.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Really thankful for your solution
|
|
|
|
|
Dear All,
My project requirement is MFC application need to create setup package and deployment.Im Using Visual Studio 2005.
It will be much helpful to me to give some advice on this..
Thank you very much,
Yours,
Anitha
|
|
|
|
|
|
Hi,
Will it support for Visual Studio 2005?
Thanks & Regards
Anitha
|
|
|
|
|
You did not even click on the link provided, did you? Inno works as a stand alone utility and has nothing to do with VS 2005.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|