|
There's an easier answer than reflection: Add another function in class a that's public and calls myclass():
public double getMyClass ()
{
return myclass ();
}
Yes, it's a silly answer, but that was a silly question.
|
|
|
|
|
I want Visual Studio to auto-change the active project when I change sourcefiles. I don’t want to right-click a project an choose ”Set as startup project”. (VS 2005)
_____________________________
...and justice for all
APe
|
|
|
|
|
d00_ape wrote: I don’t want to right-click a project an choose ”Set as startup project”. (VS 2005)
so how does it know what you want to do? Guess?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
On the cpu I'm use now VS2005 automaticaly sets "active project" on the project that my current code-file exists. Current codefile = Selected i Project Explorer or active in code-view.
_____________________________
...and justice for all
|
|
|
|
|
Most of my projects are DLLs, many are Windows Services, setting those projects as Startup would not be wise.
|
|
|
|
|
Hi expets, I created a datagrid column as a templete column.It is a textbox field.So how i validate that templete column(textbox)?
CheeN
|
|
|
|
|
This[^] was my first hit when I googled. BTW, this question has to be in ASP.NET forum.
|
|
|
|
|
I want my app to have a few global functions that are performed whenever certain keys are pressed. That's easy to do as long as a certain control has focus, but as soon as one of the other numerous controls on my form receives focus, the key press events are no longer fired for the control that cares, with the events instead firing for whatever random control happens to have focus.
The pull-down menu controls seem to have solved this problem because they process Alt presses regardless of what control has focus. Does anyone know how I can do this too?
Thank you!
|
|
|
|
|
Set the form's KeyPreview property to true and you can handle all the key presses in the form's various key events rather than using the individual control's.
Dave
|
|
|
|
|
Hi All,
How can i know from the keyboard scan code what is the real key ?
I using KBDLLHOOKSTRUCT Structure in my keyboard hook to get the pressed keyboard information - But i still don't understand how can i know what the meaning of the key that was pressed even if i know the scanCode of the pressed key.
I don't want to use "switch..case" to check for each option pair So ... i looking some .net Framework class ( or win32 function ) that can find the value of the scanCode of the pressed key.
Beside this - how can i know if the key that pressed is 'A' or 'a' or '5' pr '%' - ?
Thanks for the help
|
|
|
|
|
Hi
i have the situation to fetch similar values using fuzzy lookup. here i dont know how to pass variables which contains input values[comes from my application] to the fuzzy look up without using datasource.
Can anyone tell how?
thanks in advance
sari
|
|
|
|
|
I have no idea what you're asking. What fuzzy lookup ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
How to delete record using check boxes in datagrid.
that is if check box is checked the record should be deleted and again when checkbox is checked the record must undelete.when the record is deleted the "edit" command of datagrid must deactivate.
iam using stored procedures to delete records that is updating flags.
can any one help me in coding.
thanks
|
|
|
|
|
I guess you need to have a deleted flag ( if you delete records from the DB, you cannot undelete ). Then it's easy, all flags are set by the checkbox value, on or off.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all,
I have 3 form in my application: fMain,fA,fB, Where create object fA() and fB() in fMain to use delegate.
fMain <---delegate---> fA
<---delegate---> fB
Now, i would like to force to refresh fB when fA was edited. How can i do it?
Any tips are welcome.
regards
cocoonwls
|
|
|
|
|
OK, I have an app which uses windows media player as a control. I need to build a 64 bit version. However, when I set the target to 64 bit, it says the build succeeded, but no code files are in the target directory. I think that may be because a setting is wrong, but when I fix it, I get this:
Error 49 An attempt was made to load an assembly with an incorrect format: E:\Source code\OVS\DiagnosticImagingAssistant\obj\x64\AussieRelease\DiagnosticImagingAssistant.exe. E:\Source code\OVS\DiagnosticImagingAssistant\SGEN DiagnosticImagingAssistant
Also a bunch of warnings like this:
Warning 33 Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor DiaFileWatcher
Warning 34 Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor DiaFileWatcher
Do I need to be on a 64 bit version of windows to build 64 bit ? If it just errors out, what's the point of having the setting ?
It's actually complaining that a dll I wrote, which is being built as 64 bit, and imports windows media player, is the wrong format:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\sgen.exe /assembly:"E:\Source code\OVS\DiagnosticImagingAssistant\obj\x64\AussieRelease\DiagnosticImagingAssistant.exe" /proxytypes /reference:..\Odyssey.Windows.Controls\bin\x64\AussieRelease\AxInterop.WMPLib.dll /reference:..\OVSCommon\bin\x64\AussieRelease\Interop.DexterLib.dll /reference:..\Odyssey.Windows.Controls\bin\x64\AussieRelease\Interop.WMPLib.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /reference:..\Odyssey.Windows.Controls\bin\x64\AussieRelease\Odyssey.Windows.Controls.dll /reference:..\Odyssey.Windows.Controls\bin\x64\AussieRelease\Odyssey.Windows.Forms.Controls.dll /reference:..\OVSCommon\bin\x64\AussieRelease\OVSCommon.dll /reference:..\OVSImaging\bin\x64\AussieRelease\OVSImaging.dll /reference:..\OVSCommon\bin\x64\AussieRelease\PresentationCore.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\ReachFramework.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.IdentityModel.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Management.dll /reference:..\OVSCommon\bin\x64\AussieRelease\System.Printing.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\UIAutomationProvider.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\UIAutomationTypes.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll"
SGEN : error : An attempt was made to load an assembly with an incorrect format: E:\Source code\OVS\Odyssey.Windows.Controls\bin\x64\AussieRelease\Odyssey.Windows.Controls.dll.
Done building project "DiagnosticImagingAssistant.csproj" -- FAILED.
any suggestions appreciated.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
modified on Monday, June 2, 2008 12:14 AM
|
|
|
|
|
Hi Christian,
I've never done any 64 bit stuff - but found these on the MSDN forums if they're any help.
Clickety[^]
Clickety[^]
Dave
|
|
|
|
|
Just found this[^] one too which may be of more help in step 3.
Dave
|
|
|
|
|
Hello everyone,
I am new to Reflection. Two basic questions about Reflection after some tests.
1.
About BindingFlags.Instance, I think it should refer to all entities which are not static but instance level, but I have made some tests and found it is not correct.
What does BindingFlags.Instance mean?
2.
What is the differences between FieldInfo and FieldType classes? In what situation should we use FieldInfo and in what situation should we use FieldType?
thanks in advance,
George
|
|
|
|
|
George_George wrote: I have made some tests and found it is not correct
Post your code.
|
|
|
|
|
Thanks PIEBALDconsult,
Here is my code to test the Instance status,
class Program
{
class Foo
{
static int abc;
int bcd;
}
static void Main(string[] args)
{
Foo f = new Foo();
FieldInfo[] fields = f.GetType().GetFields(BindingFlags.Instance);
return;
}
}
regards,
George
|
|
|
|
|
Try making the fields public and adding (ORing) System.Reflection.BindingFlags.Public
|
|
|
|
|
Thanks PIEBALDconsult,
I have tried when adding both Public and BindingFlags.Public, the non-static field bcd can be retieved. But why using Instance tag alone is not working?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace TestReflection1
{
class Program
{
class Foo
{
public static int abc;
public int bcd;
}
static void Main(string[] args)
{
Foo f = new Foo();
FieldInfo[] fields = f.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public);
return;
}
}
}
regards,
George
|
|
|
|
|
George_George wrote: But why using Instance tag alone is not working?
Reading the documentation[^], in the remarks section it says:If the requested filed [sic] is non-public and the caller does not have ReflectionPermission to reflect non-public objects outside the current assembly, this method returns nullNothingnullptra null reference (Nothing in Visual Basic). From your original example[^], your fields are implicitly declared as private.
You need to either make the fields public or adding BindingFlags.NonPublic.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Thanks Scott,
1.
Scott Dorman wrote: have ReflectionPermission to reflect non-public objects
Means using BindingFlags.NonPublic to grant permission?
2.
I am confused what means "outside the current assembly" and why it applies to my situaion, since I am always using the same assembly -- the current.
Any comments?
regards,
George
|
|
|
|