(VS 2019) Dialog box in a DLL, missing AFX (afxwin.h) and working with a form from VC++ code

  • Thread starter Thread starter sourcewielder
  • Start date Start date
S

sourcewielder

Guest
Hi.

My end goal: a DLL with an "init" function that will display a dialog, in it a BMP that can change based on a function call to the DLL (the DLL contains image 1 and 2), so just 3 API member functions (init, show stored "BMP 1", show stored "BMP 2").

I am very new to VS UI design. I got help in this forum for creating the dialog box with an image (not yet 2, for now).

Question is, how do I interface with this Form from DllMain() plus how the API functions will interface with the Form to swap images 1 and 2. I tried:

1. Right click on the form and "Add Class". I was hoping the Class code will be generated for to later instantiate from in the main code and allow API functions of that form to be called from that instance. Unfortunately, I got an error without explanation - "The operation could not be completed".

2. I looked at tutorials and tried to manually derive a class from CDialog and connect that class (somehow) to the form and later use its interface functions. I got two issues: A) I cannot successfully #include "afxwin.h" and don't know how to configure VS 2019 to include the right libraries and headers. B) Even if I did, I am unsure how to make the connection between the class and the form.

Thanks for any help.

P.S - how do i verify my account so I can attach images? Thanks.

Continue reading...
 
Back
Top