Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Windows
 ActiveX Controls
 PrintGraph() method crashes

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
jfgibson Posted - 19 Aug 2004 : 23:49:14
I am using the CTWX.OCX charting ActiveX control with Visual C++ V6.0 on Windows XP Pro. Everything is working fine for building and displaying a chart. Then I call PrinterSetup(), followed by PrintGraph(), at which point an error occurs.

Stepping through the code, when the following call executes, Windows returns the error message "Unhandled exception in <myExecutable> (WCT32DX.DLL); 0xC0000005: Access Violation.

void CCTWX::PrintGraph()
{
InvokeHelper(0x4e, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}

I get the same type of error if, instead of calling the print method, I call the SavePageMeta() method.

Is it clear to anyone what might be happening?

Further detail:
Stepping into the InvokeHelper method, the violation occurs at the end of this chain of calls:

In WINOCC.CPP:
m_pCtrlSite->InvokeHelperV(dwDispID, wFlags, vtRet, pvRet, pbParamInfo, argList);

In OCCSITE.CPP:
m_dispDriver.InvokeHelperV(dwDispID, wFlags, vtRet, pvRet, pbParamInfo, argList);


In OLEDISP2.CPP:
SCODE sc = m_lpDispatch->Invoke(dwDispID, IID_NULL, 0, wFlags, &dispparams, pvarResult, &excepInfo, &nArgErr);

Error occurs on the above call, with dispparams appearing to contain a lot of null variables.



Jim Gibson
2   L A T E S T    R E P L I E S    (Newest First)
jfgibson Posted - 20 Aug 2004 : 21:23:53
That was indeed the problem... I was trying to print from the BuildGraph() method, which is called inside OnInitialUpdate(). I moved the print calls into a separate command handler, and it works fine. Thank you very much!

Jim Gibson
quinncurtis Posted - 20 Aug 2004 : 08:51:28
Is this the first time you have tried to print. Did the functions work under a different operating system, or in a different program.

The print and metafile functions CANNOT be called in the graph building (OnInitialUpdate) routine with the graph property initialization methods. They can only be called after the graph is displayed on the screen, which takes place after the OnInitialUpdate method.

Can you modiy the example program Simple, adding a button to invoke printing, to demonstrate the problem ?

Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07