|
You don't provide any relevant information. Use the debugger to locate the problem more precisely. You can also use the call stack to see what causes the problem.
Where does it crash ? In the contructor of CSock or when calling the Create method ?
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
It crashes while calling create method
Regards.
|
|
|
|
|
zahid_ash wrote: It crashes while calling create method
What is the value of m_pListenSock ?
Where exactly does it crash (use the debugger to find the exact instruction). If it's really on the call of Create, then it means that m_pListenSock is invalid.
Alos, what is the exact error message you get. Man, you have to provide more information when asking for help. And learn to use the tools like a debugger, it is much more helpfull than a forum.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Would it be because If the Port creation is blocked by administrator on the system?
If it is becuase of admin rights , then how can i create the port ?
Regards.
|
|
|
|
|
Please provide more information ! And USE your debugger instead of trying to guess what the problem is. The only way to be sure of the problem is by debugging your code. If you know how to use it, your debugger will give you much more information that anybody here can give you.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
error is Cx0000005 Access violation
Regards.
|
|
|
|
|
Put a break point before this lines:
m_pListenSock = new CSock();<br />
m_pListenSock->Create(200);
And then press F11 (or F10) to step the program and find why comes the error.
Probally it depends on a bad initialization in the constructor (CSock() ), or in some strange operation in Create that uses an unitialized pointer.
Russell
|
|
|
|
|
CSock * m_ListenSock;
m_pListenSock is the memeber of CSock class that is inherited from CSocket class.
nothing is done in CSock() constructor.
then steps are CServerHandler class that is inherited from CWinThread class
m_pListenSock = new CSock();
upto this step all is fine
it crashes at
m_pListenSock->Create(200);
and says access violation
Regards.
|
|
|
|
|
zahid_ash wrote: it crashes at
m_pListenSock->Create(200);
and says access violation
So step into the Create() method to narrow down the problem.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
violation is at
if (m_pHashTable == NULL) in the following code in some VC++ file
void* CMapPtrToPtr::GetValueAt(void* key) const
// find value (or return NULL -- NULL values not different as a result)
{
if (m_pHashTable == NULL)
return NULL;
UINT nHash = HashKey(key) % m_nHashTableSize;
// see if it exists
CAssoc* pAssoc;
for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL; pAssoc = pAssoc->pNext)
{
if (pAssoc->key == key)
return pAssoc->value;
}
return NULL;
}
Regards.
|
|
|
|
|
zahid_ash wrote: m_pListenSock = new CSock();m_pListenSock->Create(200); // Before this statment ( Eror is access violation)
have you check, that m_pListenSock hold requested memory or not!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
can you show contructor CSock?
whitesky
|
|
|
|
|
I want to change button properties like shape,etc.i want to use a bit map as a button but not as rectangular shape.how can i do this?and what is owner draw?what is its use?
E-Ramu
|
|
|
|
|
|
Ramu wrote: I want to change button properties like shape,etc.i want to use a bit map as a button but not as rectangular shape.how can i do this?and what is owner draw?what is its use?
Use CBitmapButton
Set the property of the button as OwnerDraw.
And use LoadBitmap to load the bitmap of the button
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
You can derived cbutton and use event WM_DRAWITEM of course change ownerdraw in property from button
whitesky
|
|
|
|
|
Ramu.e wrote: want to change button properties like shape,etc.i want to use a bit map as a button but not as rectangular shape.how can i do this?and what is owner draw?what is its use?
have a look at this article :- http://www.codeproject.com/miscctrl/subclassdemo.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hello comunity,
how is to use TCS_OWNERDRAWFIXED for the CTabCtrl, in my case they dont answer on NM_CUSTOMDRAW message, so i think to try with this to set own tab style like font color for each tabitem??!!!!
Thanx
break;
|
|
|
|
|
Hi,
im finish with this!
break;
|
|
|
|
|
As you can see,any .exe file was compiled by Turbo C (for dos version) will run in dos mode!And if you write an application(in Turbo C) to draw something(a line,a circle...),you'll see these line or circle in dos mode!
I really dont know how to do that in VC++!
Can you help me!
Thank!
|
|
|
|
|
You should click on "Reply" instead of starting a new thread every time.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
|
|
|
kflrei wrote: write an application(in Turbo C) to draw something(a line,a circle...),you'll see these line or circle in dos mode!
It's 16-bit DOS; it's in graphical mode.
Maxwell Chen
|
|
|
|