|
I have a web applicaion which has database connection class. I want to create a different Windows service project which uses the same connection classes.
I do not want to make a copy of the connection class file.
My quesries are as below:
1. Please suggest the ways I can do it. [One way is to create a dll and use it]
2. Are there any pre-requisties to perform the same thing.
Pavas
|
|
|
|
|
Your two options are copy the code, and use a dll. That's about it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi,
i wanna disable Windows Xp Visual style for my program as i cant set background color of progress bar or some other component
i can do this in VB.net by just unchecked the checkbox in my project properties
but in C#, there isnt anything about it.
so some one know a good way to do it..
Becoming Programmer...
|
|
|
|
|
delete Application.EnableVisualStyles() line from Main()
life is study!!!
|
|
|
|
|
I would like to create a DLL from a c# file to reffer it to a new project.
Please suggest how can I do it.
Pavas
|
|
|
|
|
Create a new project, of type 'class library'. Copy in your code, and build.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I already have a web applicaion and the webapplicaion has the .CS file. I am looking for a command to convert the .CS file to dll and reuse it to some other project.I am using VS 2005
Pavas
|
|
|
|
|
...you have to simply:
You have to insert a new Project inside you solution(class library type).
Then insert an existing item(c# file) inside this project.
Compile.
Add a reference in your app project, and use it!!
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Thanks!
Let me explain you in detail. Sorry for not detailing u the problem
I want to create a seprate project. Ourside the solution. So there are two seprate projects [one is web project and other one is windows service].
This Web project uses a connection class. Now is it possible to reuse the same connection class with out creating a coppy of .cs file.
Pavas
|
|
|
|
|
Dagnamit it - two people have told you now. You need to create a new project and move the code into that project. It needs to be a class library. That's how you create a dll. You need to move code into the dll, for it to be there, quite plainly. If you don't create a copy of the file, how can you hope to create a dll ? You'd then remove the copy from your project, as it will get the class from the dll.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
here here, flame away!
|
|
|
|
|
I was thinking to convert a single file to dll using as below:
csc /target:library /out:CONNECTION.DLL app_code\Connection.cs
Shure creating a class library is the best Idea. I agree. Thank you
Pavas
|
|
|
|
|
The detail was fine (again), I simply do not believe you are reading the answers, which in turn suggest to me that you have never read a reference manual in your life!
|
|
|
|
|
|
Any ways thnaks for suggestion!
Pavas
|
|
|
|
|
Hi All,
I have 2 project in my solution - the first is something old that was wrote in C++ and the other is something new that i writing in C#.
In the C++ project - i have some big file ( h file ( header )) that contain some struct, enum, define ... and more const Return code.
What i want to do is to use those information somehow.
How can i do it ? i don't want to write all those information as new information by myself again - i want to use the exist info...
Thanks for any help.
|
|
|
|
|
You really can't. You can build your header file as a managed C++ dll, and import it, that would work. However, you can't just use it in yuor project, how could you ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
In general -
What i need to do in this case ?
I can use manages C++ code - but there is some example of how i can do it ?
|
|
|
|
|
MAke your header build into a dll and set the /clr option. Then you can import this dll into your C# project.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Hi,
I want to implement JPEG loseless and lossy compression. Can anyone please help me.
Darmi
|
|
|
|
|
There are many 'JPEG' compressions. The most common one is the lossy one supported by GDI+. Creating files using this compression in C# is trivial. There are also a number of 'lossless' compressions, including JPEG 2000, JPEG lossless, etc. For JPEG 2000, I use the Atalasoft imaging library ( the J2000 stuff is an add on, and not cheap ). There are no free implimentations of J2000 that I know of, there is a JPEG lossless dll from HP, but I never actually got around to using it, I just found it in my search for a lossless compression supported by DICOM.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks Christian Graus,
But i need the implementation in C# or the algorithm to implement this compression techniques.
Thanks,
Darmi
|
|
|
|
|
I see. Well, I want a Ferrarri. Doesn't mean I can have one. Like I said, there are no C# implimentations for JPEG lossless that I know of. JPEG 2000, there are definately no free implimentations. The cheapest I found was Atalasoft, it's about $2000 plus the cost of their core library. It's very good, I use it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Image image;
...
Bitmap bmp = new Bitmap(image);
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
ImageCodecInfo ici = null;
foreach(ImageCodecInfo codec in codecs) {
if(codec.MimeType == "image/jpeg")
ici = codec;
}
EncoderParameters ep = new EncoderParameters();
long quality = (long)100; // 0-lossy ... 100-loseless
ep.Param[0] = new EncoderParameter(Encoder.Quality, quality);
bmp.Save(fileName, ici, ep);
life is study!!!
|
|
|
|