Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Explorer ,
Sep 21, 2021 Sep 21, 2021

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]

TOPICS
Windows
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Sep 24, 2021 Sep 24, 2021

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);
EndDi

...
Translate
LEGEND ,
Sep 22, 2021 Sep 22, 2021

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 22, 2021 Sep 22, 2021

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 23, 2021 Sep 23, 2021

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 23, 2021 Sep 23, 2021

> Nobody will connect with you

Correction: You will get contacted, most likely by scammers trying to take control of your computer or stealing your bank or credit-card details. Do not post private information again! I removed it from your post above.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 23, 2021 Sep 23, 2021

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

Look at the sample "wxPlugin".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 24, 2021 Sep 24, 2021
LATEST

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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines