Help with VB Design's File Dialog Class

Help with VB Design's File Dialog Class

Anonymous
Not applicable
534 Views
13 Replies
Message 1 of 14

Help with VB Design's File Dialog Class

Anonymous
Not applicable
I've been attempting to use the File Dialog Class from http://www.vbdesign.net/cadpages/code/source/file_dialogs.htm but I'm having no luck and I suspect it is because I am placing the code in the wrong location.

Can someone tell me if this code belongs in a module or a class or a combination of both? Also, I'm trying to use this in AutoCAD Map 2002. Will this existing code work in 2002? On that note, is this the best solution for prompting the user to open a drawing file or is there a simpler method that already exists?


Thanks
0 Likes
535 Views
13 Replies
Replies (13)
Message 2 of 14

Anonymous
Not applicable
I should also note that I'm pretty experienced with VBA, but do not have experience working with classes.

In other applications such as Excel, displaying the File Open dialog is very simple using the GetOpenFilename method and I'm extremely surprized that nothing exists like that in VBA for AutoCAD.
0 Likes
Message 3 of 14

Anonymous
Not applicable
The DrawingEditor class in the AcadX(tm) Active Extension
Library for AutoCAD (www.caddzone.com) has FileDialog()
and FileNavDialog() methods that allow you to use the same
Open/Save dialog that AutoCAD uses.

"geoback" wrote in message
news:f0e7e25.0@WebX.maYIadrTaRb...
> I should also note that I'm pretty experienced with VBA, but do not have
experience working with classes.
> In other applications such as Excel, displaying the File Open dialog is
very simple using the GetOpenFilename method and I'm extremely surprized
that nothing exists like that in VBA for AutoCAD.
>
>
0 Likes
Message 4 of 14

Anonymous
Not applicable
The code from VBDesign belongs in a class module. You may
then use a standard module to create an instance of the class for your
project to use.


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I've
been attempting to use the File Dialog Class from
href="http://www.vbdesign.net/cadpages/code/source/file_dialogs.htm">http://www.vbdesign.net/cadp...

but I'm having no luck and I suspect it is because I am placing the code in
the wrong location.

Can someone tell me if this code belongs in a module or a class or a
combination of both? Also, I'm trying to use this in AutoCAD Map 2002. Will
this existing code work in 2002? On that note, is this the best solution for
prompting the user to open a drawing file or is there a simpler method that
already exists?


Thanks

0 Likes
Message 5 of 14

Anonymous
Not applicable
Hi Tony,

Thanks for your reply.

I had seen your AcadX extension library but your usage restrictions prevent
me from distributing the routine to my client. This is a fairly small job
therefore it wasn't worth getting into a license agreement.

I will defnitely keep you in mind if this job grows into something much
bigger.


Thanks again


"Tony Tanzillo" wrote in message
news:F1A1A597A1DD934BF459E59A3D8F7EF0@in.WebX.maYIadrTaRb...
The DrawingEditor class in the AcadX(tm) Active Extension
Library for AutoCAD (www.caddzone.com) has FileDialog()
and FileNavDialog() methods that allow you to use the same
Open/Save dialog that AutoCAD uses.

"geoback" wrote in message
news:f0e7e25.0@WebX.maYIadrTaRb...
> I should also note that I'm pretty experienced with VBA, but do not have
experience working with classes.
> In other applications such as Excel, displaying the File Open dialog is
very simple using the GetOpenFilename method and I'm extremely surprized
that nothing exists like that in VBA for AutoCAD.
>
>
0 Likes
Message 6 of 14

Anonymous
Not applicable
I have created a class and put the vbdesign code into it. it won't compile. it says the public const data can't be public const...
0 Likes
Message 7 of 14

Anonymous
Not applicable
wrote in message news:5084262@discussion.autodesk.com...
I have created a class and put the vbdesign code into it. it won't compile.
it says the public const data can't be public const...

either move it into a std module or make it private

hth
Mark
0 Likes
Message 8 of 14

Anonymous
Not applicable
I moved it to a std module. I could not make it private because the contants would not be available for other codes use.

It is now working.
0 Likes
Message 9 of 14

Anonymous
Not applicable
just curious....why should they be available for other code's use? As I
understand it, a major point of class programing is to encapsulate bits of
code until functional objects, only exposing information through properties.
Though there are some instances where public variables can make sense, in
general they're best kept to a minimum.

-Chris

wrote in message news:5084385@discussion.autodesk.com...
I moved it to a std module. I could not make it private because the
contants would not be available for other codes use.

It is now working.
0 Likes
Message 10 of 14

Anonymous
Not applicable
The standard OPENFILENAME structure has to be populated with a varierty of flag values. You then pass your structure into the GetOpenFileName method. Thus those flags need to be known.

Standard MFC behavior always makes the flag constants public for this particular wrapper in Visual C++

Andrew
0 Likes
Message 11 of 14

Anonymous
Not applicable
True, but the whole point of creating a wrapper is so that you don't need to
be making the API calls all over the place. If the windows dialog wrapper
was implimented as a class then it could be the only code accessing the
OPENFILENAME API call directly and thus the data structure wouldn't need to
be declared as public. All dialog requests would be handled by the methods
and properties of the wrapper.

I'm not familiar with the VB design dialog class wrapper, but I know that's
how mine works.

-Chris

wrote in message news:5084427@discussion.autodesk.com...
The standard OPENFILENAME structure has to be populated with a varierty of
flag values. You then pass your structure into the GetOpenFileName method.
Thus those flags need to be known.

Standard MFC behavior always makes the flag constants public for this
particular wrapper in Visual C++

Andrew
0 Likes
Message 12 of 14

Anonymous
Not applicable
I know what you mean.
0 Likes
Message 13 of 14

fxcastil
Advocate
Advocate
go to link below an download "comm dialog .zip " this should work for you

http://discussion.autodesk.com/thread.jspa?threadID=451811

Fred Castillo
0 Likes
Message 14 of 14

Anonymous
Not applicable
Thanks. I got the vb designs one working.

Andrew
0 Likes