|
Hello again, "ich sag einfach Hello again"...
I have some question about a problem which seems to elude me. I did some research on plug-in frameworks (still working on my service here) and it seems to be a very useful feature to have a "pluggable" service.
Since the CodeGenerator SAP calls the ".NET Connector" will generate only code which becomes invalid after a single change to the corresponding structure in SAP, we should be able to simply replace that function with the proper one (hence, plug-in).
This would also enable us to have a service which could be extended with "Function Modules" as requirements change.
Well, I wrote an interface, implemented it in my Plugin and referenced it from both "host application" and "plugin library".
Now, I have a little trouble passing information along.
I have found one article here on CodeProject, but that referred to C++. Maybe I am just too stupid.
How can I pass my important data (as an object) between host-app and plug-in ?
Cheers
Sebastian
|
|
|
|
|
Hi All,
In my C++.NET application, the 'ndStud' object is displayed in a Property Browser. 'ndStud' object has nested properties. While changing the 'StudSize' property from the property grid, the application hangs.
If i remove the NotifyParentProperty attribute from the sub properties of StudSize (Feet & Inches), the application works, but still cant modify it's values from the property grid.
What should i do in order to make it editable from the property grid (it works at run-time)?
Plz see the code bellow:
[Serializable]
TypeConverter(__typeof(System::ComponentModel::ExpandableObjectConverter))]
__gc public class ndLength
{
private:
int feet;
int inches;
public:
ndLength()
{
feet = 0;
inches = 0;
}
ndLength(int feet,int inches)
{
this->feet = feet;
this->inches = inches;
}
[NotifyParentProperty(true), RefreshProperties(RefreshProperties::Repaint)]
__property int get_Feet()
{
return feet;
}
__property void set_Feet(int value)
{
feet = value;
}
[NotifyParentProperty(true), RefreshProperties (RefreshProperties::Repaint)]
__property int get_Inches()
{
return inches;
}
__property void set_Inches(int value)
{
inches = value;
}
};
[Serializable]
[TypeConverter(__typeof(System::ComponentModel::ExpandableObjectConverter))]
__gc public class ndStud
{
:
:
:
:
:
:
:
[DesignerSerializationVisibility (DesignerSerializationVisibility::Content)]
__property ndLength* get_StudSize()
{
}
__property void set_StudSize(ndLength* value)
{
}
};
}
thanks,
Pradeep
|
|
|
|
|
hi,
Better choose managed C++ forum
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
How can I disable write in comboBox?
thanx
|
|
|
|
|
Set the DropDownStyle property of the ComboBox to ComboBoxStyle.DropDownList.
|
|
|
|
|
Make it a Set the ComboBoxStyle property to DropDownList... that stops the text part from being an edit box!
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
It works
Thaky you
|
|
|
|
|
I have two programs. One that will allow the specification of a long list of properties and the other that will use the data in these properties without changing them.
That is I want read/write access in the specification program and readonly access in the program that uses the data, but I want to use the same namespace/class for both. Further, I want to take one of the classes in the namespace and have an instantiation on the side that uses the data with both read and write access.
I have tried putting preprocessor instructions around the set accesors, but this clearly comes to grief when I try to have read and write access for an instantiation of one of the classes on the side that uses the data. (I can't use define or undefine).
I describe my problem in more detail below:
namespace Data
{
public class ADataSet
{
private int n;
....................
public int N
{
get {return n;}
set {n = value;}
}
....................
}
public class BDataSet
{
private int m;
....................
public int M
{
get {return m;}
set {m = value;}
}
....................
}
}
In the above, the first program requires read and write access to all properties. The second program requires readonly access, but also needs to create an additional object of type BDataSet with both read and write access.
There are hundreds of properties in each of ADataSet and BDataSet. How can I get round this problem without having two identical classes, one with readwrite and the other readonly access?
I have not yet got to grips with interfaces, but I don't think these will make any difference.
Roger
|
|
|
|
|
carradus wrote:
I have not yet got to grips with interfaces, but I don't think these will make any difference.
Interfaces is exactly what you need! Eg
public interface IFoo
{
string Bar {get;}
}
class Foo : IFoo
{
public string Bar {get{...};set{...};}
}
Now you can access class Foo from the assembly internally, and only expose the IFoo interface to external users. Very powerful indeed, and I personally overuse it
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
Thanks Leppie
This worked, but I find it a bit disconcerting that I need two almost identical copies of a class to do what I want(three including the interface). One with readonly and the other with read/write (with the interface containing the declarations). With hundreds of properties I could achieve the same thing with two classes and no interface. However I appreciate the power of the method since the compiler will flag anything in the implementation that is not in the interface and vice-versa.
Roger
|
|
|
|
|
carradus wrote:
One with readonly and the other with read/write
Thats the beuty of the interface, you dont have to redo the whole class, u just one. just pass the class as the interface when the user requests it. did you remember to make the readwrite class internal?
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
User name is?
User in group?
|
|
|
|
|
string mystring = Environment.UserName;
As for the group: I have no clue.
Try Win32-API or find out if it is in here:
class Sample // MSDN-Sample
{
public static void Main()
{
Console.WriteLine();
Console.WriteLine("GetEnvironmentVariables: ");
IDictionary environmentVariables = Environment.GetEnvironmentVariables();
foreach (DictionaryEntry de in environmentVariables)
{
Console.WriteLine(" {0} = {1}", de.Key, de.Value);
}
}
} // MSDN-Sample
|
|
|
|
|
If you want to find out if a user is a particular known group you can use...
WindowsIdentity wi = WindowsIdentity.GetCurrent();
WindowsPrincipal wp = new WindowsPrincipal(wi);
wp.IsInRole("Administrator"); //or whatever the role is.
Getting a list of Groups a user is a member of is more difficult the last time I needed to do it I used the WinNT ADSI provider with the DirectoryServices classes...
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
hai friends,
i am new to .net.
i am learning c sharp. i am having problem to retreive data fron datatable.
how to retrieve data which is datatable.
pls help me....
with regards
prasad
|
|
|
|
|
hi,
If you are newbee in ado.net. then i suggest you to go for some e-materials or books or msdn to get a basic idea. and then try to submit your problems which arises on the time of implimentation.
i don't know which datatable you mean. Is it created using dataadapter or you mean the virtual table which is programmed by the programmer.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
You have to be more specific if you want help.
mav
|
|
|
|
|
actually i want to use delegates for events in c sharp.i want to use delegate with checkbox(checked event) and checklistbox(itemcheck event).now help me
thanx
|
|
|
|
|
Although you don't tell us exactly what your problem is, this might help you:
Delegates are similar to function pointers in C/C++, callback functions that are called when a certain event arises.
The big advantage of .NET delegates is that they are type-safe.
So for example to catch the CheckedChanged event of a CheckBox you'd write:
checkBox1.CheckedChanged += new EventHandler(checkBox1_CheckedChanged); This attaches a new delegate (EventHandler is a special form of a delegate ) to the CheckedChanged event of your CheckBox checkBox1 . The method to be called is checkBox1_CheckedChanged and must be defined like this:
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
}
So far for a start, I'd suggest you read the description of event handling in the .NET framework documentation.
mav
|
|
|
|
|
hi,
If you are newbee in C# delegate. then i suggest you to go for some e-materials or books or msdn to get a basic idea. and then try to submit your problems which arises on the time of implimentation.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I Want draw a polyline join two points ,It Can generated automatic and steer clear of shapes in the map if input start point and end point. Just like Visio 's polyline does.
Who can tell me the arithmetic about this ?
|
|
|
|
|
Gentlemen,there is a question for you.
Well , I'm trying to replace my system cursor with a real 3D cursor.But I don't konw how,or even it is possible , to display my 3D cursor generated in real time instead of the system cursor.
Anyone can give me some advices?
|
|
|
|
|
It is my understanding the the desktop, cursor, et. al. is only using the 2D graphics API. Using DirectX would require (I do believe, but could be very wrong) running the entire desktop in DirectX 3D mode. You would probably have better options open to you next year using VS 2005 and the WinFX API.
This signature left intentionally blank
|
|
|
|
|
I havent done any programming in a few months now, and as such i kinda forgot alot of this stuff... i used to know the anwser to this question *i wrote a program using it before* but alas, i forgot. Anyways what i need is to have my program running in the background without focus and beable to detect when i press a combo of buttons on my computer, and have it regain focus agian. Its simple i know, but i just pretty much forgot how to do alot of programming, anyways thanks for your help guys. Do i have to catch api calls, if so can you kindly provide any of them or ways of finding them, im looking now for them but i think there has to be a easyier way, a managed .Net way. anyways thanks for your time.
The Code Project Is Your Friend...
|
|
|
|
|
There is currently no "managed .Net way" of doing this, no. You need to implement system hooks by P/Invoking the necessary APIs. In fact, much of the .NET Framework BCL - especially System.Windows.Forms.dll - encapsulates native functionality already. You can see this by examing the BCL assemblies in the IL Disassembler (ildasm.exe that ships with the SDK) or another disassembler/decompiler of your liking. Read Global System Hooks in .NET[^].
Be very careful, however. System hooks need to be fast since all messages from a particular class of messages are passed through the hook. Some people writing managed code often take for granted what's given to you for free without thinking (or knowing) about the code that provides such functionality. And always make sure that your code will not currupt the system message pump unnecessarily.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|