|
The .NET BCL doesn't know anything about a PDF file, so no, you can't use it to print one. You'd have to use a 3rd party control, ranging from one of the projects on SourceForge.net (free), to very expensive versions costing a couple thousand $.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The question is simple:
How is it possible to control the sound volume.
I suppose its something with winmm.dll or whatever...
thanks
----------------------
I think war is a dangerous place.
George W. Bush - Washington DC, May 7th 2003
|
|
|
|
|
I can successfully load an assembly dynamically at runtime. But what if I want to unload it and load another one without having to shutdown my application. Does anyone know how to do that? I use Activator.CreateInstance to load assemblies. But I have not found anything that I can use to unload one.
|
|
|
|
|
Assemblies are loaded into an AppDomain when you Type they define is required. You cannot unload assemblies from an AppDomain without shutting down the AppDomain (closing/killing the process is one way of doing this).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Similar to what Heath said, but you can create your own AppDomain's and load the assemblies into there. Then, when you want to unload the assembly, destroy the AppDomain. I think there's some article on MSDN about doing that.
Marc
Microsoft MVP, Visual C#
MyXaml
MyXaml Blog
|
|
|
|
|
Well I did try following that example and it worked up to a point. I get Serialization exceptions because .NET is trying to serialize System.Threading.Thread and other System classes. I can only modify my own classes to meed serialization requirements. What do I do about the System classes I need objects of sever System types in the assembly that I am trying to load into a separate AppDomain.
For more than 2 years I did not have any such issue because I was loading assemblies into the default AppDomain. But I now have a need to dynamically load and unload them. Do you know of a solutions that will not try to serialize System classes. I can only modify my classes with MarshalByRefObject or [Serializable].
Thanks
Robert
|
|
|
|
|
Why can't I have two functions with the same name and the same input paramters, but different return types. The two functions are obviously different. I did this in C++ with no problems. Is there any way to do it in c#?
Gary Kirkham
A working Program is one that has only unobserved bugs
He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot
Who you are in Christ
|
|
|
|
|
It's not allowed by the CLI. See ECMA 335, section 10.2 (Overloading), with one exception: overloaded operator methods can differ only by return type.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks...I wonder why the C# development team thought that capability wasn't useful? O' Well, maybe I am the only one who used it in C++.
Gary Kirkham
A working Program is one that has only unobserved bugs
He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot
Who you are in Christ
|
|
|
|
|
It's not C#: it's the CLI - the Common Language Infrastructure (sometimes Interface), which describes assembly and type metadata (Common Type System, or CTS), as well as the Common Intermediate Language (CIL) and a few other things. It's what makes the language independence possible.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
You can't because C# doesn't support it. Overloading selections are done only on functions names and argument lists only. Return types are not considered by the compiler.
7.4.2 Overload Resolution[^]
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Since no one else said it, I guess I will:
You did NOT do this in C++.
class A
{
int doSomething() {}
void doSomething() {} // causes an error
};
Here's the first error it will cause:
error C2556: 'void A::doSomething(void)' : overloaded function differs only by return type from 'int A::doSomething(void)'
It will also cause other errors indirectly, when/if the compiler fails to recover from the error and continue analysis.
The C++ standards forbid this, just as C# does.
|
|
|
|
|
I stand corrected, I must be getting senile in my old age.
Gary Kirkham
A working Program is one that has only unobserved bugs
He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot
Who you are in Christ
|
|
|
|
|
Not a big deal. I just couldn't have you bad-mouthing C#'s overloading.
|
|
|
|
|
Hello world!
I have a class and I wish to get a reference to one of its member variables at runtime.
class foo
{
public string bar1;
public string bar2;
..
}
I have called foo.GetFields() and I am the proud owner of an array of FieldInfo structures giving me information about all of the type's member variables. I can see my strings (checkboxes/bears) in the list.
My question is: How can I take this FieldInfo data, and get a reference to the desired variable and hence manipulate it??
Many thanks in advance,
Charlie (C:=
|
|
|
|
|
You've already got it: the FieldInfo . If you want to get or set a field's value, use FieldInfo.GetValue and FieldInfo.SetValue . If the fields are instance fields, you must pass the object whos fields you want to retreive.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Where does foo and bar come from, as it seems to be standard in using in examples?
Does it come from FUBAR?
Thanks
|
|
|
|
|
yes... now, what's a fubar?
|
|
|
|
|
Ok, here's the senario:
I have two projects in my solution, one of which (project A) has a custom control, and the second (Project B) has a form that uses the custom control. Frequently, if I have opened the project B form in the designer and then re-compile, Project A's dll cannot be written to the output directory because the designer is using it (at least that's what I presume is the reason it can't be written). Closing the designer window in Visual Studio doesn't help. Even closing the *solution* and re-opening doesn't help!! I have to close Visual Studio completely and re-launch to be able to compile my solution again.
How can I avoid this problem, outside of not having these two projects in the same solution (I'm working in both at the same time).
Thanks!
~Steve
|
|
|
|
|
Steve Schaneville wrote:
How can I avoid this problem, outside of not having these two projects in the same solution (I'm working in both at the same time).
You can't. It's a bug in VS.NET 2002 and 2003. Here's to hoping it's been fixed in VS.NET 2005
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
oh. good news.
Thanks!!
~Steve
|
|
|
|
|
I have an instance of class A that publishes an event and several instances of class B that subscribe to it. How can I get a B instance to UNsubscribe from the event?
|
|
|
|
|
It's just like subscribing to the event, except that you use -= instead of +=
intanceOfA.FireTorpedoes -= new EventHandler(intanceOfA_FireTorpedoes);
Charlie
if(!curlies){ return; }
|
|
|
|
|
I have a datatable and performaing select method on that.
I have to pass array of values to the select method,
is there any way how i can do that?
Here goes the code
string[] emp;
dtemp.select()- How should i pass array of strings inside the function.
|
|
|
|