|
Hi,
I have a COM component written in .Net and hosted in a COM+ server application so that only 1 instance of the component will exist on a box at a given time. Multiple different applications will be accessing the COM component: Matlab, VB Script, .Net application, etc...
When the COM component is instantiated from VB Script or Matlab, I can see the COM+ server starting properly and can verify that only 1 instance of my object is created.
My problem arises when the COM component consumer is a .Net application. Basically, it seems .Net always resolves the location of the DLL and since it is a .Net DLL, always instantiate the object directly, skipping the COM+ mechanism. It seems obvious why .Net behaves that way to get rid of COM overhead, but this is causing problems in my design since I want only 1 instance of my COM Component to exist on a box at one time.
So the question is how can I instantiate a .Net based COM component hosted in a COM+ server application from a .Net application by using the COM+ mechanism?
Thanks
|
|
|
|
|
I have written a custom tool.
It generates a dll that I then have to manually register with gacutil, regasm, and add a key to the registry.
I'd like to be able to distribute this with a setup project.
Unfortunately I can't seem to get a setup project created to install this.
Has anyone here done this before? Or know of an article explaining how to do it?
Thanks,
-C
|
|
|
|
|
I am a newby to COM (ActiveX) Programming and i have a problem regarding a activex control created with the MFC Wizard.
This activex control is derived from a static control and is used to draw diagramms. The drawing of the diagrams itself is working fine. The control evaluates some mouse events (LButtonDown, LButtonUp, MouseMove) to draw extra lines or rectangles to the control.
When using the activex control in the ActiveX Testcontainer the drawing regarding to mouse events is working fine, but if i include the activex control to a dialog based application the control does not respond to any mouse event when clicking or moving the mouse over the control.
How can i setup the activex control in the dialog so that it responds to mouse events or is the problem part of the activex control itself.
Thanks in advance
|
|
|
|
|
override PreTranslateMessage in the dialog, and provide these messages to your ActiveX.
Greetings from Germany
|
|
|
|
|
I tried it but it is still not working
Best regards
|
|
|
|
|
Try to set the Control Parent property of the Dialog to true.
«_Superman_»
|
|
|
|
|
Hi all,
Is anyone aware of why some of the events in PowerPoint do not fire.
The WindowBeforeRightClick in particular is the one I wish to trap so that I can prevent the right click menu from appearing.
I'm using Office 2000.
Thanks
Cheers
Tom
Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
|
|
|
|
|
Hello all:
At first , I make a ocx control which build a SSL connection by OpenSSL ,and then ,I want IE can share this connection ,which means that IE do not need SSL authentication again ,so IE can connect the WEB server on the SSL tunnel.
Now,SSL connection is built by OpenSSL. But ,I do not know IE how to share the SSL connection.
Any hits is welcomed !
Thank you very much!
|
|
|
|
|
|
Hello Garth J Lancaster:
Thank you for your rely firstly.
But, I have built a SSL connection using OpenSSL. And I put this function in a ocx control ,then put this control into Web page . After connecting the WEB server by this control ,I want that IE can keep this connection(SSL tunnel), and keep accessing the WEB server by this connection.
Now, I do not know how to keep this connection ,which is built by myself in IE.
Ssl proxy maybe is not my need ,because I want to implement this function by myself,not third-part software.
Thank you all the same.
Any other hits ?
Lampa
|
|
|
|
|
I wasnt suggesting you buy/purchase the product, it was for the 'idea'. I dont think you're going to be able to 'replace' the SSL functionality in IE or the IE Control (I seem to remember there being such an object) .. ergo you're going to need to tunnel/proxy using your OCX
If its the wrong idea, 'good luck and keep looking'
'g'
|
|
|
|
|
Thank you for your reply.
I understand what your mean. and I will find out this answer.
PS, i have another question: when I build the SSL connection by IE ,Then ,I click the superlink ,which forward to another web page .why not need to SSL authentication again in this way. Do you know what happened ?
Thank you !
Lampa
|
|
|
|
|
Hi all,
I'm automating Excel from within an ActiveX control and I'm wondering if anyone knows how to highlight the contents of a cell.
I'm writing a specialised search routine and I have no problem finding the cells I want but when I select them only the perimeter of the cell gets highlighted. I'm after being able to highlight the contents but haven't found what I need in the type library. Recording a macro didn't throw any light on the issue either.
Thanks in advance for any ideas.
Cheers
Tom
Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
|
|
|
|
|
there's some code following from a MS MFC example : Look at excelApp.GetRange(COleVariant("A1"),COleVariant("C6")).Select();
does that help ?
'g'
#include "excel8.h"
// ...
OleVariant covTrue((short)TRUE), covFalse((short)FALSE), covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
_Application excelApp;
if(!excelApp.CreateDispatch("Excel.Application"))
{
// error handling
}
excelApp.GetWorkbooks().Add(covOptional);
excelApp.GetRange(COleVariant("A1"),COleVariant("C6")).Select();
excelApp.GetActiveCell().SetFormula("Hello World!");
excelApp.SetVisible(TRUE);
|
|
|
|
|
Thanks for the response.
Adding text as you have done seems to change it somewhat. Unfortunately, I'm dealing with read only files and as such I'm only trying to highlight what's already present. The call to Select() doesn't highlight the content, only the outline of the cell
Thanks though
Cheers
Tom
Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
|
|
|
|
|
Hi,
In my application i am using ActiveX control(creted by .net2.0) to capture PrintScreen image.
when i am using it through http://localhost it gives error
Request for the permission of type ‘System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ failed
But when i run same page by using computer name its work i.e.
http://computername/Applicationname/xyz.aspx
How to give permission for activeX.
Thanks in advance.
|
|
|
|
|
hemant.kaushal wrote: How to give permission for activeX.
Use DCOM config admistrative utility.
|
|
|
|
|
is anybody know how to create a COM wrapper around the C# class.
Please let me know full tutorial or any links having relevanmt information
Thanks in advance
Datta
|
|
|
|
|
You should read the documentation that comes with your compiler. There's tons of material on NET and COM Interop.
Over at MSDN: Exposing .NET Framework Components to COM[^] is as good a place to start as any.
Another reference is: How to Create COM Wrappers[^].
I've read that you can do this with your source code, but, it is an extremely error prone process, as .NET types don't always map unambiguously to COM types.
|
|
|
|
|
This is a question to all you old school folks.
When I create a dll in VS 2005 and mark the option to register it for com interop and then build the project, I get the usual dll but I also get a tlb (type library) file in the output folder. I know what a tlb file is and what it contains but what I don't understand is what the relation is between the outputted dll and tlb. Can you use the tlb and dll separately in a COM-based application or are they connected and meant to be used together?
|
|
|
|
|
TLB contains only the declarations.
DLL contains definitions or implementations.
TLB is enough to create wrappers.
But when the wrappers are actually called, it will call into the DLL.
« Superman »
|
|
|
|
|
Thank you so much for your answer Santosh!
There is another thing I wonder also. When you build COM interoperated dlls and let VS do the work, is the tlb then usually embedded into the dll so that you can call the dll directly without having to go through the tlb?
|
|
|
|
|
That is correct.
VS embeds the type library within the DLL by default.
You can change that by removing the TYPELIB from the .rc file.
« Superman »
|
|
|
|
|
Thats why #import "XYZ.dll" regularly works. I use this sometimes to COM interop with MS-dll, ie msxml6.dll.
Greetings from Germany
|
|
|
|
|
Hi All,
Has anyone any idea on using the office web components for reporting.
I am trying to use it by giving reference in the .net web application, but none of the component is appearing on toolbox.
Do I need office 2000 installed on my machine?
I have OFFICE WEB COMPONENT 11 installed.
Please help!!
Thanks
|
|
|
|