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!

Access Violation when a COM returns

Status
Not open for further replies.

cathym

Programmer
Jul 17, 2002
25
US
I have an Excel spreadsheet with a lot of data. This data needs to be crunched, and returned to the sheet so graphs can be created. To accomplish this I wrote a ATL COM in C++ 6.0. To manipulate the data, from the main function I call private void functions and passes the data through referenced parameters.

When this COM returns to the spreadsheet, it is causing an Excel Access violation. However, when I comment out the calls to the private functions, it works fine. But I need the functions for the data to be correct.

I am new to ATL, and I may be missing something in the private function definations or prototypes. I did this the same way I would have done a regular C++ program.

Can anyone help?





 
Try this.

1.Call AFX_MANAGE_STATE(AfxGetStaticModuleState()) in ur ATL com function.

 
Thanks, but I found the bug. I had gotten too hung up with the ATL stuff and I forgot the basics. My array indicies in the functions were incorrect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top