|
Ok, thread is over!
About my last question I got it now, using PropertyInfo.SetValue()... Thanks but:
I made a mistake posting this thread start. Type.InvokeMember(... BindingFlags.SetField|BindingFlags.SetProperty...) DOES return and set inherited types, the mistake was that I was tryong to set aMember into other type value than it's own, so Such 'aMember' with that target type could not be found and null would be returned.
Thank you and sorry for the mistake,
-nSun
---
"Art happens when you least expect it"
|
|
|
|
|
Any one have got sample of the book Developing Microsoft .Net Applications Window!
Please send me it!
Sillyboy0009@yahoo.com
Thanks!
xyz
|
|
|
|
|
Go to the publishers site, its more than likely there!
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
So: I have created ActiveX control inherits from the Control Class, as it written in Morgan Skinner's article. It was successfully registered in system, but when I have tried to add it in C# winform application, the mistake message was given:
"Converting the type library to a .Net assembly failed. Object reference not
set"
or if i try add .tlb file the mistake message was:
"Converting the type library to a .Net assembly failed. Type library was exported from a CLR assembly and can not re-imported as a CLR assembly"
What can i do? Что делать?
|
|
|
|
|
This post is rather puzzling. In the same sentence, ActiveX refers to something from the unmanaged world, and the Control class refers to something from the managed world.
Did you create an ActiveX control using an unmanaged compiler like VB6 or VC++6 ? If yes, then you can import it into the managed world by opening the toolbox window, right-click on it, select "Customize toolbox" (VS.NET 2002) or "Add or Remove Item" (VS.NET 2003), then click in the components tab, browse so you find the ActiveX dll, and finally drop it onto the form.
There are several cases however where the ActiveX import will fail. Most of the time, it just works.
RSS feed
|
|
|
|
|
I have created this control in С# in VS.Net 2002 => using a managed compiler
|
|
|
|
|
1) The C# compiler does not create ActiveX controls.
2) If you are in an unmanaged environment, it is possible to use a .NET user control like it was an ActiveX control, thanks to an undocumented technique, but I am not sure that's what you are talking about.
3) If you created that non-ActiveX user control with the C# compiler, then why don't you just include the .cs file in your other project? What is the tlb import for?
RSS feed
|
|
|
|
|
1. Thanks for lesson.
2. This control will be used with Delphi or CBuilder, that is why i need to do non-ActiveX control.
3.Do you know how can i do that.(use with Delphi)
4.(thanks to an undocumented technique) - what technique?
Thanks.
|
|
|
|
|
3) I would look around Delphi.NET and #Builder
4) Here[^] it is.
RSS feed
|
|
|
|
|
I've got a datagrid, and all I want to do is select an item, push a button, and have a new windows form show up w/ information based on that item. I'm completely lost on sending the data to the new form, someone *please* help!
<---signature--->
Your kid gets into Duke.
You pay the tuition.
That tuition goes into my checking account.
My money in my checking account goes into beer, porn, and other such fun. Thank you
|
|
|
|
|
|
Don't need anything in ASP, need the C# stuff to open windows forms.
<---signature--->
Your kid gets into Duke.
You pay the tuition.
That tuition goes into my checking account.
My money in my checking account goes into beer, porn, and other such fun. Thank you
|
|
|
|
|
|
How can we connect to com port with c# (without using Assembly )?
|
|
|
|
|
You can't.
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
IF u dont mind downloading the VBResourceKit, u can find one in there
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
hi anyone knows if there're classes or libraries about that protocol?
thanks in advance
Paolo Ponzano
|
|
|
|
|
How can I maintain selected items in a bound list box control when it is bound to a datasource. What I currently do is add the item to a the underlying datasource which then automatically adds it to the listbox. I then use the setselected method of the list box to select the newly added item. This works great, but it unselects all my previous items that were selected. How do i get around this?
Thanks,
Ryan
|
|
|
|
|
Looking at the IL for the ListBox , this isn't possible. While both the SelectedIndecies and SelectedItems properties use a class that implements IList , IList.Add and related methods throw a NotSupportedException .
You'll have to derive your own ListBox class and create your own IList implementation that does implement those methods (and perform the necessary actions in the ListBox . If you have a program like .NET Reflector, you can see how the CheckedListBox derives from ListBox and do much the same thing.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
i want to start an process (i.e. notepad.exe) in a (.net) nt service application (vb.net).
the service run's in "local system" account. i get an exception (access violation) if the
service application want's to start the process. what could be the reason for this exception??
regard's, thilo.
|
|
|
|
|
For one, a service must be able to interact with the Desktop. There is an option for this in the SCM (service control manager). Also, the server must run as a user or other problems are likely to happen.
Why in the world are you trying to start notepad from a service, though? It's important to do things in the way they were intended. Services are programs that run without a user being logged in, or for global access by programs on your machine or other machines (like the Event Log service, for example).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
starting notepad.exe was only an example.
the "interact with desktop" flag was the right answer.
i want to access a network-shares (as local system-service) to load notepad.exe from e.g. \\server1\share1\notepad.exe.
the guest-access is activated for that server and "Everybody" has the right to read that share, but my service cannot access this share. why?
|
|
|
|
|
thilol wrote:
i want to access a network-shares (as local system-service) to load notepad.exe from e.g. \\server1\share1\notepad.exe.
the guest-access is activated for that server and "Everybody" has the right to read that share, but my service cannot access this share. why?
When you say "everybody", it is actually everybody recognized by "server1", i.e. everybody with an account in the domain. You need to change your service to run under a regular domain account instead of "Local System". This can be done via the "Administrative Tools - Services" menu, just double click your service and select the "Log On" tab (you can use the browse button to find a domain user).
Good luck.
P.S. You won't be able to see the GUI of your program started by the service if your service no longer uses the "Local System" logon.
My articles and software tools
|
|
|
|
|
Because the local SYSTEM account is just that - local. When connecting to other services, the SYSTEM account is not the same - not the SID and not the same password (one or the other depends on the authentication used). To access a share on another system, you have to run the service as a domain account - not a local account. Either use or create a domain account (or two local account named the same thing with the same password - works in most cases) and run the service as that user. Make sure that user account has the permissions to run as a service. You can set this in the domain or local security policy for the computer on which the service is being run.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
my service have to run as LocalSystem!
can my service start a secondary process (which run's not as LocalSystem) to access a network share?
regards thilo.
|
|
|
|