Skip to main content
Inspiring
Sep 21, 2021 4:53 PM UTC
Answered

Trying to add a dialog in acrobat sdk projects using Vc++/c++

Hi Team,

I'm using Acrobat Adobe Dc Samples Basic Plugin project, I enabled another submenu under Acrobat sdk.

So, whenever i'm clicking that submenu the action enabled in that function i wrote code for Dialog purpose.

Way One: Inside function:
I wrote modal dialog code from Acrobat adobe pulgins pdf document:
code:
HWND CapturehWnd, hParent, hWnd;// nRetVal;
HINSTANCE gHINSTANCE;
CapturehWnd = GetCapture();
if (CapturehWnd != NULL)
ReleaseCapture();
hParent = WinAppGetModalParent(AVAppGetActiveDoc());
int nRetVal = DialogBoxA(gHINSTANCE, MAKEINTRESOURCE(IDD_DIALOG1), hParent,AboutDlgProc);
if (CapturehWnd != NULL)
SetCapture(CapturehWnd);
static AVWindow sAVWin;
//.....
// hWnd is the window handle of the dialog box window
HWND hWnd1;
sAVWin = AVWindowNewFromPlatformThing(AVWLmodal, 0, NULL,gExtensionID,0);
AVAppBeginModal(sAVWin);
AVAppEndModal();
AVWindowDestroy(sAVWin);


Way Two: Inside function:

I added Dialog resource and created the class from Cdialog

I used mfc code for dialog like:

Mydialog obj; //Mydialog is the dialog class
obj.domodal;//domodal doesnt called

Runtime Exception:afxwin1.inl line 24

Note: I refered all the sites and implemented based on suggetions.

Kindly support to me.

If any need please feel reach out me
[Edit: Personal information removed by Mod]

This topic is closed to new replies. Start a new post to keep the conversation going.
Chenchaiah5C1ECorrect answer
Inspiring
Sep 24, 2021 12:03 PM UTC

> I reviewd all samples in sdk, there is no dialog implementation.

Look at the sample "wxPlugin".


Using win32 this senario working:

Hi,

In your menu function use this:

You can defin HINSTANCE gHINSTANCE;

int nRetVal = DialogBoxParam(gHINSTANCE, MAKEINTRESOURCE(IDD_DIALOG1),NULL,DialogProc,0);

need to call dialgproc function, in dialog proc function use:

switch (uMsg)
{
case WM_INITDIALOG:
//CenterDialog(hDlg);
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_BUTTON1:

AfxMessageBox("button clicked");
case IDOK:
EndDialog(hDlg, IDOK);
break;
case IDCANCEL:
//SendMessage(hDlg, WM_CLOSE, 0, 0);
EndDialog(hDlg, IDCANCEL);
//return TRUE;
break;
}
break;

6 replies

Legend
Sep 22, 2021 7:29 AM UTC

Look for dialog samples in the SDK. You cannot use code written for an EXE. One critical difference is that DialogBoxA will look for the dialog resource in the current module. At all times the current module is Acrobat.exe, NOT your plug-in. Other API calls are needed too.

Translate
Inspiring
Sep 23, 2021 5:46 AM UTC

I reviewd all samples in sdk, there is no dialog implementation.

 

I tried to display dialog using win32 and MFC both senerio's still not resolved.

 

It is crtical for me, Please help on this.

 

Note: Please connect through Teamviewer, where i was stuck will explain clearly

 

Thanks!

[Private info removed]

Translate
Legend
Sep 23, 2021 8:03 AM UTC

You misunderstand the way the forums work. Nobody will connect with you, this is not Adobe support. So far as I know, Adobe no longer offer any developer support otions. You are, here, talking to other Adobe customers who may choose to share their experiences.

 

Did you deal with the resource loading issue that I mentioned? Clearly you will get nowhere until you do this.

Translate