Copy link to clipboard
Copied
I've writted some code but it show me this erreur
(m_lpDispatch == NULL); : app.exe has trigged a breakpoint
but I think that I've do mistake into my code please really I need your help , I want to no how to step
Copy link to clipboard
Copied
You will have to tell us what your code is.
Copy link to clipboard
Copied
RemoteControlAcrobatView.cpp :
CRemoteControlAcrobatView::OnAcrobatLaunch()
if(m_pAcroApp) return;
COleException e;
new CAcroApp;
"AcroExch.App", &e);
if(!m_pAcroApp)
"Can not get Acrobat IAC Object!");
else
if(m_pAcroApp->GetNumAVDocs()>0) {
new CAcroAVDoc;
TRUE);
the goal of this code is to lunch a new document pdf
--------------------------------------------------------------------
CRemoteControlAcrobatView::OnEditviewAddbutton()
CString m_strDescription;
COleException e;
try {
if (!m_pAcroApp->CreateDispatch("AcroExch.App", &e))
"Can not get Acrobat IAC Object!");
else
TRUE);
AVToolBar *toolbar;
AVToolBarPosition avtoolbarposition;
sizeof(avtoolbarposition), 0);
sizeof(avtoolbarposition);
false;
//avtoolbarposition.dockPosition = kAVToolBarDockTop;
"test";
//avtoolbarposition.layout = kAVToolBarFloating;
false;
false;
AVToolBarAddButton((toolbar, avtoolbarposition, FALSE, NULL));
//AVAppRegisterToolBarPosition("SaveToolBar_Dafolo", false, &avtoolbarposition); // also tried true as the 2nd parameter
if (toolbar)
/*if (!AfxOleInit()) // Your addition starts here
/*AVIcon* myIcon;
catch (COleDispatchException & e) {
this is the wrong code thanks a lot
Copy link to clipboard
Copied
Your code looks a mix of IAC and plugin.
Copy link to clipboard
Copied
thank you for your response.
can you explain more and tell me how can I start another project again ?
thanks a lot
Copy link to clipboard
Copied
A plugin can add a button to the toolbar. Not possible with the IAC interface.
Copy link to clipboard
Copied
think you very much, i'll do some research and I will tell you the news think you again
Copy link to clipboard
Copied
Thank you. Which line of your code is producing the error? Unfortunately parts of it are missing in your post.
Copy link to clipboard
Copied
thanks for your response.
the errue is in oledisp2.cpp a file don't exist in my project
Copy link to clipboard
Copied
Sorry that seems to be an entirely different error.
Copy link to clipboard
Copied
I do agree though, there seems to be some code from a plugin dropped into an IAC app. You can't do that.
Copy link to clipboard
Copied
See this thread for some important hints about writing plug-ins: plugin creation
Copy link to clipboard
Copied
And be sure to read the documentation in the SDK as well as the sample code that comes with it…
Copy link to clipboard
Copied
hello,
thank you all for your help , I'm gonna show you some code but I have a lot of error
I've followed the link http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/plugin_apps_developer_guide.pdf
Page :47
my code :
Buff[256];
int i;
bool b;
CAcroPDDoc pddoc;
CAcroPDPage pdpage;
PDEContent pdecontent;
//FixedRect mediabox;
PDSysFont pdefont;
PDEText pdetext;
//FixedMatrix textmatrix;
PDEColorSpace pdecolorspace;
//PDEGraphicstate pdegraphicstate;
char *Hellowordstr = "hello PDF !";
MAC_ENV
// create doc, Page, Content
PDDocCreate();
fixedZero;
Int16ToFixed(4 * 72);
Int16ToFixed(5 * 72);
fixedZero;
PDPage = PDDocCreatePage(pddoc, PDBeforeFirstPage, mediaBox);
NULL);
// Acquire Font, add Text, and insert into page content container //
sizeof(pdeFontAttrs));
ASAtomFromString("CourierStd");
ASAtomFromString("Type1");
sizeof(PDEFontAttrs), 0);
PDEColorSpace = PDEColorSpaceCreateFromName(ASAtomFromString("DeviceGray"));
sizeof(PDEGraphicState));
fixedTen;
fixedOne;
fixedOne;
// Create ASFixedMatrix object
sizeof(textMatrix));
Int16ToFixed(24);
Int16ToFixed(24);
Int16ToFixed(1 * 72);
Int16ToFixed(2 * 72);
// Create a PDEtext object
sizeof(gstate), NULL, 0, &textMatrix, null);
// Insert text into the page content
PDEElement)pdeText);
// Convert to objects, add to page, and release resources //
//set the PDEContent for the page
// save document to a file
if (!IMAC_ENV)
PDSaveFull | PDSaveLinearized, ASPathFromPlatformPath("out.pdf"), null, null, null);
else
//macPath = GetMacPath("out.pdf");
PDSaveFull | PDSaveLinearized, macPath, null, null, null);
// Release all objects
PDEObject)pdeFont);
PDEObject)pdeText);
PDEObject)pdeColorSpace);
return 0;
and my goal is to add a button on the toolbar adobe
thank you all
Copy link to clipboard
Copied
You are mixing IAC and Plugin stuff.
For example – CAcroPDDoc is IAC and PDEContent is plugin.
Copy link to clipboard
Copied
okay , really I don't know how, any other help plz ?
Copy link to clipboard
Copied
To program with the SDK you have to study the documentation. Many people try to, instead, copy and paste little pieces they found on the internet. This will not work, extensive study is needed.
The short answer is you CANNOT mix these two kinds of thing in one app. You cannot use anything from the plug-in API in your app AT ALL, not by any trick or study.