|
Ussually a hashtable will occupy around 5 to 1 space, this is normal, so 3 to 1 aint that bad
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
I'm trying to add a reference in my project to DirectX 9 components. I have the SDK installed, but no references for DirectX show up when I try to add references. I can't find what files to add, so I'm stuck. I'm running the Academic Version of the VS.NET 2003. Any suggestions?
|
|
|
|
|
I am writing a tiny screensaver and it works fine except for the preview. I know it passes the /p parameter to my program when it wants to preview it but what do i do then?
help is greatly appreciated
|
|
|
|
|
I want some methods of one class to be only visible to my desired classes in the same project. So I need some thing more limited than internal access modifier. Can anybody help me?
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
You could write a proxy class that sits in between your other classes and your "internal" class. This class would use your "internal" class and only expose those methods you want.
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Sounds like what you want is an identity demand using .NET's code access security and strong names. If those pointers don't get you headed in the right direction, I'll make a quick sample later today.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Maybe, but for now, I need them for myself. I just want to follow design patterns. For example I have a Control class and a TransactionManager class. I just want to be able to work with Control class, While I am yet able to do my work with TransactionManager class.
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Hmm, based on this reply it's clear I completely misunderstood what you were asking for in the first question. Unfortunately I can't quite parse this one at all.
meisi wrote:
I just want to be able to work with Control class, While I am yet able to do my work with TransactionManager class.
What exactly do you mean by 'work with' in this context?
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Suppose that there are 3 methods in TransactionManager class, which are invoked by one method in Control class. So when I call that single method from Control class, 3 methods are called from TransactionManager class.
I can do 2 things,
1- Creating an instance of Control class and calling its single method.
2- Creating an instance of TransactionManager class and calling those 3 methods myself.
I don't want to be able to do the second one. I mean I want the TransactionManager to be visible(instanciatable) only for Control class.
I hope it be clear.
Somehow seems imposible, hum?
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Did you completely ignore my post before?
Why not make TransactionManager a private class inside Control? Then you can just make Control public and expose only the methods you want to expose.
I don't mean to sound harsh.... maybe I am just ignorant of you situation....
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Thank you Nathan! That is exactly what I shoud do.
And excuse me, I misunderstood your first post
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Sorry about the harsh post... I was in a bad mood yesterday. Also, my first post was a little more (shall I say) abstract than I wanted it to be.
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Hi there,
here my problem: I added a Table to my webform and added some datarows and cells manually in it(with VS.net). Then i'm adding some new row's at runtime (table.rows.add(myrow)). If i now jump to another site and back (with server.transfer) only the data i inserted manually is present and the one insert at runtime is gone!
Can anyone help me solving this problem please?!
Thanx
Obi
|
|
|
|
|
Can you change the function that the thread calls after it's completed? In other words, is this right:
Thread thrd = new Thread(new ThreadStart(dummyobject.dummyfunction-1));
thrd.Start();
thrd.Join();
// is the following correct?
// are there any objects not destroyed or garbage collected by this?
thrd = new Thread(new ThreadStart(dummyobject.dummyfunction-2));
thrd.Start();
thrd.Join();
If not, how could you achieve this? how are Thread objects reusable?
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
Actually, you're not reusing a Thread object, but merely a Thread variable that references a Thread object. In your example, thrd is only a reference variable. If is given an object reference when you instantiate a new Thread using the new operator.
So, that is fine, but you won't be able to access the first thread you created anymore, since you re-referenced a different thread. All access to thrd now would be accessing the second Thread that you created.
-----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-----
|
|
|
|
|
That's perfect, but now, what if I actually want to destroy the first object before making thrd reference the second one? Aren't I actually supposed to do that?
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
I think you need to either pick up a good book on .NET or read the SDK documentation. You are missing one of the most crucial aspects of .NET's CLR - garbage collection. When the thread exits, the memory for that thread object will eventually be reclaimed. If an object implements IDisposable (usually classes that wrap system objects, like files or mutexes), you are supposed to dispose it but they will be diposed when destroyed when the app exits.
In the case of threads, you don't need to worry about it. thrd is only a reference to an object that will get cleaned up. As long as you assign to it, you're not changing the object at all.
These are some of the most fundamental pieces of the .NET framework (and Java, for that matter) and should be explored.
-----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 have read books, it's just that none of them were advanced enough to mention this in detail. I really guessed the answer, but I can never be sure. Could you please recommend a good enough advanced book about these issues?
Thanks for everything.
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
hello there
im not a pro c#, u might say im a beginer.
but i best learn from expiriance so i decided to
program a "complex" application.
ofcourse every software need a configuration form
so i made up a class with all members/vars to stream
to the configuration file.
and now, here is my question:
instead of writing members values to file
one by one, can i make a trick to loop trough all
members?
so if tommorow i add 5 more values (font, loc, color..etc)
the saving method wont have to change.
is it possible?
|
|
|
|
|
Sounds like you are reinventing a wheel. The .NET framework has support for automatic serialization. Its pretty much as simple as adding a [Searializable] attribute to your class definition. Have a look at this[^].
Ryan
|
|
|
|
|
thank you
i knew there is something like that
but didnt find enough info.
thanks again
|
|
|
|
|
Hi ,
I had created a toolbar and need to deploy it over the internet . I created a cab file with an ini file in it . This cab file was referenced from a html page through the OBJECT tag . The cab file was aldo digitally signed with a certificate created with the help of the tools available in .net . But when that page is referenced the installation does not take place .
Please help . Where could i have gone wrong . The OSD file everything has been written with the help of instructions from the MSDN documentation .
And how do i run a dos command from an ini file . I tried usig the run statement but it didnt work . Please tell me how to do it . If run is the command then please send the syntax for the run statement .
Srikar Y
NITK Surathkal
|
|
|
|
|
.NET != ActiveX, or
.NET <> ActiveX
In order to distro a .NET control in a CAB file, it has to expose it's controls as, at most, IUnknown class interfaces (or use IDispatch class interfaces to make it scriptable, given the proper security context).
If you look at the section of the .NET Framework SDK documentation entitled "Deploying Applications", you'll see that you really should use CAB files at all. Instead, you use a slightly modified <OBJECT> tag that reference the assembly and class directly. Then, if the site or URL is allowed the proper security priviliges by the .NET framework, the control will be instantiated directly. Any public properties of the control that have a TypeConverter to read/write strings can be set using the <PARAM> tags inside the <OBJECT> tags, such as a URL to an INI or XML file to build the toolbar.
CAB files can be used, but it is generally not done because the .NET model allows for assembly bindings over the Internet in a seemless fashion. Fusion - the assembly binder - will download assemblies to a temporary assembly cache that is based on the assembly name. The next time the same version is used, it will be pulled from the cache and load / insantiate faster. A CAB file doesn't give you this functionality.
There are a number of other things, too. An embedded user control, as the method I'm describing is most often called, CANNOT use any values from the SystemColors class, as most controls do. This is documented and is because the control requires full trust and, for some reason, this class requires unrestricted access or something like that. Frankly, based on what I know about security and the CLR (which is quite a lot), Microsoft's statement has never made sense.
Also, the control has to be granted enough permissions to run. .NET basically runs in a Java-like sandbox, although .NET is much easier to use and configure. If the CLR isn't told to grant enough permissions to your control to run based on its evidence, it won't execute it.
I wrote an article about all of this some time back on a different site and haven't ported it over yet. Perhaps it would be a good time, since I could probably update some information on it. Take a look at the following URL:
http://www.devhood.com/Tutorials/tutorial_details.aspx?tutorial_id=388[^]
I hope that helps.
-----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-----
|
|
|
|
|
Hi everybody,
My problem is returning my entity objects though the autogenerated web service proxy class.
Explanation:
Projects:
Class library (containing entities)
Web Service (instantiating entities with values from database)
Smart Client (windows forms)
The entity class library is shared between web service and smart client.
What I want to do is sending my entity objects to my smart client, but the proxy class obstructs that by creating a webservice.Vendor class which holds only the public properties as public variables instead of the entity.Vendor class...
The result is that i cant just typecast the proxygenerated Vendor class into my entity.Vendor class. Ive found a "hack" for this by editing the proxy class myself. But that is indesirable as it is overwritten each time I update the web reference due to updates in the webservice...
HELP!
If you need futher details plz do ask
Best regards
Alex
|
|
|
|
|
Have a look at this article[^], it uses CodeDom to generate a wrapper class for the wsdl.exe generated proxy, which exposes properties instead of variables. DataBinding heaven.
I have a C# version if you would prefer that.
Ryan.
|
|
|
|