|
Hello Tech people,
Can any one tell me how to create the COM+ components using C#.NET. I wanted to learn about the interface design and deploy the components using C#.NET.
Please let me know, if any one find any kind of material like Gopalan Suresh Raj's website, ie.,
http://gsraj.tripod.com/dotnet/complus/complus.net_accountmanager.html
As a matter of fact, this page it self has some errors. I tried to mail the author from his mail id, but there is no response...
If you come across any of such kind, pl send me the link at my mail id.
You can reach me at SIMIBOLD@YAHOO.COM or SIMIBOLD@HOTMAIL.COM
Thanks,
Simi Agarwal
|
|
|
|
|
I want to develop an word add-in to catch the mouse event of the Word
and determin if the mouse is over some sepecified word or chart,
if true,process it by my own code and the word it's self will not receive the mouse event.
if false,trans the mouse event to the Word
How can I do?
I found all of the Word VBA,and it does not provide the mouse event.
|
|
|
|
|
Hi all,
I m working on designing a Automation Testing tool. I am using MS Active Accessibility for it. I have written some code, with which I can work with windows objects (like search window). I can get and set the text properties, click buttons. But I tried to do the same thing with a C# winForm, but it din't worked.
I am sure that the program is not getting access to objects on the winForm. But I cannot understand why it is working with standays windows objects and not winForms.
any help will be greatly appreciated.
|
|
|
|
|
Hi guys,
I have a question about COM. Do someone know how to use COM to create functions for Excel directly, that is to say without encapsulating in vba. I explain what I want to say!! I have coded an ActiveX dll with a COM object inside. I have added methods to my COM object and then I have registered the dll. When I open Excel I create a new module in vba and I can access my methods and create functions calling the methods. But I have some stability problems with MAJ+F9. So I want to create a COM object so that when I open my Excel I can access directly my C++ functions.
P.S.: I code with Borland C++ Builder 5.0 and C++ BuilderX.
|
|
|
|
|
Hi everybody
I have a COM object that has 1 method and it is dual interface written with VC++ 6.0. Is there a way to access it from a C program?
Thank you for your time
Spiros Prantalos
Miami the place to be!!
|
|
|
|
|
I assume you have the IDL file which defines your interface? Or even better, the header file produced by midl.exe? If you don't have the header file, just run midl.exe on the idl file and it'll produce it for you.
Anyway, this midl generated header file contains macros which will ease your burden on calling the COM object in C. (Just look at it and you'll figure it out)
--
Sancte Míchael Archángele, defénde nos in proélio contra nequítiam et
insídias diáboli esto præsídium. Imperet illi Deus, súpplices deprecámur:
tuque, princeps milítiæ cæléstis, Sátanam aliósque spíritus malígnos, qui
ad perditiónem animárum pervagántur in mundo, divína virtúte,
In inférnum detrude. Amen.
|
|
|
|
|
Hi, I'm new to COM and .NET, and this is a fairly advanced question. So please be kind
I have an application written in VB6 that does some database stuff. There isn't time, yet, to rewrite it all in .NET. So we are hoping to rewrite the UI in .net and use the data manipulation core via COM interop. We have been trying to use the EXE file as the COM server, rather than expose a DLL. VS.NET 2003 has imported the exe file happily and we can call some simple functions fine.
However, the COM server uses ADODB and, in particular, it is necessary to read from ADO recorsdets created in the COM code and display them in a .NET datagrid. I understand the thing to do is use the OleDbDataAdapter. When I try this, I get a runtime error:
Except: Object is not an ADODB.Recordset or an ADODB.Record.
Parameter name: adodb
Specified cast is not valid.
at System.Data.OleDb.OleDbDataAdapter.FillFromADODB(Object data, Object adodb, String srcTable, Boolean multipleResults)
at System.Data.OleDb.OleDbDataAdapter.Fill(DataSet dataSet, Object ADODBRecordSet, String srcTable)
at MyApp.Main.SetDataFolder(String DocFolder, String withFilter) in Main.vb:line 1303
I don't understand why!
I have tried using both the ActiveX and the PIA ADODB references, and have tried using the various ADODB types for recordset (there are 3 - Recordset, RecordsetClass and _Recordset); nothing helps. The only thing that did help was creating the RS within .NET land, which worked fine but doesn't help us.
The relevant code is:
Dim FolderRecordSet As ADODB.Recordset
...
FolderRecordSet = EFClient.GTCodingUpdate.FolderRS
Dim ds As DataSet = New DataSet
Try
DocumentDataAdapter.Fill(ds, FolderRecordSet, "Documents")
DataGrid.SetDataBinding(ds, "Documents")
Catch e As OleDb.OleDbException
MsgBox("OleDb: " & e.Message & vbCrLf & e.InnerException.Message & vbCrLf & e.StackTrace)
Catch e As Exception
MsgBox("Except: " & e.Message & vbCrLf & e.InnerException.Message & vbCrLf & e.StackTrace)
End Try
|
|
|
|
|
guys..
any body done menu merging for an inplace active control?
|
|
|
|
|
hi there..
Thanks for the time firstly..
I wanted to know how can u add a shared menu to your active x control..also do we need to attach a verb to be able to use Shared Menus?
kind regards
safee
|
|
|
|
|
Hi,
I hosted a .Net control in an ActiveX control, and the accelerators and the tabbing are not working anymore. Any ideas how to fix this?
Thanks
|
|
|
|
|
Hi,
I´m catching Outlook Events by using the connectin points of the DispInterface.
It all works great, but when there is only on item, for example the last contact, in the folder contact, the event handler doesen´t fire.
What´s the problem and is there any solution known ?
My second question: The event handler does only catch Events for the TopLevel Folders such as Inbox ...
When the user created a subfolder under the inbox the event handler
does not fire.
Can someone pleas help me ?
Thanks a lot, Chris
|
|
|
|
|
I'm working on a project that implements Store Events for Microsoft Exchange server. The result is a DLL project with ATL and MFC support made in
Visual C++ .NET 2003.
Because the Microsoft Exchange events doesn’t have support for managed code the application code is unmanaged . This application for listening the events must be registered in Component Services according to MSDN examples.
I registered the dll manually in Component Services , I tested it and it works, but I want to make a setup for this application and here I have two problems:
The first problem is that I didn’t succeed to add the COM application in component services automatic from setup without doing this manually.
The second problem is that using MsiOpenPackage I
must give the absolute path where the msi file is, and I want to set a relative path or if I am using MsiOpenProduct in an application that is added at Custom Action Editor ->install is returning following error: ERROR_UNKNOWN_PRODUCT.
Alin Ilie
Software Developer
BluePhoenix Solutions
|
|
|
|
|
Hi all,
I dont know a lot about COM or DLLs but i am developing a DLL and want to get some thing done.
I am developing a DLL in Visual C++, which i eventally want to use in VB..
I want the VB application to know of some events occuring in a DLL. For example progress of a function in DLL being sent back to the application for showing log or progress bar or anything like that.
Can any one tell me how to do it.. any starting points, any clues would be great as well
Kind Regards
Siddique Ahmed
Senior Software Engineer
Telelogix Software
(www.telelogix.com)
|
|
|
|
|
Hi there,
It is really very easy to implement events in your COM DLL.
whenever u insert any ATL object in your ATL project, using ATL Object Wizard.
ATL Object Wizard property box pop ups, go to attribute tab and select the check box "Support connection points"
this will create an dispinterface which can contain ur event methods.
now u have to simply add method in this interface. compile ur code . and then in class view select ur class which is going to implement this evennt interface, right click on it and add implement Connection point. a dialog box will pou up , select that event interface and click OK.
Now just fire this event method from ur code.
In ur VB client when just select ur Dll object .
and it will list out all event methods implemented by ur dll Object.
u can simply slect those event method and can code whatever u like.
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
Hi,
I'm new to COM tech. My few COM experiences are just a few OLE Automation samples in MFC. But now I have a Project that will require me calling an object mtd across machine boundary.
Can I achieve this in MFC 7.0? If yes how?
Thanks in advance!;)
What would life be without programmers and salesmen?
|
|
|
|
|
I recommend this book if you want to really develop COM servers.
Developer's Workshop to COM and ATL 3.0 by Andrew Troelsen
Kuphryn
|
|
|
|
|
Before I self inflict an almost certainly painful COM education, I was hoping to get some opinions on the vitality of COM. Has COM seen it's glory days, or is it a technology still worth learning inside & out?
Thanks for your ideas,
Paul
|
|
|
|
|
It's still worth learning. If you're thinking of .NET, .NET is not a replacement for COM - merely an evolution of it. In fact, the CLR (Common Language Runtime) uses some COM technologies to make everything work and interop in a good manner.
Also, many applications for Windows - including parts of Windows itself, like the shell - are written in COM. To make shell extensions - at least until Longhorn (and that's still a long way away, so who knows how it'll change) - you still need to use COM. Even using automation (runtime discovery) with Office, VBA, and scripting technologies (like the Windows Script Host, or even DHTML-scripting) uses COM and understanding what happens behind the scenes helps with that automation (but isn't required). If you want to add scripting capabilities to your application or to use embedding (OLE), you need to know COM.
It's all over, and, IMHO, it's definitely worth learning. Just stock up on asperin!
-----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,
I am well done by responding COM events with simple data types( say VTS_I4). However, on topic that is not covered anywhere (and I spent days looking) is when the event has a COM object as a parameter. Say for instance in your sample that the addition is not on 2 integers but on 2 matrixes. The OnAdditionDone event would therefore pass a IMatrix * obj (VT_DISPATCH) pointer instead of an integer (VT_I4).
How would you implement the event handler on the client side, and how would you actually start using the IMatrix pointer to access its members (tried everything I could think of, wither it doesn't compile or compiles but crashes, always get the 'first chance exception (OLEAUT32.DLL): 0xC0000005: Access Violation.). In other words, how to complete this:
void CCoCaller::OnAdditionDone(IMatrix *result)
{
// How to implement this so that it works:
BSTR str; result->get_Name(str);
}
MSDN gives 2 samples on how to implement IDispEventSimpleImpl and IDispEventImpl using Word and Excel veents, none of them show events that pass COM objects as parameters.
Any help would be very useful. Thanks a lot
|
|
|
|
|
Hi there ,
once i have tried the same also..and it worked fine.
Suppose i have to pass IInterface instance to the client thru a Event method ThrowInter(IInterface *iFace)
this is the code where i fired this event and passed the IInterface pointer.
IInterface *iFace;
CoCreateInstance(CLSID_Interface, NULL, CLSCTX_ALL, IID_IInterface, (void **) &iFace);
Fire_ThrowInter(iFace);
Now this is my client code where i caught the fired event and IInterface instance
void CContainerDlgDlg::OnThrowInterTinterface1(LPDISPATCH interfac)
{
IInterface *iFace=reinterpret_cast<iinterface *="">(interfac);
iFace->ShowMessage();
}
but in client i have to include the header file of IInterface.
and then simply reinterpret casting , i was able to access my IInterface methods and properties
let me know if u r also doing the same
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
You really shouldn't do that, it's the kind of thing that gives COM a bad name. Better would be to get an IDispatch from the object and fire that, then use QueryInterface at the client end, or use IUnknown and do the same.
If you remote (out of proc or off-machine) interfaces, then there is postively absolutely NO guarantee that your cast is safe, since a proxy/stub may well have only the same number of methods available in an IDispatch interface, and the rest of your interface's function table may/will be inadmissible.
Steve S
|
|
|
|
|
The key is I do not have the source code for the COM nor the header though. So I cannot include the header. Thanks for your suggestions anyway.
|
|
|
|
|
Thanks so much, Abhishek!
I got it done, the trick is I need to declare the LPDISPATCH and convert to my desired COM refrence type explicitly. However, I declare the handler function the same as what is described in .tlh!
I want to correct is that you don t have to get the COM header, what you need is simply import the dll and use the smart pointer.
|
|
|
|
|
I think that you should write
BSTR str;<br />
result->get_Name( & str );
Or better
CComBSTR str;<br />
result->get_Name( & str );
With best wishes,
Vita
|
|
|
|
|
Hello
We have a big problem with our System.
We developed a Web-Side with IIS and ASP and a Automation-Dll(COM) written in MFC 7.0. A User can login and the ASP creates the COM-Object in the ASP-Session-object. All Information are stored in the Com-Object. It's installed as in-Process and the COM-Object is set to Neutral-Threadingmodel.
Now, when the COM-Object crash, sometimes the IIS restarts and all User have to login again. Sometimes the IIS can't restart and we have to restart the W2k Server.
I changed the settings in the IIS to Out-Process (so it isn't in the same memory) but nevertheless the IIS restart on any COM-Object-Crash.
What is the best way to develope a big existing MFC-Application to a COM-Object and using it as a WEB-Application with ASP. There are about 100 USer in the same time online....
Volker
|
|
|
|
|