Click here to Skip to main content
15,914,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pragma warning disable? Pin
User 66589-Jul-02 0:03
User 66589-Jul-02 0:03 
Questionmalloc/new vs GlobalAlloc strategy ? Pin
yarp8-Jul-02 9:59
yarp8-Jul-02 9:59 
AnswerRe: malloc/new vs GlobalAlloc strategy ? Pin
Tim Smith8-Jul-02 10:10
Tim Smith8-Jul-02 10:10 
GeneralRe: malloc/new vs GlobalAlloc strategy ? Pin
yarp8-Jul-02 18:52
yarp8-Jul-02 18:52 
AnswerRe: malloc/new vs GlobalAlloc strategy ? Pin
Marshall8-Jul-02 10:51
Marshall8-Jul-02 10:51 
AnswerRe: malloc/new vs GlobalAlloc strategy ? Pin
Gary Kirkham8-Jul-02 11:51
Gary Kirkham8-Jul-02 11:51 
GeneralRe: malloc/new vs GlobalAlloc strategy ? Pin
yarp8-Jul-02 18:57
yarp8-Jul-02 18:57 
Generalautomation problem. excel Pin
pnpfriend8-Jul-02 9:55
pnpfriend8-Jul-02 9:55 
I had created "excel", that fromat, and print excel file. it is based on the article,
http://support.microsoft.com/directory/article.asp?ID=kb;en-us;Q178749 .
I followed every steps what it said on the article. and the execl program is working perfectly.

i also have another application that does printing job. it print any kind of files using shellexecuteex. anyway, i
1) opened classWizard
2) clicked on Automation tab
3) clicked on add class-> from a library
4) find execl9.olb , which is in c:\program\microsoft office\office
5) selected the classes that i need from excel9 lib.
6) added, the following codes in CMyprintApp::IniInstance() function, which loads and enables the COM services library;
<br />
     if(!AfxOleInit())<br />
  {<br />
    AfxMessageBox("Could not initialize COM dll");<br />
    return FALSE;<br />
  }<br />
<br />
  AfxEnableControlContainer();<br />
      .......<br />
<br />


7) in printExcel function, which is for MyPrint program, and onRun button function, which is for the execl program. i added the following code
[code]
_Application app; // app is an application object.
_Workbook book; // workbook object
_Worksheet sheet; // worksheet object
Workbooks books;
Worksheets sheets;

Range range; // used for Microsoft excel 97 component
LPDISPATCH lpDisp; //often reused variable.

//common OLE variants. Easy variants to use for calling arguments.
COleVariant covTrue((short)TRUE),covFalse((short)FALSE),covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);

//start microsoft excel, get application object, and attach to app object,
if(!app.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Couldn't CreateDispatch() for Excel");
return;
}
[/code]

those steps are the steps that i did for the excel program. but the function is working fine for excel program but not for Myprint program.
I got the message "Couldn't CreateDispatch() for Excel " for myPrint program.

can anyone tell me why??
QuestionGDI+ Image.Save Function? Pin
Andy Brace8-Jul-02 9:41
Andy Brace8-Jul-02 9:41 
GeneralExe/Dll Dependancies. Pin
Mike Doner8-Jul-02 9:34
Mike Doner8-Jul-02 9:34 
GeneralRe: Exe/Dll Dependancies. Pin
Oliver Daniel8-Jul-02 10:08
Oliver Daniel8-Jul-02 10:08 
GeneralRe: Exe/Dll Dependancies. Pin
Mike Doner9-Jul-02 9:06
Mike Doner9-Jul-02 9:06 
GeneralRe: Exe/Dll Dependancies. Pin
-Dy10-Jul-02 23:45
-Dy10-Jul-02 23:45 
GeneralRe: Exe/Dll Dependancies. Pin
Mike Doner12-Jul-02 2:59
Mike Doner12-Jul-02 2:59 
GeneralWNetAddConnection2 fails with error code 1312 Pin
alma8-Jul-02 9:24
alma8-Jul-02 9:24 
GeneralRe: WNetAddConnection2 fails with error code 1312 Pin
alma11-Jul-02 1:49
alma11-Jul-02 1:49 
GeneralSTL question - Moving Items around in a list Pin
#realJSOP8-Jul-02 9:13
professional#realJSOP8-Jul-02 9:13 
GeneralRe: STL question - Moving Items around in a list Pin
Chris Losinger8-Jul-02 9:38
professionalChris Losinger8-Jul-02 9:38 
GeneralRe: STL question - Moving Items around in a list Pin
#realJSOP8-Jul-02 9:45
professional#realJSOP8-Jul-02 9:45 
GeneralRe: STL question - Moving Items around in a list Pin
Chris Losinger8-Jul-02 9:53
professionalChris Losinger8-Jul-02 9:53 
GeneralRe: STL question - Moving Items around in a list Pin
Tim Smith8-Jul-02 10:14
Tim Smith8-Jul-02 10:14 
GeneralRe: STL question - Moving Items around in a list Pin
Chris Losinger8-Jul-02 10:16
professionalChris Losinger8-Jul-02 10:16 
GeneralRe: STL question - Moving Items around in a list Pin
#realJSOP9-Jul-02 2:31
professional#realJSOP9-Jul-02 2:31 
GeneralRe: STL question - Moving Items around in a list Pin
jbarton9-Jul-02 5:23
jbarton9-Jul-02 5:23 
GeneralGeting Explorer Drop Target - Help Pin
zarco18-Jul-02 8:43
zarco18-Jul-02 8:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.