|
Please do not post the same question in multiple forums.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I've just been handed the task of replacing an existing COM component.
It has to stay as a COM component as we have no ability to change the caller.
It has to able to call a COM component, that again we can't alter. i.e. where changing the middle part of an existing process and have to do so transparently.
I've been doing some background research, and it looks like I can create a .NET COM component easy enough. I've got a few q's though.
When you create the COM interface and class they have GUID's, do these GUID's have to match the existing COM component? Or is it when the caller makes the COM call the OS determines the component based on name?
Another requirement is that the final COM call is 'dynamic' in that the method name we have to call might change, assuming the method will act on the same data is this doable?
|
|
|
|
|
To differentiate between various COM components and Interfaces, GUIDs have to be unique. They should not match other COM components.
Didn't understand your requirement of "final COM call is 'dynamic'"
|
|
|
|
|
Thanks,
Regarding the last bit, I have to call another third-party COM component. But as the third-party app might be replaced, if possible I'd like to be able to configure the name of the component and method called? (assuming the new and old method are similar in parameters etc)
|
|
|
|
|
There are two scenarios:
1. Replace the 3rd party COM component and consequently use a different COM Interface (with a different signature).
This scenario is independent of COM programming. I would use Adaptor design pattern for this problem.
2. Replace the 3rd party COM component but use same COM Interface (i.e. the Interface's GUID is same).
In this case there will be no change in your program. All you need to do is to unregister the old COM server and register the new COM server.
|
|
|
|
|
Using C++ I want to discover which interfaces can be obtained from calls to QueryInterface() off a given COM interface I didn't write in the first place.
This old and brief CodeProject article seemed to provide a solution:
How to find the name for interfaces implemented by a COM object[^]
But its code fails to find interfaces that I know to be supported for sure.
I have only superficial knowledge of COM and could use the advice of experts.
Thanks in advance.
modified 22-Oct-12 12:42pm.
|
|
|
|
|
I suppose there's no COM expert around right now
By the way:
*bump*
I still need help on this. Thanks.
|
|
|
|
|
I am trying to run a Simple CUDA program which queries the numbers of GPUs in the nodes using Open MPI v1.6.1 (64 bit) in Windows 7 Professional 64 bit Machines. When I run the application in root node, the correct GPU count is getting. But when the same application is tried to run in different nodes remotely using Open MPI, the GPU count is getting as 0, ie, it is showing as No CUDA capable GPU is present in the node.
The root and the nodes having Compute Capability 2.1 capable GPUs. I have built the code with CUDA 4.2. When a normal MPI application is running, it is working correctly.
Is there any special settings required for running a CUDA application in Windows 7 using Open MPI v1.6.1?
|
|
|
|
|
Hello,
I have a piece of software written by someone else that has a couple COM+ Applications (which seem to work properly) and they need to in some instances talk to a Desktop type app that creates a DCOM object. For some reason this works flawlessly on Windows XP but does not work on Windows 7. Again to clarify the only problem is the link between the COM+ Applicaiton and the DCOM Object the rest of the code works great.
Thanks,
|
|
|
|
|
The Desktop App references a DLL used in the COM+ application so that it can receive events from that applicaiton.
|
|
|
|
|
|
I'm investigating ways in which a COM component is exposed to the world wide web, preferably in IIS 7.
Is this an exercise in futility, or do COM developers frequently write components to be executed in a windows desktop application as well as in a web application?
Please help!!
|
|
|
|
|
gsvolt wrote: Please help
Not sure what kidn of help you are looking for.
gsvolt wrote: COM developers
I am not sure that there are anymore COM developers. But I once wrote a COM DLL that I used in an MFC desktop application that was also used in a web application if that helps.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
gsvolt wrote: I'm investigating ways in which a COM component is exposed to the world wide web, preferably in IIS 7.
..you're posting a question - there's a difference.
gsvolt wrote: Is this an exercise in futility, or do COM developers frequently write components to be executed in a windows desktop application as well as in a web application?
Though I do use COM-controls (written in .NET), they do not run on the webserver, but in the webbrowser. Meaning it has the same limitations as installed software, which has, obviously, the preference.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
hello every body
i have some dlls writen to communicate with a smart card reader.
there is a problem when i want to add this dlls as a refrence to vb.net. but with vb6 it could be imported an i saw there functions.unfortunately when i call this functions an error pups up "there is no entery point"
i tried to use dllexport app to read out some data about it.
Function Name : DllCanUnloadNow
Filename : SmartRD.dll
Type : Exported Function
==================================================
Function Name : DllGetClassObject
Type : Exported Function
==================================================
Function Name : DllRegisterServer
Type : Exported Function
==================================================
Function Name : IAcs38RD::SCConnect
Type : COM Method
==================================================
Function Name : IAcs38RD::SCDisconnect
Type : COM Method
==================================================
as you see some functions are exported functions an some com objects.what should i do to define an entery point for using this functions?
thanks
|
|
|
|
|
I found the solution.
sometimes some dlls can not be added as a refrence in a .net language but for another is possible.suppose we have a dll that written in vb6.its possible to add it as a refrence in c#.net but there is no way to add it in vb.net.
the solution is that we add dll as a refrence in C#,define a class to determine first dll functions,subs and arguments.
now we have a exported dll that is useable in any .net language.
I can read from smart card but it seems strings was combined with some salt.how can i pull out the pure string from a solution?
|
|
|
|
|
You may need to create and use a system driver, since you are trying to access hardware. Just throwing out a suggestion, that you may need to do.
Simple Thanks and Regards,
Brandon T. H.
Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst).
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
Hello
With the help of coffee and guesswork I've managed to use COM and Interop to open an Outlook .msg file and extract content from it. I have Outlook 2007 installed and I'm using Microsoft.Office.Interop.Outlook PIA runtime version 2.0.50727 (Version 14.0.0.0)
I'm using .NET 4 in a WPF application.
My problem is that my code starts an Outlook process but does not close it down afterwards. If I am already running Outlook, my code seems to attach to that process rather than start another one and if outlook is already running, my app.Quit() message closes the existing Outlook application (not the process.)
My question is am I going about this in the wrong way? I've read lots of posts about using Outlook but nothing that describes with authority how I should cleanly open, interrogate and close an outlook message.
Here's the code:
public override void ViewContent(string strFilePath)
{
base.ViewContent(strFilePath);
Microsoft.Office.Interop.Outlook.Application app = null;
Microsoft.Office.Interop.Outlook.NameSpace session = null;
Microsoft.Office.Interop.Outlook.MailItem item = null;
try
{
app = new Microsoft.Office.Interop.Outlook.Application();
session = app.Session;
item = session.OpenSharedItem(strFilePath) as Microsoft.Office.Interop.Outlook.MailItem;
if(item != null)
{
Subject = item.Subject;
From = item.SenderName;
if(string.IsNullOrEmpty(item.SenderEmailAddress) == false)
From += "{" + item.SenderEmailAddress + "}";
MessageText = item.Body;
item.Unload += new ItemEvents_10_UnloadEventHandler(item_Unload);
item.Close(OlInspectorClose.olDiscard);
}
app.Quit();
}
catch(Exception)
{
}
finally
{
if(item != null)
System.Runtime.InteropServices.Marshal.ReleaseComObject(item);
if(session != null)
System.Runtime.InteropServices.Marshal.ReleaseComObject(session);
if(app != null)
System.Runtime.InteropServices.Marshal.ReleaseComObject(app);
item = null;
session = null;
app = null;
}
}
Is this the right way to use COM and Interop? Does anyone have any pointers for me or a guide showing best practices? I'm new to COM so if anyone thinks my code is going to leak or use up handles or some other horror please let me know.
Thanks all,
Keith
|
|
|
|
|
So, I had asked the question in the subject itself: Is COM an 'outdated' technology?
If it is, what are the technologies that replace COM? And how?
If it is not, why such an old technology is still there? (I understand the basic design of COM and I understand why it was needed back then.)
I am hoping to see a discussion emerging about this, in the hope that I will be able to learn a lot.
|
|
|
|
|
krumia wrote: I am hoping to see a discussion emerging about this,
This forum is not the place for discussions, it's for technical questions; try the Lounge.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I thought of posting this in the lounge, but all the same this is where most the COM experts gather, I suppose.
I have asked what I felt as a technical question anyway: Is COM an 'outdated' technology?
having asked the technical question in the technical forum, I don't think 'hoping to see a discussion' is a sin. After all, the boundary between question-answer session and discussion is unclear.
Anyway, I will re-post this in the lounge. Thanks for the hint.
|
|
|
|
|
krumia wrote: I have asked what I felt as a technical question anyway: Is COM an 'outdated' technology?
No, you have asked a philosophical question, there is nothing technical about it. You are asking people to give their opinions on something; opinions that will vary widely based on their own assumptions and possibly even prejudices.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Richard MacCutchan wrote: This forum is not the place for discussions
err, umm "Home Articles Quick Answers Discussions Learning Zones Features Help! The Lounge
|
|
|
|
|
OK, let's count the number of people who responded to this call for a discussion here.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
It amazes me how many people attempt to use redirection instead of acknowledging that someone elses point was valid. At this point in time, the tab above for this forum is titled "Discussions". You were wrong. Just admit it. 
|
|
|
|