|
Make sure you use Assembly.GetExportedTypes to get the types...
Jonathan de Halleux.
www.dotnetwiki.org
|
|
|
|
|
I was just starting down that path!!!
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
Seems I found the issue that was confusing me.
Once I pointed Reflector at the DLL I was testing against it, too, reported problems with the GetExportedTypes(). However, Reflector was able to trap all of this one at a time and report back where it was having problems. In this case, a number of DLL's marked Do Not Copy.
So once I pointed at a known DLL that had everything there, both Reflector and my code worked.
Thanks Nick and Jonathan for your help.
ANSWER:
I created a FileDialog object (named getModule) with my form. A button next to a textbox allowed the developer to point at a particular DLL.
The classes are displayed in a combobox. Here is the code:
this.getModule.ShowDialog(this);
this.moduleID.Text = getModule.FileName.Substring(getModule.FileName.LastIndexOf(@"\")+1,
getModule.FileName.LastIndexOf(".") - getModule.FileName.LastIndexOf(@"\") - 1);
Assembly developerClass = Assembly.LoadFrom(getModule.FileName);
Type[] data = developerClass.GetExportedTypes();
classID.BeginUpdate();
classID.Items.Clear();
int len = 0;
foreach (Type objType in data)
{
classID.Items.Add(objType.Name);
if (objType.FullName.Length > len)
len = objType.FullName.Length;
}
classID.EndUpdate();
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
How can I view all the connections to a .NET Remoting server? I've browsed through the .NET Remoting namespace to no avail. I know I could call a method on an exposed object to do reference counting, but I wonder if there's a better way to find the sockets that are currently connected and get their IP addresses, etc.
|
|
|
|
|
I am not quite sure how you may do this...an awful lot is externalized away from the remote object. Good for quick deployment....bad for what you are trying to do.
I can, however, point you in a good direction. I suggest you run out to the Ingo Rammer website and pose your question directly to him.
His website is : http://www.ingorammer.com/RemotingFAQ/[^]
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
I am using excel object for formatting excel file. when i try to use autofilter method of range object in excel, I am getting the following exception
"Autofilter method of range class failed". How to solve this issue? Can any one help me out pls.
|
|
|
|
|
I want to know does C# supports shell programming or not?
in other words ,I want to no. of the already opened windows or applications in the operataing system...So my question is : Is there is a way to do that with c# or only C++? and if so ,HOW?
thank you for helping
|
|
|
|
|
T i T i wrote:
want to know does C# supports shell programming or not?
It does. Search in C# section shell programming and you wuill find sme articles there.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
Getting the open windows has nothing to do with the shell - that's a function of the window manager. You can use System.Diagnostics.Process.GetProcesses to get a Process[] array. To determine which running processes are window applications, enumerate the array and check Process.MainWindowHandle to determine if it is IntPtr.Zero (not a window application) or not (a window application).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
but this code is good to get the process not the applications so
if the opened windows ("c:","MyComputer")only one process will appear under the name of Explorer
so wt can we do ??
|
|
|
|
|
If you have the option set in Windows Explorer for each window to be opened in a separate process, this will work. If not, you'll have to P/Invoke EnumWindows and create an EnumWindowsProc delegate (not necessarily by name but by signature).
There's already been several articles outlining this here on CodeProject, so instead of explaining it just see the highlighted portions of Window Hiding with C#[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi again,
A few days ago I had a "rectangle drawing problem". I transformed my whole project and made my own custom control so I could draw my carpets and rectangle in the order I wanted. This works now. I also noticed that I use far less resources for the VisualShed to be drawn...
So now that I can draw my rectangle on the Graphics object of the shed, I'm trying to make a scale function that zooms in on the selected rectangle. I _googled_ and _code projected_ to find a solution. On codeProject I found an application that solves my problem. Not completely though.
http://www.codeproject.com/cs/media/limf.asp?target=displayport[^]
The problem here is that you can make a "rectangle zoom" on an Image. But not on the Graphics object itself. I also think that this application is far to complex for what I'm trying to do.
Can someone give me a hint on how to do it?
Thx in advance!
Kind regards,
TweeZz.
|
|
|
|
|
You can use graphics.ScaleTransform() to do the zoom and graphics.TranslateTransform() to reposition on specific part of your drawing surface. You have to make those call to graphics before any drawing occurs. To make the zoom 200% you do graphics.ScaleTransform(2.0, 2.0)
You can lookup more documentation on this at graphics class.
|
|
|
|
|
Does the VC#.net package on market contains the compact framework
so I don't need to buy the whole VS studio .net for programming CE
device ? The two packages are different a lot in price.
Thanks
|
|
|
|
|
|
Hi!
I am developing a web application in asp.net using C#. my problem is that i take user input and store it into database. Now when i take the input for "salary". from a text box i am unable to convert it into "Money data type".
my code is
string sql="insert into User1 values ("+txtUser_ID.value+", .... ... ','Cast('txtSalart.value' as Money)','.....
I hav tried several other combinations as well but each time i get the errors like
1. Invalid character near txtSalary,
2. Can not convert to Money from varchar Use CONVERT function
anf bla bla....
Similarly what should i do to store date without a time value. ie i just want to store date n not time. and also i want to retrieve only date value and not time....
Can any one help me out ???
Waititng 4 reply
|
|
|
|
|
To convert to money data type you can use:
decimal amount = Convert.ToDecimal(txtSalary.value)
then you can use amount.
Best way to do that would be to use parameterized query instead of creating sql as string.
cmd.Text = "insert into user1 values (@col1, @col2)";
cmd.Parameters.Add("@col1", txtUserID.value); // if it's a string
cmd.Parameters.Add("@col2", amount);
|
|
|
|
|
To get the date only part of datetime you use Date property.
DateTime someDate = ...;
DateTime dateOnly = someDate.Date;
|
|
|
|
|
Hy folks,
well, the subject says it all, how can I turn off/mute the system audio output? Probably some DLL call ? (Could it be user32.dll?).
Thanks in advance!
|
|
|
|
|
This[^] article should give you a start. See the Platform SDK on MSDN Library[^] for more information about mixer control types (like
MIXERCONTROL_CONTROLTYPE_MUTE <br />
Microsoft MVP, Visual C#<br />
<a href="http://www.codeproject.com/script/articles/list_articles.asp?userid=46969">My Articles</a>
|
|
|
|
|
How can it be used?
The only thing I can do is retrieve the colors in the Entries.
How can I change them?
I'd like to change the palette of a 256 color gif.
So I have Bitmap MyBitmap = new Bitmap("file.gif");
I tried MyBitmap.Palette.Entries[0] = Drawing.Color.Black, but it does nothing as Entries is a read only properties.
How can I change the palette entries? Or how can I create a new ColorPalette?
Bitmap.Palette is a read / write property, but there is no constructor for the ColorPalette class, and the ColorPalette.Entries are read only
|
|
|
|
|
ColorPalette is a value-type. You can change a value of it when it's a property of another type. For more information about value types vs. reference types, see http://www.albahari.com/value%20vs%20reference%20types.html[^].
In order to change the palette, you must first get a copy of the ColorPalette struct:
ColorPalette palette = img.Palette;
palette.Entries[0] = Color.Red;
img.Palette = palette;
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have an application that populates a PictureBox control with an Image and then dynamically adds controls to the form on the top of the PictureBox . The PictureBox is the Container of all the dynamic controls. The problem I have is disposing of these dynamic controls. When I run the following code it dosposes of some of the dynamic controls but not all of them:
foreach (Control control in this.pictureBox1.Controls)<br />
{<br />
this.pictureBox1.Controls.Remove (control);<br />
control.Dispose ();<br />
}
Any ideas why it doesn't get rid of them all?
When they were created they were all added to the pictureBox1.Cotrols collection.
|
|
|
|
|
Hello,
How do you remove Remove text selection in an RTB, (i.e. So you can't select the text in the RTB) RTB = RichTextBox
regards,
Gobbatroll.
|
|
|
|
|
can media player develop in VC change in C#?
OR
can develop media player in C#?
sdfsdfsdfhsdfh
|
|
|
|