|
Is it possible to get the write speeds supported by a drive (media device) using IMAPI interfaces. I have tried with the "get_SupportedWriteSpeeds" and "get_SupportedWriteSpeedDescriptors" API's of "IDiscFormat2Data" inteface. But both of them returns speeds specific to a media (CDR / DVD-R etc) inserted.
SKMukherjee
|
|
|
|
|
Hi Experts,
I am new to COM programming. (Component Object Model.)
After learning some theory behind COM, I am wondering
Why COM when every thing is possible using DLLs which exports C++ classes.
Or
What is possible only in COM and not possible in C++ DLLs.
Could anyone explain?
Thanks in advance
cheers
Varghese Paul
|
|
|
|
|
Hi there. This article might be useful I believe. What you suggest is treated in the "C++ Naive Approach: Exporting a Class" section, whereas the COM approach is similar to the described in the "C++ Mature Approach: Using an Abstract Interface" section.
In short, there are many problems with simply exporting classes from a DLL. If you change a dependency, most likely you'll have to recompile them all. You have to have the same compiler and even compile with the same settings. A nightmare if you're planning on distributing your components to other people.
Cheers.
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
If you can get a copy of Don Box's "Essential COM", I would recommend it. It explains the evolution of COM clearly and thoroughly (but, it's fairly abstract reading).
There are two basic concepts that are the core of COM:
(1) COM objects are binary-compatible with COM objects and methods written in any other programming language (the compiler vendor implements this feature). This means that you can call CoCreateInstance for any existing, valid COM object (written in any language) and use an instance of that COM object and its methods in an your external program, just by linking to the existing DLL.
(2) COM Interfaces cannot be altered once they are published. This is an attempt to eliminate what is known as "DLL Hell". This occurs when a COM component is re-written and re-compiled, changing some signatures of object method calls and causing existing compiled clients that utilize these new methods to fail when a type or method executes with an incorrect memory allocation.
There is A Huge Number of Excellent COM Tutorials Right Here at CodeProject[^]
An Excellent Two-Part Beginner Tutorial Series about COM is Introduction to COM, What It Is and How To Use It[^] and Part Two, Behind The Scenes of a COM Server[^], by Michael Dunn is a good place to start.
|
|
|
|
|
This may not be the correct place to ask this but I have a third party dll file that was created for VB6 (The examples you can download are for VB6). Is there any way to update this file to work with Visual Studio 2002? The dll holds the functions to talk to the third party device. Thank you
<edit> I talked with someone at the company and they had given me the VB6 version not the VS version.
If you can’t have fun at work, then why go to work?
modified on Friday, December 12, 2008 10:10 AM
|
|
|
|
|
It's difficult to try to imagine what it is that you are actually trying to do. Are you asking if Visual Studio is capable of disassembling a compiled DLL and altering it (to what specifications?), or, are you asking if you can somehow link to the compiled DLL and use it for your nefarious purposes? OK, I'm kidding,...but, you should elaborate a little about what it is you are actually attempting to do.
...and, what do you mean by "dll not recognized"?
Suggestion: use Dumpbin to determine what functions the DLL exports,...that's probably what you want to know, if you are attempting to use the functionality of your third party DLL.
|
|
|
|
|
I should have edited the message. I finally got a hold of someone at the company that understood what was going on. The dll I was told to use was for VB6 and not VS. They were able to point me to the correct dll. Thank you for taking the time to answer.
If you can’t have fun at work, then why go to work?
|
|
|
|
|
Hi,
If you have Third party COM which is developed in VB6, and you wanted to use this COM in Visual Studio then you need proxy to use Unmanged COM. In .Net there is Runtime callable wrapper (RCW) use to access any unmanaged COM into .Net platform. There is an exe (tlbimp.exe)in .net command prompt to import any unmanaged COM into Managed COM.
Ali Zishan
London
|
|
|
|
|
Hi all,
I am trying to build an application for Windows CE 5.0 device, using PI method to work with the unmanaged library here, the code written for regular windows application works fine but when the same code is used for Windows CE 5.0 device application i am getting an compiler error say
'System.Runtime.InteropServices.Marshal' does not contain a definition for 'StringToHGlobalAnsi'
Can anybody help me in resolving this problem. Also is there any alternative way like MarshalAs attribute to achieve the same.
Regards,
Geetha
|
|
|
|
|
How does one use ActiveX Controls across multiple threads in MFC?
I always seem to fail on the ASSERT(m_pCtrlSite != NULL) in CWnd::InvokeHelper. What steps must be followed before I can use the control correctly?
Thanks much,
Mike
|
|
|
|
|
Hi !
I have written a dll to set static ip address using wmi. i am using visual studio 2005 SP1 on windows server 2003 SP2. i have also written a server and client. the server links to the dll to provide the service for the client. when the client asks to set an ip for the first time...the code works fine...but the second time it crashes showing up an access violation error. I have posted the call stack below...pls help me in this regard ! thank you !
ole32.dll!CCache::GetElement() + 0xb2 bytes
ole32.dll!CComCatalog::GetClassInfoInternal() + 0xfd bytes
ole32.dll!CComCatalog::GetClassInfoW() + 0x22 bytes
ole32.dll!GetClassInfoFromClsid() + 0x2d bytes
ole32.dll!LookForConfiguredClsid() + 0x2f bytes
ole32.dll!ICoCreateInstanceEx() + 0xae bytes
ole32.dll!CComActivator::DoCreateInstance() + 0x2f bytes
ole32.dll!_CoCreateInstanceEx@24() + 0x23 bytes
ole32.dll!_CoCreateInstance@20() + 0x39 bytes
0112a6fa()
ntdll.dll!_RtlAllocateHeap@12() + 0xe2 bytes
ntdll.dll!_RtlpCoalesceFreeBlocks@16() + 0x96 bytes
010cef10()
ntdll.dll!_RtlAllocateHeap@12() + 0x50b bytes
ntdll.dll!_RtlEncodeSystemPointer@4() - 0xd7dc bytes
ntdll.dll!_RtlValidateUnicodeString@8() + 0x60 bytes
|
|
|
|
|
I inadvertently found the same post at Egghead Cafe[^] when GOOGLING, as I had never heard of your problem before. Your other post is much more descriptive, you state "Some times i also run into stack overflow and heap corruption exceptions. These errors occur in the IPHLPAPI function call getadaptersinfo() or getadaptersaddresses().
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at GetAdaptersAddresses(UInt32 , UInt32 , Void* , _IP_ADAPTER_ADDRESSES_LH* , UInt32* )"
When i GOOGLED GetAdaptersAddresses Function (MSDN)[^], I noticed this information: "Note that it is possible for the buffer size required for the IP_ADAPTER_ADDRESSES structures pointed to by the AdapterAddresses parameter to change between subsequent calls to the GetAdaptersAddresses function if an adapter address is added or removed." I would think that if you are using EXACTLY the same code for each call to set your IP Address, that this would be a problem (but, I wouldn't think it would produce a System Access Violation Exception).
The error in your original post, you identify as: "most of the times the exception occurs in the ole32.dll!CCache::Flush() function". This would drive me nuts, too. I doubt if that is actually the cause of the failure (my psychic debugging sense is telling me this), but, frankly, I don't know what to suggest.
I would contact Microsoft support, or one of their engineers that maintain a public blog, it's an interesting question.
|
|
|
|
|
I have created an Aggregate COM.
How to use the Aggregate COM object in client application?
|
|
|
|
|
I have created my own event class, publisher, and subscribers in C# .NET The event class and subscriber definitions exist in the same library. The publisher is a stand alone app which references this library. The subscriber is a windows service which also references this library.
In the windows service subscriber, I am able to receive normal COM+ events such as ApplicationEvents, ActivityEvents, etc etc, but I am having trouble receiving events from my own event class.
I am getting the exception: System.Runtime.InteropServces.COMException(0x80040201): An event was unable to invoke any of the subscribers.
My subscription code is:
ICatalogObject subscription = (ICatalogObject)transients.Add();
subscription.set_Value("Name", this.ToString()); // name it
subscription.set_Value("EventCLSID", GetEventClassID());
subscription.set_Value("InterfaceID", GetEventInterfaceID());
subscription.set_Value("SubscriberInterface", GetIUnknown());
bool success = transients.SaveChanges() == 0;
I have registered the library containing the event class with gacutil and regsvcs etc, but I can't receive events. The publisher application is listed in the Component Services viewer aswell -- it shows that the publisher app is using my event class.
Can anyone help me? I'm stuck
|
|
|
|
|
Hi Helper,
can you please. le mw know.
Is is really possible to make the ATL COM component embedding the active x (.ocx) inside it.
If yes can you please provide me the steps to do so.
I have an assignment . to make the ATL COM component with embedding the .ocx.
Here is the brief of the requirement.
I am having on e.ocx provideed by the vendor say as scanner.ocx.
What is need to do is make one another ATL COM or active x using this .ocx file. This componet which I am creating also support one dialog and should be all the controls( like buttons combo, I mean all the user interface,)
How to do that.
we need to make ATL COM or use the active x wizard for that.
can you please let me know the steps do so. It's urgent.
Thanks,
|
|
|
|
|
I create C# console application that use outlook to open msg file.
The application work well on server when I use remote desktop.
But when I try to run the console application from ASP.NET page. GetActiveObject() cannot find outlook instance.
What should I adjust/setting something to make the application work ?
Is it possible to GetActiveObject() in this situation ?
|
|
|
|
|
Hi,
I have a vc++ application that has an interface IMyInterface and a class derived from this interface.I would like to pass a pointer to this interface, to an interface method declared in a component. I am trying to manually edit the header files and .idl file in order to declare the pointer to the interface declared in vc++ application.
What I did is, I have included the vc++ app interface header file in the .idl file. I don't whether I can do this or not. But I am trying...When I did so, I am getting error "error MIDL2025 : syntax error : expecting a type specification near "virtual".
Please let me know as how to pass my interface pointer to a method in the component and what are the changes that are to be made.
Thanks in advance.
Taruni
|
|
|
|
|
You can #include a .h file in MIDL to add structs etc, but in your case I think you need to #include the .idl file with the definition of the interface you want to pass e.g.
#include "IMyInterface.idl"
usually this is after the
#import oaidl.idl
#import ocidl.idl
Your interface should then have a method (or similar):
HRESULT PassMyInterface([in] IMyInterface* pIMyInterface);
|
|
|
|
|
Hi,
I'm using visualstudio6.0 and new to the COM. I want to create a mime filter such that i can able to retrieve the web page content and replace it with other data. Please, help me.
How I have to start creating a plug-in?
I have gone through this link (i.e., http://msdn.microsoft.com/en-us/library/aa767916(VS.85).aspx), but unable to understand it clearly.
Thanks in Advance...
|
|
|
|
|
Hi
Can anyone here tell me how can i implement these Interface in C#,I am creating an com component and i need to impliment these.
IPersistProperty
IPersistPropertyBag
Pleas help me u can also give any article regarding this.
thank you
Mahammadhusen
|
|
|
|
|
Hi,
Can anybody provide me links for how to create and deploy COM, DCOM in remote servers and accessing them using VB code located in remote server.
I would be very much thankfull to all of who tried to support me in anyway.
If links explain with sample codes, it will be very much helpfull.
Thanks a Lot,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Hello everybody,
I have an issue while working with COM Out-Of-Proc Servers.
My situation is such that, the client need to pass a Function pointer
to the Server, so that the server can fire callbacks at regular intervals.
So I need to define one of opearions in the interface provided by the Server to
take one function pointer.
Now the problem is that while doing so in IDL file, MIDL doesn't allow me and throwing errors.
Please help me guys...
Thanks in Advance..
Shyam
|
|
|
|
|
I think you can use connection points to fire the reply back to the client. The event sink at the client side can hold the function pointer. When the fired reply reaches the event sink of connection points you can re-direct it to the corresponding function.
|
|
|
|
|
ConnectionPoints are one method. What MIDL will allow is to pass an interface pointer tather than a finction pointer. Then you can call a function of that passed interface from the server.
Have the client implement an interface with the callback function and the server an interface with a method that takes a pointer to the first interface as a parameter. Then in the client internally QueryInterface for the interface and pass it to the server.
|
|
|
|
|
Thanks Jonathan for your reply...
That really eased my problem..
|
|
|
|