|
Ray Cassick wrote:
It's either that or he is trying to write a custom GINA.
Hadn't thought of that. Fair point.
Ray Cassick wrote:
Not sure if you can do that with a .NET DLL really
Might be asking a bit too much of C# but MC++ should be capable. That said, if you can do windows hooking then like you say, why not?
I dunno. I've never written a GINA; I know a bit about it from one of the products we resell (and thus I write an installer for) but beyond that I'm out of my depth.
Paul
|
|
|
|
|
There's a really interesting article in the latest issue of MSDN Magazine about Windows Hooking in C#. It was written by Dino Esposito, another of the C# gurus.
http://msdn.microsoft.com/msdnmag/issues/02/10/CuttingEdge/default.aspx[^]
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
Don't crosspost, people don't like that...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I'm loading an assembly and then invoking it, which I have no problem doing. However I would like to put some security into it. I use the .NET Permissions but however the assembly can assert those restrictions.
How do I invoke an assembly that I don't trust with it destroying my machine?
Bob
|
|
|
|
|
sir i want to ask that how to halt mouse and key board what is procedure and what the functions are used and if u plz write some code
thanks
r00d0034@yahoo.com
|
|
|
|
|
I've got an application to which I'm looking to add some new functionality to.
I'd LOVE to be able to offer these new functional components as "add-in" modules (similar to the add-ins in VisualStudio).
Does anyone have any advice or a suggested place to start looking for some resources on how to tackle this sort of "modular @ runtime" type of thing.
I've got NO idea on where to begin, and any poke in the right direction would be fantastic.
TIA.
Mike Stanbrook
mstanbrook@yahoo.com
|
|
|
|
|
How tightly coupled do you want the add-ins? Photoshop, I believe, uses a type of plug-in where, if a function (filter, in this case) in the right folder on startup, it is made available to the app. But I don't know what kind of internal interface it uses.
|
|
|
|
|
Good question.
What I was "visualizing" was this:
Our application has an MSOutlook-style bar, with an icon for each of the current (4) modules that are included in the application.
Ultimate Goal:
Upon deployment of an additional "module" (which will preferably be just copying some new dll's into the bin dir) and some potential "configuration" settings updates, the icons representing the new "modules" will appear in the OUtlook toolbar, and call functionality contained within the new dlls that were deployed.
Clear as mud right?
Mike Stanbrook
mstanbrook@yahoo.com
|
|
|
|
|
No in fact. That's quite clear. You are going to want to look into the System.Reflection namespace. That's where you can load an assembly into memory dynamically. As long as all your "modules" implement a common public interface, then you can just iterate through all the files in the bin directory and then load them using reflection.
I hope that helps. Inside C# has a really good chapter on reflection and is my all around reference manual for C#. I would highly recommend getting that and working through the examples.
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
This article may be of some assistance. Please not the URL wrap
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp06102002.asp
|
|
|
|
|
|
A simple .config file would probably do as great. I would keep Reflection for features really requiring compiling while running, which is way beyond the static plugins you pictured.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Interesting idea.
Do you have a suggestion on how to handle separate GUI components for each of the plugins?
Mike Stanbrook
mstanbrook@yahoo.com
|
|
|
|
|
HI MStanbrook
Have a look at my IRC client I wrote a while back. http://myrc.sourceforge.net[^]. It has complete support for plugins, UI the lot. My help you what Eric meant in the port below. Just Remeber the interface is the most important part. I had made several interfaces , so some plugins can have a GUI and/or Menus or nothing at all.
I must admit that was my 1st biggish C# project so some of the coding is shocking, but for you to see how I have done , it will suffice.
Hope it helps
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
How difficult this is depends upon what your requirements are.
If you want to just load add-ins at runtime, it's quite simple.
1) Define the interface you want an add-in to implement, and compile it to a .dll
2) Create a directory for add-ins off of the directory where the .exe lives
3) In the main exe, use Assembly.Load() to load in the assembly4)
4) Use reflection to find the types in it that implement your assembly
5) Use activator.CreateInstance() to create the instance
6) Cast it to your interface, and then go to town.
If you want to be able to update them on the fly, that gets more complicated. Look at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp05162002.asp
for more information.
|
|
|
|
|
Eric Gunnerson (msft) wrote:
If you want to be able to update them on the fly, that gets more complicated. Look at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp05162002.asp
Great article. It's a bit out of my realm for now, but looks like some interesting ideas to keep in mind while getting me feet wet!
Thanks.
Mike Stanbrook
mstanbrook@yahoo.com
|
|
|
|
|
I need two slightly different actions if I'm in design mode or if I'm running the actual program.
Is there a function to determine that?
|
|
|
|
|
if (this.DesignMode) ?
Paul
|
|
|
|
|
hahaha... I tried IsDesignMode, GetDesignMode ... I got to start thinking like .NET more.
Thanks bro!
|
|
|
|
|
Hi!
I need some programming examples about programming MS Exchange server 5.5.
Also wonder if I Can I use ADSI for this purpose?
I’m using C# ASP .Net.
Thanks
/Ola Carlsson
|
|
|
|
|
|
The trouble is that Exchange 5.5 is regarded by MS as legacy, and MSDN itself now almost only references Exchange 2000[^]+ articles. I guess you need older MSDN.
I would use CDO[^] objects (they exist prior Exchange 2000) or DAO depending on what you like. In fact, you have a couple of COM objects that you just reference in your ASP.NET project before start using them.
For ActiveDirectory, that's the same. There's a bunch of ADSI COM objects.
Good luck!
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Hi,
I am trying convert following VB Code to c#.
VB CODE
--------------
Set oLogonCtrl = CreateObject("SAP.Logoncontrol.1")
Set oBAPICtrl.Connection = oLogonCtrl.NewConnection
oBAPICtrl.Connection.System = "00"
oBAPICtrl.Connection.MessageServer = txtSysMessageServer
oBAPICtrl.Connection.GroupName = txtSysGroupName
C# CODE
________
SAPBAPIControlLib.SAPBAPIControl oBapiControl=new SAPBAPIControlLib.SAPBAPIControl();
SAPLogonCtrl.SAPLogonControl oLogonCtrl=new SAPLogonCtrl.SAPLogonControl();
oBapiControl.Connection=oLogonCtrl.NewConnection();
oBapiControl.Connection.System="00";
The SAPBAPIControl is a COM control I am using in C#. In visual
Studio I am referencing this and VS creates wrapper for the COM
control.
Till oBapiControl.Connection=oLogonCtrl.NewConnection() I have
no problem. But when I try oBapiControl.Connection.System="00"
I get message "'object' does not contain a definition for 'System'".
Any Ideas why this must be happening ?
Thanks in Advance
Ravi H R
|
|
|
|
|
Looks like the System property is badly interoped.
I guess all problems you have are at compiling-time. You haven't run anything yet ?
You have probably dropped the SAP control from the toolbox to your Form (or you have added a reference by browsing the actual dll/exe COM object). Let's make sure the signature is right :
- using intellisense, what's brought to you when you type oBapiControl.Connection. ? Is there any System property available ?
- does it change if you add a using SAPBAPIControlLib; statement ?
- when adding a reference from a COM object, the IDE automatically imports the type-library. In addition, if this control is an ActiveX, it creates an interop ActiveX layer as well. Those 2 files are in the /obj directory. It may be useful to have a look inside, using a disassembler such like Anakrino[^].
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Thanks for your response Stephene,
First When I type oBapiControl.Connection. I see following
methods "Equals","GetHashCode","GetType" and "ToString".
I donot see any other properties or methods.
I added the control through Project-> Add reference->COM. I could see the control here. When I selected the component,
I got message "Couldnot find primary interop assembly...
would you like to have a wrapper generated ?" I said yes.
After this I could see the components is solutions explorer(SE). I saw additional thing in SE by name "stdole".
Using SAPBAPIControlLib didnot have any effect.
I see 2 dlls in obj folder "Interop.SAPBAPIControlLib_1_2.dll" and "Interop.SAPLogonCtrl_1_1.dll"
what could be wrong ?
I will wait for your response
Thanks & Regards
Ravi H R
|
|
|
|