EDN Admin
Well-known member
<p align=left><font face=Arial size=2>Hi,</font>
<p align=left>
<p align=left>I am using a win32 library in my project. I am calling one of the method from this library in my project. When I call this method from the main thread, there is no problem but if i create a new thread, and call the same method, it fails with access violation.
<p align=left>
<p align=left>while debuggin the same, I found that the dll has a class which inherits from "CSocket". when the dll calls the Create method on the CSocket class, it goes to "<font size=2>CAsyncSocket::Create" and fails at following statement: </font><font color="#0000ff" size=2>
if</font><font size=2> (Socket(nSocketType, lEvent))
<p align=left>I have no clue on why does it only fail when I call the dll method on a seperate thread, rather than main thread.
<p align=left>
<p align=left>Does it have something to do with the project setting??
<p align=left>
<p align=left>Please suggest.</font>
<p align=left>PS: there is no COM involved.
View the full article
<p align=left>
<p align=left>I am using a win32 library in my project. I am calling one of the method from this library in my project. When I call this method from the main thread, there is no problem but if i create a new thread, and call the same method, it fails with access violation.
<p align=left>
<p align=left>while debuggin the same, I found that the dll has a class which inherits from "CSocket". when the dll calls the Create method on the CSocket class, it goes to "<font size=2>CAsyncSocket::Create" and fails at following statement: </font><font color="#0000ff" size=2>
if</font><font size=2> (Socket(nSocketType, lEvent))
<p align=left>I have no clue on why does it only fail when I call the dll method on a seperate thread, rather than main thread.
<p align=left>
<p align=left>Does it have something to do with the project setting??
<p align=left>
<p align=left>Please suggest.</font>
<p align=left>PS: there is no COM involved.
View the full article