hi guys,
please anyone tell step by step tutorial on COM using vs2005.
— first clarify whether you want to create a COM component or just use one. As hinted, the workflows are different; is right that many tutorials exist, but the shortest practical path for VS2005/C++ is either ATL for creating servers or simple client-side use with CoCreateInstance/#import.
For creating a COM server with VS2005 (high level)
regsvr32) For consuming a COM object from C++ (high level)
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED) (or MTA as needed) CoCreateInstance or use #import "MyServer.tlb" to get smart wrappers CComPtr<T>) or raw interface pointers and Release() CoUninitialize() when done.Quick client example:
CoInitialize(NULL);
CComPtr<IMyInterface> sp;
HRESULT hr = sp.CoCreateInstance(CLSID_MyComClass);
if (SUCCEEDED(hr)) sp->MyMethod();
CoUninitialize(); Common pitfalls and checks
oleview.exe to inspect type libraries and registry entries and guidgen to create GUIDs.Authoritative references:
Jump to Post— Tigran 14You mean to create one or use one
You mean to create one or use one
Copy and past your terse question into google.
Here is a tutorial:
The title says, Step by Step COM Tutorial
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.