Discussion:
Can a plugin have GUI?
(too old to reply)
Jack
2009-09-24 11:31:02 UTC
Permalink
Does any guru here have experience of creating a plugin while having a popup
window (such as a form) to present information to himself (for double
checking etc, I just need is a canvas to see the results of the rendered
image) ? I only can do it with the console... Any good ideas? or anywhere I
can look?
The software involved is 3ds max....
Thanks
Jack
Jack
2009-09-24 13:17:07 UTC
Permalink
I wonder if I have a rectangle, normally displaying on the screen, I would
use Rectange(hDC,....);
But this time I want to render the rectangle to a bitmap.
The bitmap actually has an array of points.
int myPixel[200][200];
How can I draw a rectangle into this 2 dimensional array? Could you please
provide some code snippets for reference?
Thanks
Jack
Victor Bazarov
2009-09-24 13:27:07 UTC
Permalink
Post by Jack
I wonder if I have a rectangle, normally displaying on the screen, I would
use Rectange(hDC,....);
But this time I want to render the rectangle to a bitmap.
The bitmap actually has an array of points.
int myPixel[200][200];
How can I draw a rectangle into this 2 dimensional array? Could you please
provide some code snippets for reference?
You can create a compatible bitmap (RTFM on 'CreateCompatibleBitmap')
and create a memory DC (RTFM on 'CreateCompatibleDC'). Then you select
your compatible bitmap into the compatible DC (which gives the DC memory
to store your graphical info), then you use that DC just like you would
the screen DC. The documentation has an example, and I am sure you can
find plenty of other examples of 'CreateCompatibleDC' on the Web.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
David Webber
2009-09-24 17:06:12 UTC
Permalink
The answer to the question in the subject line is - yes certainly.

My plug-ins have an exported method which opens a file, and they use the
standard file selector to do it.

(Each plug-in imports a file of a given type, so thay all need to open
files. The program doesn't need to know about the exact contents of the
file: the plug-in opens it, reads it, converts the data to a universal
format my program is designed to accept, and then lets the program have it.)

Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm
Jack
2009-09-25 06:26:47 UTC
Permalink
Hi Victor+David,
Is it also possible to have MFC or QT interface on a plugin? Just out of
curiosity?
Thanks
Jack
Victor Bazarov
2009-09-25 13:14:55 UTC
Permalink
Post by Jack
Hi Victor+David,
Is it also possible to have MFC or QT interface on a plugin? Just out of
curiosity?
From the general point of view, why not? Of course, you can always run
into compatibilities problems. Make sure the third party library you're
using links with the same (and better with the DLL version of) run-time
library and whatever other library they can be sharing.

Long time ago I've written a 3ds plug-in, and it did have UI, but
nothing fancy like MFC or Qt. Doesn't 3ds nowadays have decent support
for developers, like online forums, documentation?... Just a thought.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Tom Serface
2009-09-25 17:16:03 UTC
Permalink
FWIW, we have several DLLs that have their own resources, including dialogs,
etc., but it is always tough to manage resources (languages, etc.). If you
plan to make a general set of calls you may want to have something in a main
library (or the main application) that each plug-in can call to do the
various tasks then allow the plug-in to call back in to the main GUI to do
the GUI stuff. Since the main GUI would have to be a window the messaging
part would be pretty trivial. If you are writing plug-ins that other
applications will use and that will have to be more stand-alone then that is
a different story of course.

Tom
Post by Jack
Hi Victor+David,
Is it also possible to have MFC or QT interface on a plugin? Just out of
curiosity?
Thanks
Jack
Loading...