Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6.0 developed ocx used by VB.NET2005 applicaiton issues

Status
Not open for further replies.

samIam2

Programmer
Oct 22, 2009
1
US
Hello,
I have a VB.net application developed in VS2005 that references an OCX file developed in VB6.

The OCX file essentially performs RS232 communications with a Comm device.

When my app runs all is fine, the comm objects member functions I call out execute successfully however when I close my application, I get the following error:

The instruction at "0xAddress" referenced at "0xAddress". The memory could not be read. Click ok to terminate program.

If I run the application in Debug mode I get:
LoaderLock was detected
Message: Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.

I have tried disposing the object instance when the app close but no luck

By the way, when I add the comm object to my form VS2005 automatically generates the wrapper class so I can interface with the object. What other step am I missing?

What else can I do?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top