|
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;
}
|
|
|
|
|
Really an ATL/C++ question. After loading the XML document:
*paXMLDocument = paXMLDoc.Detach();
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
We are doing a project doing a study on the posibility to make OpenOffice into a “webprogram”. This is similar to a web mail.
To describe the project better, the whole point is to be able to use OpenOffice anywhere in the world, with any web browser, any operating system etc. We currently have a web server to use for the server part. The Client part would be a web browser and that’s it. Similar to thin Client but better, where there will be no specific client installation.
The thing is, I am thinking on using Java Applets and using some ActiveX implementation. Maybe it could be done with just a plugin to the internet explorer im not shure.
Any leads and information on this is welcome.
MVH
Locktotten(Sweden)…
Locktotten...
|
|
|
|
|
I have a VC++ program in which two IScriptControlPtr smart pointers are created in thread "1". Thread "2" calls the Run() method against the first IScriptControlPtr, and thread "3" calls the Run() method against the second one. All three threads call CoInitializeEx(NULL,COINIT_MULTITHREADED) first.
What I am finding is, thread 2 (or 3) blocks until thread 3 (or 2) has finished, even though they are running against separate IScriptControlPtr objects (and no other thread is trying to access these smart pointers).
Has anyone seen this behaviour before / is this to be expected?
Is there perhaps bad multithreaded handling in msscript.ocx? (I am using version 1.0.0.7615).
Many thanks,
Neil.
|
|
|
|
|
The msscript.ocx control is registered with the Apartment threading model. This means it has affinity with the thread on which it is created - COM will force calls from a different thread onto the thread which created the object.
If you want to use multiple script controls concurrently, you should create them on the threads which will call their methods.
I'm not sure, but I think using COINIT_MULTITHREADED with an Apartment object will cause you to get a proxy to the object even though you're calling an object on the same thread.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|