Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

HELP! Can't get dialog to load in a DLL Custom Act


1 reply to this topic

johnmalek

johnmalek
  • Members
  • 2 posts

Posted 15 April 2004 - 23:58

Hi,

I'm trying to create a custom action, using a C++ DLL. I have it hooked up to the MSI, and I can launch a MessageBox to bring up a simple dialog. However, I can't create a dialog, because I can't load the dialog resource.

In my code

HWND hDialog = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1), NULL, CameraPickerFunc);
if (hDialog == NULL)
{
char er[50];
sprintf(er, "getlasterror: %d, %d", GetLastError(), MAKEINTRESOURCE(IDD_DIALOG1));
MessageBox(0, er, "error", MB_OK);
}

I get error 1813, which is "The specified resource type cannot be found in the image file. ".

Any help would be greatly appreciated. I don't know why MS's sample doesn't show loading a dialog.

Thanks,
John

johnmalek

johnmalek
  • Members
  • 2 posts

Posted 16 April 2004 - 21:13

OK, I finally figured this out. I was able to use the hInstance from the call to DLLMain.

I'm using VS.Net with a Setup Project. However, it looks like I can't add an "immediate execution" custom action. From the newsgroups, people say we can only have "deferred execution" custom actions. But I need to modify the progress bar, to add more ticks for the stuff I'm doing in the deferred custom action.

Does anyone know how to control the progress bar from a deferred execution custom action? The sample that's in the MS SDK helpfile only work if you can have a deferred and immediate custom action.

Thanks in advance,
John