Hello Anand S,
My question is, Is it possible to create EW application as a .dll or static library?
generally I don't see any obstacle to do this. However we have no examples demonstrating the approach. We have never tried it. From technical point of view following should be taken in account:
1. Embedded Wizard created GUI application depends on its own main loop. It can't be integrated in the MFC message loop implemented in the function WinMain() in module main.c . Thus, I would drive the Embedded Wizard own EwMain() function in context of a separate thread.
2. The original Embedded Wizard implementation for Win32 creates an overlapped window (with style WS_OVERLAPPEDWINDOW). If you want the Embedded Wizard window to be embedded within a window belonging to your application, you will need to modify of how the Embedded Wizard window is created. See the function EwOpenViewer() in the module ewapp.c belonging to Win32 Platform Package.
3. Within this function: one necessary modification will be to replace WS_OVERLAPPEDWINDOW by WS_CHILD.
4. Also, you should pass a valid value in hWndParent parameter in the invocation of CreateWindowExA(). Actually the parameter is NULL. It should identify the HWND of the superior window where you want to embed the Embedded Wizard's own window.
Please note, if the Embedded Wizard GUI application is executed in context of a separate thread and you want to exchange data between the GUI application and another thread, you will need to implement interprocess communication between the both threads. Invoking Embedded Wizard functions in context of a thread other than the used to create and drive the application will lead to errors. See also: Take care in multi-threading environments.
I hope it helps you further.
Ask Embedded Wizard
Welcome to the question and answer site for Embedded Wizard users and UI developers.
Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!