|
I learning to make a COM dll, I want convert a a sample in C++ (or C i dont know) I just need help with the
[odl,
uuid(A70D81F2-C9D2-4053-AF0E-CDEA39BDD1AD),
helpstring("IMediaStatusSession Interface"),
dual,
oleautomation]
the best i could do so far learing from the SDK is:
[Guid(A70D81F2-C9D2-4053-AF0E-CDEA39BDD1AD),
InterfaceType(ComInterfaceType.????????),
helpstring("IMediaStatusSession Interface")]
I just need help with the "dual" and "oleautomation"?
where can i find info about this in the SDK Documentation? or even better can some one fix what i done so far.
modified 16-May-21 21:01pm.
|
|
|
|
|
Please any body tell me How to minimize the size of ATLCOM DLL. I have made dll which is MTS supported + Asp intrinsic objects. I have made 5 functions in One interface. and the size of dll is 1.04 MB...
Please tell me how could i minimize the size of the dll.
Thanks in advance...
|
|
|
|
|
Visual C++ 6.0's ATL wizard creates two different release configurations: ReleaseMinSize and ReleaseMinDependency. The minimum dependency version links to the C run-time statically and includes the ATL registration code. The minimum size version links to the DLL version of the C run-time and links to atl.dll for registration.
In the second case, you would have to distribute msvcrt.dll (installed by default on Windows 2000 and later, so you can skip it if you're targetting one of these systems) and atl.dll.
You can select different combinations by defining (or not defining) the symbols _ATL_MIN_CRT , _ATL_STATIC_REGISTRY , and changing the C run-time library version you're using. If you're not using the C run-time at all, you can define _ATL_MIN_CRT .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi all,
I have created a simple FULL control, also i have registered a new MIME type for it.
Now, When i create a new file say test.myext and open it with IE. it show the Control taking full page on IE Window and spying these window -
It looks something like this
---C:\temp.bisfext
|---Other Windows
|---Other Windows
|--- Shell DocObject View
|-Internet Explorer_Server
But I have seen some few application where in if you embed you control in IE Window then IE Show something Like
---C:\temp.bisfext
|---Other Windows
|---Other Windows
|--- Shell DocObject View
|-Internet Explorer_Server
|-ATL:XXXXXXXX
Can anyone please explain me what is the difference between the two?
Thanks in Advance
Abhishake
|
|
|
|
|
Hi,
How do I find out the the path of the .exe or script file (.vbs, .js) which is trying to use my ActiveX server exe?
Any VB or VC++ code will be helpful.
Thanx
|
|
|
|
|
Hi,
I am student. Right now i am learning on COM+. And doing one on course project in VC#.NET and COM + component. This is distributed application.
In that there is server on one machine and client on other. But i am little bit confused in that server client techonlogy. I have to make database connectivity for validating users and other inforamation. That time i creat on clint and one server and one component for connecting client to server. But if i want to make one more form can i use same server that i already created for the login. and how to use many forms to connect server and then connect to database i am confused in this stuff.
Please Help me.
I hope someone help me for that
Thanking You,
(Hemant Uttam Mane)
|
|
|
|
|
I am a COM newbie, and I would like to use the MAPI address book in one of my apps.
According to the documentation I got, the function I want is IAddrBook::Address .
Now IAddrBook is declared as IAddrBook : IMapiProp which tells me it is derived from IMapiProp .
My question is how do I get an instance of IAddrBook into my MFC app so that i can use it?
The interface ID is IDD_IAddrBook and the pointer type is LPADRBOOK which are declared in in the file "MAPIX.h" which is all fine, but to use CoCreateInstance() to create an instance of IAddrBook I need a class ID. What is, or where do I find, the CLSID for IAddrBook . Or is there an other way to load an instance of IAddrBook ?
Please do not point me to WABOPen as that function will return Internet Explorer's cutdown subset of MAPI's IAddrBook interface. I want to gain access to MAPI's full featured IAddrBook .
Also, if anyone can recommend some good books on COM basics for beginners, I would be greatful
Thanks.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
__uuidof(IAddrBook)
will this work for you?
Have you considered using smartpointers, since you are a newbie as you said, it would be helpful for you.
God is Real, unless declared Integer.
|
|
|
|
|
Thanks for the pointer, but unfortunately it does not work
LPADRBOOK pa = NULL;
HRESULT hr = CoCreateInstance(__uuidof(IAddrBook), NULL, CLSCTX_INPROC_SERVER, IID_IAddrBook, &pa); gives me
error C2787: 'IAddrBook' : no GUID has been associated with this object Surely there must be a way to load an IAddrBook object
It can't be that difficult, all I need is point in the right direction
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I am not that expert in com either, but i guess this should work.
HRESULT hr = CoCreateInstance(IDD_IAddrBook, NULL, CLSCTX_INPROC_SERVER, IID_IAddrBook, &pa);
before that , did you import the tlb file ?
God is Real, unless declared Integer.
|
|
|
|
|
hi
clsid for IAddrBook is {4D2F086C-6EA3-101B-A18A-00AA00446E07}. I just took it from the registry. but it seems mapi.dll is supposed to use by calling the exported mapi functions in that dll. Even if the dll is com compliant, it is not iDispatch impliemnted and also it exports a large number of functions for varuois kind of operations with outlook. So it better to go for that built in functions than the com functions. So to get the IAddrBook pointer u can use pSession -> OpenAddressBook . This will return LPADRBOOK . To get a valid pSession variable, call MAPIInitialize and MAPILogonEx .
rgds...mil10
|
|
|
|
|
Thanks, this may be just what I need to get started
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
HI all,
Plz anyone can tell me where to get any online tutorials to start learning COM?I am new to it and need ur help.Plz help me
Poornima
|
|
|
|
|
got to ATL/WTL...u will find beginners 5 articles...
|
|
|
|
|
http://www.codeproject.com/atl/#Beginners
at least madam give search or do look at left hand side bar of Codeproject for titles
cheers
Balkrishna
|
|
|
|
|
Question:
How to return SafeArray inside of Variant from COM component?
My COM component is out-of-process component ie.EXE and client
is coded in VB. I am building communications interface for
VB clients and have a need to return array of bytes.
Passing of Variant arry to COM-component thru IDispatch is ok and
returning of parameters that are not arrays is also working.
Any help is warmly welcomed!
Example code from idl which tries to return array thru inVal - parameter:
[id(7), helpstring("method to Test3 interface with Variants")] HRESULT get_Test3( [in, out] VARIANT *inVal, [out, retval]VARIANT *pVal);
Declaration on C++ :
STDMETHOD(get_Test3(/*[in, out]*/ VARIANT *inVal, /*[out, retval]*/ VARIANT *pVal);)
And Implementation:
STDMETHODIMP TestClass::get_Test3(/*[in, out]*/ VARIANT *inVal, /*[out, retval]*/ VARIANT *outVal){
ZeroMemory(inVal, sizeof(VARIANT));
BYTE dummyInput[3] = {0,1,2};
CDispatchHelper::ConvertFromBytePtr2Variant(dummyInput,&inVal);
return S_OK;
}
And implementation of ConvertFromBytePtr2Variant() - fucntion
//Converts given byte array to SAFEARRAY contained in Variant.
//NOTE: Now this just creates array of 100 ints for testing purposes
BOOL CDispatchHelper::ConvertFromBytePtr2Variant(BYTE *_byteToConvert, VARIANT **_ppResult)
{
SAFEARRAY *pNewSafeArray = NULL;
// one dimensional array with 100 elements and
// zero-based indexing
SAFEARRAYBOUND rgb [] = { 100, 0 };
// allocate the memory for the descriptor
// and the array data
pNewSafeArray = SafeArrayCreate(VT_I4, 1, rgb);
if (pNewSafeArray) {
// get ptr to array base
long *rgelems;
SafeArrayAccessData(pNewSafeArray, (void**)&rgelems);
// initialize each element
for (int c = 0; c < 100; c++)
rgelems[c] = c;
// release lock on array state
SafeArrayUnaccessData(pNewSafeArray);
}
//Now we have safe array in pNewSafeArray
//Put array in Variant
*_ppResult = new VARIANT;
if (*_ppResult == NULL){
ATLASSERT(FALSE);
return FALSE;
}
ZeroMemory(*_ppResult, sizeof(VARIANT));
(**_ppResult).vt = VT_I4 | VT_ARRAY;
(**_ppResult).parray = pNewSafeArray;
return TRUE;
}
VBClient side code is this:
Dim testInOut As Variant
testOut = oIdiootti.get_Test2(testInOut)
'Here value of testInOut is not changed, if transaction were succesfull
'parameter should contain 100 integers with values 0,1,2,3...
|
|
|
|
|
Now I tried to create array of bytes before sending array to COM - component and in component I write just to these allocated bytes. Result is succesfull transaction. But if I try to create new array using SafeArrayCreate() APIs transfer wont succeed.
Any sound explanations would be helpfull.
|
|
|
|
|
Hi,
I am trying to open a word template that has auto macros that fire when the template is opened. I need to disable these programmatically.
In Delphi you can use the following to achieve this:-
OleVaraint(myWordApp.WordBasic).DisableAutoMacros;
myWordApp.Documents.Open(blaa...blaaa...blaa...
I really need a way to do this in .net (C# if possible).
Any help would be most appreciated.
P.S. Anybody know any other good places to ask?
|
|
|
|
|
Hi all,
I am a newbie in COM, I want to know how activeX creation take place, when you embed and activeX in container.
Thanks in advance,
Abhishake
|
|
|
|
|
Use Full COntrol or composite control...and rest is the kinda fun...
then u need to add property bag...to get vb RHS effect...
|
|
|
|
|
hey, i was wondering if can anyone tell me a way to override the default actions of a certain control, create new ones, and disables ones.
let's say i have a control X, we all know that in API, all r considered as windows. Let's say i have its handle. and this X control is inside my window Y. I want to know if there's a way to add new "message handles" for this control: what if this control doesnt support left click and i want to add one? (i could use the left click on the parent using some coordinates calculations) , how about overriding existing events? Ie: I want the button to be clicked when i press the right click. (i'll suppose that the control doesnt have any event capture for the right click). and... what if i want to disable the left click on this control?... I know all those stuff have a certain way to be dealt with. In order to override some functions, i used followed the mouse on the parent, when it's inside the window, and its location has changed, i'll SetCapture on the parent. any better ideas about this subject? ... my way works but not perfectly (i will have to send all the other msgs i need to the control which will make the job lengthy),that's why I need ur help guys
lebgenius
|
|
|
|
|
I'm calling a COM function inside this C++ function. How to convert char* to
BSTR and BSTR*?
void myFunction( IN char* name,
OUT char* path)
{
MyCOMFunction( CComBSTR( name), ??);
}
The COM function prototype is like this:
HRESULT MyCOMFunction(IN BSTR name,
OUT BSTR* path)
{
}
Thanks.
|
|
|
|
|
void myFunction(char* name, char* path)
{
BSTR bstrPath;
MyCOMFunction(CComBSTR(name), &bstrPath);
}
Hope this helps,
|
|
|
|
|
hi,
i have an client application through which i can fetch the data of the opc server now i have to update the data. please anyone help me
|
|
|
|
|
I have function which i pass in parameter IXMLDOMDocument **paXMLDocument
plus a CComBSTR string. Inside the function i create a new document and load
the string which i passed in using loadXML.
My problem is how can i copy this document to the **paXMLDocument document
so it can be passed back from the function. Also this function should create
a new document for me as well - before i call the function below i define
paXMLDocument as CComPtr <ixmldomdocument> paXMLDocument and I dont call
cocreateinstance. I would like to get the function to create it for me.
Any assistance would be appreciated.
Thanks
Andy
short getDoc (IXMLDOMDocument **paXMLDocument, CComBSTR sXMLDoc)
{
CComPtr<ixmldomdocument> paXMLDoc;
HRESULT hr = ::CoCreateInstance(CLSID_DOMDocument, NULL,
CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (void**)&paXMLDoc);
if (FAILED(hr))
return -1;
VARIANT_BOOL bIsSuccessful = FALSE;
// load xml document
hr = paXMLDoc.loadXML(sXMLDoc, &bIsSuccessful);
if ((FAILED(hr)) || (bIsSuccessful == VARIANT_FALSE))
return -1;
//
// this doesnt work!!!!!
//
hr = paXMLDoc->QueryInterface( paXMLDocument);
if (FAILED(hr))
return -1;
return 1;
}
|
|
|
|
|