|
Oh, of course the com dll has been registered successfully. When add its reference by vs(it can be listed in the com tab list), vs will give me an error messagebox says "A reference to '*** Type Library' couldn't be added. This is not a COM component". But, if the dll has embedded type library in it, it will be ok.
|
|
|
|
|
Sorry but I never ran in this problem, so I never had to find a solution for this.
Greetings
Covean
|
|
|
|
|
Oh, thanks all the same. I will be glad to tell you the solution if i got it.
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:17am.
|
|
|
|
|
My be. But my main problem is create the component class.
You know, in C#, i just reference the com dll. If i have to use the raw com dll file as common unmanaged dll, im not sure how to create the object and how to translate parameters.
So, I hope to add referenct it via its type library(.tlb file).
|
|
|
|
|
I am trying to put this into actual class and i am having difficutlties in it. I am not sure how to show relationships. I have put down some classes that it may need.
Build a class called Employee reporting relationships. The class will be used as a part of some application. Its main purpose is to keep and maintain data related to the reporting relationships between employees within an organization.
Employee can have zero or more managers. Manager is an employee who has one or more other employees reporting to him.
Class EmployeeReportingRelationships
{
}
Class Employee
{
}
Class Manager:Employee
{
}
modified on Wednesday, June 23, 2010 1:47 AM
|
|
|
|
|
I'm afraid noone will do your homework for you.
Try thinking further, and come back with a more precise question.
|
|
|
|
|
Well, I am not asking to write exact code for me or atleast if you could engligten me with some ideas wouldn't be bad. I find hard to comphrend and put into OOP. I know how to write classes and properties but i am not so sure what to do in it.
|
|
|
|
|
So you need to break down the requirements into logical parts.
Employee can have zero or more managers.
So, your Employee class will need a property that has a variable size that is of type Manager . Perhaps a List<Manager>
Manager is an employee...
So the Manager class should derive from Employee as you have already done.
...who has one or more other employees reporting to him.
So the Manager class needs an additional property that has a variable size that is of type Employee . Possibly, the extra Manager class isn't needed as checking this property is > 0 will indicate that they are manager anyway.
This is what programming is all about, turning real world situations into code and in the case of OOP creating objects to represent them and adding properties to give the details/descriptions of thos objects and methods/events for the things they actually do. Not really that hard to grasp.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Thanks Dave, your comments were really helpful. I've given you my vote of 5.
However there is still a little confusion about the relationship, how could i get a list of managers for a given employee. For example, let's say I have an employee named "Frank" and he has two managers (Sean and manager2).
|
|
|
|
|
You should keep a list of the managers - something like this...
public class Employee
{
private string name;
private List<Manager> managers;
public string Name
{
get { return name; }
set { name = value; }
}
public List<Manager> Managers
{
get
{
if(managers == null)
return new List<Manager>();
return managers;
}
set { managers = value; }
}
}
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
modified on Thursday, June 24, 2010 6:04 AM
|
|
|
|
|
You should use the UML tools, visio or rational rose to draw the class diagram.
The class Manager is derived from Employee,
The class employee and manager is depended by clas EmployeeReportingRelationships.
|
|
|
|
|
Hi,
I am using “Heaton Research” for crawling data. In this process I think a very small issue is there, which I am not getting, or rather leaving it each time. The basic problem which I am facing is to use the "SQLWorkloadManager" method in place of "WorkloadManager" , In the book example is given for "WorkloadManager" and it is for one site, and it is further said that if you want to use it for more sites, then use "SQLWorkloadManager", It is further written that it can be used, but I am not getting the way to use "SQLWorkloadManager", I am sure that it may be a very small thing, but I am confused and not getting it correctly, It is working fine with “WorkloadManager” but not working with “SQLWorkloadManager” Any Idea to solve the problem will be great. Thanks in advance.
Deepak Upreti
|
|
|
|
|
Hi Expert
i am using VS 2005 and Making Some .dll File but i see that their are
some tool like .net reflector like to decomplied the .dll file
code is their any way to prevent to decomplied my .NET Dll.
|
|
|
|
|
Use a tool like a Dotfuscator[^].
Unfortunately, such tools dont very often prevent assemblies from getting decompiled.
They just make the decompiled code harder to read.
|
|
|
|
|
The short answer is no. If someone wants to decompile it they will.
You could use an obfusticator to make it less readable, but that would not stop them being able to decompile it.
So the long answer is also no.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
By design .NET embeds rich Meta data inside the executable code using MSIL. Anyone can easily decompile your DLL back using tools like ILDASM (owned by Microsoft) or Reflector for.NET which is a third party. Secondly there are many third party tools which make this decompiling process a click away. So any one can easily look in to your assemblies and reverse engineer them back in to actual source code and understand some real good logic which can make it easy to crack your application.
The process by which you can stop this reverse engineering is using “obfuscation”. It’s a technique which will foil the de compilers. There are many third parties (XenoCode, Demeanor for .NET) which provide .NET obfuscation solution. Microsoft includes one that is Dotfuscator Community Edition with Visual Studio.NET
lklklhjsdg
|
|
|
|
|
Anyone know what I can do about this.
I'm getting a user DirectoryEntry, modifying an attribute value, then committing the changes, and closing the entry, but on subsequent calls (re-get user directory->get attribute value), the value is the original... until about 10-15 seconds later.
I've tried using the RefreshCache method, and the UsePropertyCache property on the DirectoryEntry, but nothing seems to work. I don't understand why the value isn't set immediately (this is a dev ADAM server w/ virtually no load, it shouldn't be a performance issue).
Setting:
using ( DirectoryEntry entry = FindUserDirectoryEntry( username ) ) {
if ( entry != null ) {
if ( entry.Properties.Contains( attributeName ) ) {
entry.Properties[attributeName].Value = value;
} else if ( value.IsEmpty() == false ) {
entry.Properties[attributeName].Add( value );
}
entry.CommitChanges();
entry.Close();
}
}
Getting:
DirectoryEntry entry = this.ADAMProvider.GetUserDirectoryEntry( userName );
if ( entry != null ) {
if ( entry.Properties.Contains( attributeName ) ) {
entry.RefreshCache(attributeName);
value = entry.Properties[attributeName].Value.SafeToString();
}
entry.Close();
}
|
|
|
|
|
Ok... nvm... found my own answer. Turns out that I have to set the CacheResults on the DirectorySearcher (that finds my DirectoryEntry) to false. Now everything works immediately!
|
|
|
|
|
|
If you don't want to display a login for the user you have to disable anonymous access in IIS and then require AD. This will require your users to use IE or type in a user name and password. Then in the Global.aspx in the Authenticate event add your custom Principal which should override the Windows Principal. There are many articles online.
|
|
|
|
|
|
I always load the roles from the database on every call instead of storing it in Session.
|
|
|
|
|
|
The proper way to handle this is to create an Authentication Provider and use the web.config to configure app to use it.
http://msdn.microsoft.com/en-us/library/907hb5w9.aspx[^]
Also, this should have been posted to the ASP.NET forum since it clear deals with ASP.NET specifically and not C# in general
I know the language. I've read a book. - _Madmatt
|
|
|
|