|
<big>HI ALL <br />
<br />
PLEASE HELP ME. I am stuck on this point and can't do any progress in my project.<br />
<br />
Currently, I am using Domain Environment. I have Active directory and I want every users when they login to the domain, a program (.exe) file will run on there machines.<br />
<br />
This as you know, can be done by configuring logon script through GROUP POLICY ( from active directoty).<br />
<br />
Any how, when I run the (.exe) file generated when compiling the code in my local machine ( THE server that host the active directory), it works well.<br />
<br />
BUT, when the users try to login and run (.exe) file the follwing error generated:<br />
<br />
************************************************** **********************************<br />
<br />
System.Security.SecurityException: Request for the permission of type'System.Security.Permissions.SeurityPermission ,<br />
mscorlib, Version=2.0.0., Culture=neural, PublicToken=b77a5c561934e089' failed<br />
<br />
<br />
at System.Security.Principal.WindwosIdentity.GetCurre nt()<br />
<br />
at TestConnection.Program.Main(Straing []args)<br />
<br />
The action that failed was:<br />
<br />
Demand<br />
<br />
The type of the first permission failed was:<br />
<br />
System.Security.Permissions.SecurityPermission<br />
<br />
<br />
The zone of the assembly that failed was:<br />
<br />
Internet<br />
<br />
<br />
************************************************** *********************************<br />
<br />
As you can see from the execption. when I use the method WindowsIdentity.getCurrent()<br />
<br />
<br />
it fails why? Howover, when I use any symbol method only let's say " Console.WriteLine() >> this will work.<br />
<br />
<br />
I found something intersting about changing the security of the project by browsing to the solution explorer then open the PROJECT PROPERTIES<br />
<br />
THEN YOU GO TO SECURITY.<br />
<br />
But I couldn't understand how to change the security of my code to make it run in any PCs requesting it from the Server.<br />
<br />
I think the whole problem is a permission problem?? SO PLZ HOW TO SOLVE IT</big>
|
|
|
|
|
Hello
I am working on a COM project in which i use Interface Inheritance.
The IDL file looks like this,
interface IEarthInterface : IUnknown
{};
interface IOceanInterface : IEarthInterface
{};
interface IPacificInterface : IOceanInterface
{};
interface IAntarticInterface : IOceanInterface
{};
interface IDataInterface : IUnknown
{};
interface IFindInterface : IDataInterface
{
HRESULT GetOceanTypeInterface(IOceanInterface** pOceanInterface);
};
From inside IFindInterface i need to figure out which Ocean is currently attached and then attach or typecast
it was IOceanInterface and send it back to client.
All i wanted to know is how to get a Interface pointer from inside another Interface.
ie, can i call CoCreateInstance or QueryInterface from inside IFindInterface and get the
Interface Pointer to IPacificInterface or IAntarticInterface.
I been already told that CoCreateInstance will not work in this case.
Any idea how to implement this?
Thanks in advance.
|
|
|
|
|
Hi
In DllGetClassObject we create a classfactory and our classfactory's Createinstance function creates our class.
But why don't we create our class in DllGetObject directly instead of creating another class. What is wrong/absence with this?
I don't understand the concept of the creating ClassFactory in COM.
Can you please help me to understand it.
Thanks.
|
|
|
|
|
Hi,
I want the change the user bitmap in Win XP.
(That can be seen when we click on start button in Win XP. On start button click, start menu appears and at the top the username is displayed with the user bitmap next to it.)
These bitmaps are stored in the system at location : "C:\Documents and Settings\All Users\Application Data\Microsoft\User Account Pictures\Default
Pictures"
These can be changed in the system as : control panel >> user accounts >> pick an account to change (select an accnt) >> change my picture.
I want to change this picture programatically.
Im creating the user using API 'NetUserAdd'. I could find no method for adding a bitmap using Netxxx APIs.
Im trying to add the picture using ADSI and referred link http://support.microsoft.com/kb/292029
The code compiles and runs but bitmap doesnt get changed.
Can anyone please guide me for using this API?
Thanks,
Manasi
|
|
|
|
|
I created a simple COM+ app in the following way
c# class library is
public class SimpleCOM:ServicedComponent
{
public SimpleCOM()
{
}
public string Message()
{
return "This is COM app";
}
}
I assaigned a strong name
register component like this
>regsvcs /appname:TestCom ComApp.dll
i getting the following warnings
WARNING: The assembly does not declare an ApplicationAccessControl Attribute. Application security will be enabled by default.
I want to access SimpleCOM in my another application c# library
in AddReference>what i have to select
|
|
|
|
|
If there a way to get the system context menu for a folder item when the item is inside an NSE folder?
What I have is a real filesystem folder marked as 'system' with a desktop.ini pointing it to a NSE, the NSE displays the items that exist inside the folder along with some other stuff. Now I need to display the standard windows context menu for the items, but the IContextMenu is requested from the NSE, is it possible to make get an interface for the system context menu?
Thanks in advance.
|
|
|
|
|
Hi all,
I've an ActiveX control with me and i want to aggregate this ActiveX control from an ATL component.How can i do this? Anyone please help me.
Thanks in advance
ss
|
|
|
|
|
Hi
I open a DB connection using the _ConnectionPtr pointer. After using the connection I call the Close() and set the pointer to NULL. When I set the pointer to NULL an exception is generated. Pleae let me know is it really required to set the object to NULL after Close().
Thanks in Advance
|
|
|
|
|
I found an example in MSDN 2003 where NULL setting object omited. The sample name is
"ConnectionString, ConnectionTimeout, and State Properties Example (VC++)"
|
|
|
|
|
It's a COM + C#/.NET issue, so published in both, sorry...
************************************************************
I have an in-process COM server in VC++2005, events of which i'm trying to use in C#. After a very short session the following happens:
I can see in debugger of VC++: [Frames below may be incorrect and/or missing, no symbols loaded for rpcrt4.dll] coming from the C# client.
At which point the C# calls Unadvise into my event interface, and i stop receiving events.
In the meantime, the interface continues working in C# properly. The question is: why on earth C# drops the events handler and how to fight this?
************************************************************
P.S. If I track the moment when connection has been unadvised, and try to re-connect again, C# throws: System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used.
at System.Runtime.InteropServices.ComTypes.IConnectionPoint.Advise(Object pUnkSink, Int32& pdwCookie)
Free C++ libraries with source code on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
VitalyTomilov wrote: I can see in debugger of VC++: [Frames below may be incorrect and/or missing, no symbols loaded for rpcrt4.dll] coming from the C# client.
Can you post the stack trace?
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Please see my answer there below... It's a nice one ))
Free C++ libraries with source code on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
I seem to have found the problem, which also is a horrible revelation, another .NET bug, I think… So, this is what it was…
In a simple scenario, you bind COM event to your C# handler via += operator, for YourInterfaceVariable.EventName += New MyHandler, which seems to do the job fine.
Now consider a little more complicated scenario, where your main interface doesn’t expose events. Instead, it exposes a property of another interface, which in turn exposes events. Now, you want to attach a C# event handler to that internal interface via the property, obviously, so you give the command: VariableName.PropertyName.EventName += new MyHandler.
By all logic, this must work, and it even does, for a while, a few calls, 10-30, as all-of-a-sudden, your events stop coming in!!! You start asking yourself why, and the answer is astounding: C#/.NET doesn’t support such internal references properly, and at some point they seem to get into the automated garbage collection, or so it would seem. How do I know? That’s simple: I declared another variable of type of the internal event interface, then set it at run time, and did C# binding onto that variable instead its reference through the containing interface. And that solved the problem, the event handler no longer looses the connection.
Now how do you like THEM apples! Am I far indulging into Microsoft hatred or that’s really another screw up on their part?
Any comments are welcome.
Free C++ libraries with source code on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
can you show me an example of the same ...
i am using WWVDashboard.ocx inside my project
WWVDashboardClass dashboard = new WWVDashboardClass();
dashboard.OnGetImgPath += new WWVDashboardEvents_OnGetImgPathEventHandler(dashboard_OnGetImgPath);
// RECEIVING ERROR ON THE NEXT LINE
dashboard.OnGetpicture += new IWWVDashboardEvents_OnGetpictureEventHandler(dashboard_OnGetpicture);
dashboard.OnGetThumbInfo += new IWWVDashboardEvents_OnGetThumbInfoEventHandler(dashboard_OnGetThumbInfo);
.. also it has got several interface like
IWWVDashboardEvents_Event (internal event interface)
i had read your previous reply but
i dont know how to achieve that....please help me out.
|
|
|
|
|
Do you want to replicate the problem i had or to solve the problem?
This problem came to me a while ago, i posted it on Microsoft, they recognized the problem and said that the workaround that i came up with myself was the rigth way, which sounded kind-of bad.
Anyways, if you have a property that exposes COM events, you need to declare a global variable of the property type, then set the variable from the beginning, and only then attach events to your global variable. You cannot attach events directly to a property that exposes events, because such event attachment gets automatically garbaged by .NET after some time, so you stop receiving events permanently.
Regards,
Vitaly
|
|
|
|
|
thanks for your instant reply....
|
|
|
|
|
I have The Menu in javascript on master page
and On content pages There are drop down lists
when we extract the menus The Drop down List On Content Page
Comes Over The javascript Menu In IE no problem with mizilla
Is there any Solution....
Thanks
swapnil
|
|
|
|
|
I think you are using IE7. This type of pronle may occur in IE7. you have o change the javascript according for IE7. Run these pages on IE6.0.
help as a alias.
Be happy and make others happy.Cheer up...........
|
|
|
|
|
I'm using the GIT (in my OOP server) to hold dispatch interfaces to my clients. Occasionally the call to GetInterfaceFromGlobal() hangs. The only other time I've seen this is when I run a test client in the debugger.
So any clues as to what the client could be doing to block GetInterfaceFromGlobal()? It doesn't appear to be CPU bound but I'm guessing it's not allowing some behind-the-scenes messaging to run. It does eventually stop whatever it was doing and everything then carries on fine.
|
|
|
|
|
|
Hi,
I'm trying to run WMI queries against a server in a C# application. I'm pretty sure my code and provided DB/User/Password is ok. On the connect command the following error is raised:
"Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
<br />
ConnectionOptions oConn = new ConnectionOptions();<br />
oConn.Username = strUsername;<br />
oConn.Password = strPassword;<br />
oConn.Impersonation = ImpersonationLevel.Impersonate;<br />
<br />
System.Management.ManagementScope oMs = new System.Management.ManagementScope("\\\\domain\\servername\\root\\cimv2", oConn);<br />
<br />
oMs.Connect();<br />
I'm fairly sure its a privileges problem. I'm using a username and password that has admin privileges on the server. I've allowed remote administration and granted DCOM remote launch permissions. Any idea would be much appreciated!
thanks!
|
|
|
|
|
|
Hi All
I have to create a c++ managed wrapper class that uses System::String for an unmanaged class that uses std::string.I need to use the managed dll in C# web application.so can anybody tell me the steps or how to wrap an unmanaged class in an managed class and how to import that dll in my c# project so that i can access the functions of that dll.I m wondering for that right solution for 3 weeks.
Thank in advance
Pankaj Jain
|
|
|
|
|
Hi
I would like to create a COM which is used to generate PDF from HTML content ..
but i don't have any idea on creating com for pdf ..
can anybody give me some fundamentals of creating com for pdf ..
N.Rajakumar B.E.,
Application Developer,
|
|
|
|
|
Hi every body
I am doing a project in which I have a Windows Certificate Authority server and RADIUS server (IAS RADIUS server under windows ) . In this project the clients will login to the domain and get certificates from CA. I know this can be done through Windows configuration, but it's not good. I want to understand what is going behind, so I want to develop my own code. In brief, My question is :
I want to do certificate enrollment and request through C# program. I saw many codes in websites. They are using XENROLL.dll library to do enrollment, but I couldn't understand. Sorry I am still new in C#, so I need any tutorial or guide about this to guide me how can I do it.
I don't know from where these guys got tutorials about Certifcate enrollment, request ...... etc
It's hard to start a project on this without deep understanding of the methods used and classes.
Here is an example of the codes I found. This to give you a total figure of what I mean. Of course, this code is not complete and probably has some mistakes.
*****************************
int creationState;
string CertificateTemplate = "My Certificate Template";
string ProviderName ="Microsoft Enhanced Cryptographic Provider v1.0";
string EmailCertOID = "1.3.6.1.5.5.7.3.4" ; //Email certificate
// creating cert request:
XENROLLLib.CEnroll certEnroll = new XENROLLLib.CEnroll();
certEnroll.GenKeyFlags = 1024 * (256*256);
certEnroll.GenKeyFlags = CRYPT_EXPORTABLE;
certEnroll.UseExistingKeySet = 0;
certEnroll.ContainerName() = cert;
certEnroll.addCertTypeToRequest (CertificateTemplate);
certEnroll.ProviderName =ProviderName;
string dn = "CN="+ CommonName.Text +",E="+ Email.Text +",O="+
Organisation.Text +",L="+ Stadt.Text +",S="+ State.Text
+",C="+Countrycode.Text+"";
string req = certEnroll.createPKCS10(dn, EmailCertOID);
int CR_IN_BASE64 = 0x1;
int CR_IN_PKCS10 = 0x100;
CERTCLIENTLib.CCertRequest certRequest = new CERTCLIENTLib.CCertRequest();
creationState = certRequest.Submit(CR_IN_BASE64 | CR_IN_PKCS10, req,
"", @"Certserver\MyCertCA");
***************************************
Please Please Please if any one know something about this PLEASE AGAIN guide me. It is toooo urgent. I have just two months to submit the project.
Please I need at lease a tutorial.
Thanx to ALL
|
|
|
|