473,382 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

use SaveFileDialog in Class Library Proj w/o a Form - possible?

I want to create a class library project (dll) for use with a com app. The
idea is to use .Net objects in com. I also want to include a SaveFileDialog
in the class library. Is it possible to include a SaveFileDialog object in
my library project without having to include a form in the project? how to
do this?

Thanks,
Rich
Jul 13 '07 #1
3 2645
On Fri, 13 Jul 2007 09:54:06 -0700, Rich <Ri**@discussions.microsoft.com>
wrote:
I want to create a class library project (dll) for use with a com app.
The
idea is to use .Net objects in com. I also want to include a
SaveFileDialog
in the class library. Is it possible to include a SaveFileDialog object
in
my library project without having to include a form in the project? how
to
do this?
Why do you want to include a SaveFileDialog object in your project? Why
not just instantiate it as needed?

For what it's worth, I use the SaveFileDialog in many of my projects, and
I have not once actually included it as a component for any form. I
always just instantiate one as needed. There are a number of these sorts
of classes that _can_ be dragged and dropped into your form so that you
have easy access to an instance of one, but where doing so isn't actually
necessary.

If you still feel you need an instance to be predefined in your project,
perhaps you can be more specific as to why you want to do that.
Otherwise, I recommend you simply create a new instance as needed.

Pete
Jul 13 '07 #2
On Jul 13, 12:54 pm, Rich <R...@discussions.microsoft.comwrote:
I want to create a class library project (dll) for use with a com app. The
idea is to use .Net objects in com. I also want to include a SaveFileDialog
in the class library. Is it possible to include a SaveFileDialog object in
my library project without having to include a form in the project? how to
do this?

Thanks,
Rich
You'll need to add a reference to System.Windows.Forms to the DLL
project.

Jul 13 '07 #3
Thank you all for your replies.

Using System.Windows.Forms

that is what I was looking for. Now I instantiate it just as needed.
Thanks all.

One more question: I am using this dll with MS Access to read data from Sql
Server and write it to a text file using sqlDataAdapter, StreamWriter.
Anyway, I am deploying the Access app from a console application that starts
up the Access app with the Process object. I have been deploying the Access
app via this console app successfully since "Click Once" became available.
Now I have to deploy and register this custom dll for com on each workstation
that uses the Access app. I have copied the compiled dll and tlb to the
console app for output. I also added a .bat for registering this dll. But
the dll is not registering correctly on the destination workstation, and
everytime I deploy this app a copy of the dll, tlb and .bat files are also
copied. So the destination workstation ends up with several copies of the
same dll files.

What is the correct way to deploy this dll and register it on the
destination workstation(s) (in test environment right now). Do I need to
deploy the dll separately?

Thanks,
Rich

"Rich" wrote:
I want to create a class library project (dll) for use with a com app. The
idea is to use .Net objects in com. I also want to include a SaveFileDialog
in the class library. Is it possible to include a SaveFileDialog object in
my library project without having to include a form in the project? how to
do this?

Thanks,
Rich
Jul 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael A. Covington | last post by:
I've just determined, by experimenting, that regardless of its Filter and DefaultExt properties, a SaveFileDialog will let you save the file with *any* registered extension. For instance, if you...
2
by: gaetanog | last post by:
Hi there.. I have a question about instance usage... I created a VStudio 2003 solution within 3 projects as follow: 1) Proj One: Main form 2) Proj Two: User Control 3) Proj Three: Class I...
8
by: Alvo von Cossel I | last post by:
hi, i have a form with a multiline textbox in it. it also has a savefiledialog. how do i save the text in the textbox? can anyone help me? i'd be grateful if you could! --
3
by: josh | last post by:
How do I make it actually save or open a file? It only opens the dialogs. What do I type to get it to save? Here's what I have so far: Public Class frmMainApp Inherits...
1
by: Ron | last post by:
Hello, I need 2 projects/apps to communicate with each other. I figured out how to create a Class Library project with a form and how to add a new exe project to the solution. I set the...
2
by: Amjad | last post by:
I'm writing a DLL code that has routines, one of which creates an Excel file and saves it, if certain conditions are met. I want the main project in the solution to call that routine in the DLL to...
17
by: Peter Duniho | last post by:
I searched using Google, on the web and in the newsgroups, and found nothing on this topic. Hopefully that means I just don't understand what I'm supposed to be doing here. :) The problem: ...
8
by: Joe Duchtel | last post by:
Hello - I have the following code to detemine a file name when my application is saving a file. The problem is that if the file already exists and I select the Yes button in the "Do you want to...
2
by: Reggie | last post by:
Hi and TIA! I have a class file located in my root directory with all me web pages. I call/use the class and it works fine. I have no imports statements aspx or codebehind. My question is why? ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.