|
Yes, it is possible to handle COM events in win32 console applications using ATL or raw C++.
Kuphryn
|
|
|
|
|
Can you pls brief me on this.And give me any samples or links related to this if possible.I am strugling with this for a while.When there are more than one button in aconsole how to know which button was clicked.Pls help.I will be really grateful.
Thnks in advance
ram
|
|
|
|
|
Hello Sir:
I know that these are two excellent ATL books.
1. Developer's Workshop to COM and ATL 3.0 by Andrew Troelsen
2. ATL Internals by Brent Rector, Chris Sells, and Jim Springfield
I want to know who did konw where i can get them? Thank in advance.
|
|
|
|
|
Here and here
--
You know me. I sure know you.. Everyone of you!
|
|
|
|
|
Hello, sir:
I have a question about ATL and WTL. That is what is different from ATL and WTL. And how can i get WTL? Can you tell me some about WTL? Thanks a lot.
|
|
|
|
|
|
|
Hi Dears
I want to develop a MS Word Addin. The main functionality of this addin is:
--> I have to convert MS Word file (.doc) into (.pdf) file format.
What should I take as first step to implement this functionality.
Kindly guide/help me in the form of some code/link.
I'll be grateful to you.
Kind Regards
Atif
Watch Your Thoughts for they will become your actions.
Watch Your Actions for they will become your habits.
Watch Your Habits for they will become your beliefs.
Watch Your Beliefs for they will determine your destiny.
|
|
|
|
|
Hello!
What are the required steps in order to send a reference of an object through a event?
Thanks a lot in advance.
|
|
|
|
|
What kind of object? If the object is supported by COM universal marshal, then you can pass it using VARIANT. Otherwise, one solution is custom marshaling.
Kuphryn
|
|
|
|
|
Thanks a lot for your reply.
Here is what I intend to do: I have a Component with 2 Classes: ObjectSender and ObjectToBeSent. ObjectSender has one event: SendObject(IObjectToBeSent **pObject). My idea is to pass a reference of ObjectToBeSent to a Visual Basic client. However, when calling the Invoke method of the client, pVarResult returns an error; so the VB client does not execute its event handler.
In other words, I do not know how to send a reference of a COM object by using IDispatch::Invoke(). Can you please help me?
HRESULT Fire_SendObject()
{
...
CComVariant* pvars = new CComVariant[1];
CComObject<cobjecttobesent> *pObjectToBeSent;
IObjectToBeSent *pIObjectToBeSent;
CComObject<cobjecttobesent>::CreateInstance(&pObjectToBeSent);
pObjectToBeSent->QueryInterface(
IID_IObjectToBeSent, (void **)&pIObjectToBeSent);
....
for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
{
....
pvars[0] = pIObjectToBeSent;
pvars[0].vt = VT_UNKNOWN | VT_BYREF;
pvars[0].ppunkVal = (IUnknown **)&pIObjectToBeSent;
...
hr=pDispatch->Invoke(...) // This does not work
...
}
}
Thanks again for your kind attention.
|
|
|
|
|
What is the error code you mention? (The one you get from Invoke())
--
You know me. I sure know you.. Everyone of you!
|
|
|
|
|
As long it's an interface pointer, the idl-generated marshalling should take care of it... right?
--
You know me. I sure know you.. Everyone of you!
|
|
|
|
|
It depends on the type of data. Given that it is one of COM universally supported data types, then yes the universal marshal will take care of type conversion.
Kuphryn
|
|
|
|
|
Just developed an ActiveX component in ATL, to download on some internet clients (throght signed CAB file and stuff). Problem is: some users have windows xp installed, and are logged on as users. The default configuraton for users on XP is:
1) they can't install ANYTHING on Downloaded Program Files
2) they can't register the components because they don't have WRITE permission to the registry.
How can I download my components now ?
I'M DOOMMED !
I think I should move to Java applets...
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
English is not my native language so, if you find any spelling erros in my posts, please let me know.
|
|
|
|
|
Windows Installer which is a windows service is the only executable that has enough credentials to install something on a machine without root priviledge. So I guess you have to make a .msi setup.
RSS feed
|
|
|
|
|
But an administrator needs to give permissions on my .MSI. I'm deploying the component throught the internet.
I'm still hating ActiveX...
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
English is not my native language so, if you find any spelling erros in my posts, please let me know.
|
|
|
|
|
Although it may be true that at some point if the machine is completely locked, it is impossible to install anything on it, usually a .msi file does work fine since it directly talks with Windows Installer which is running as a service. And the program gets installed on behalf of the Windows service.
RSS feed
|
|
|
|
|
|
Hi,everybody.
While I compiling my project writen in c++ with template ,I get a compile error c2975(vc++6.0),some error message like :
Compiling...
ChildView.cpp
..\ChildView.cpp(194) : error C2975: 'CXXTaskWorker' : invalid template argument for 'pdiid', constant expression expected
..\sbmtaskworker.h(73) : see declaration of 'CXXTaskWorker'
..\ChildView.cpp(194) : error C2975: 'CXXTaskWorker' : invalid template argument for 'plibid', constant expression expected
..\xxtaskworker.h(73) : see declaration of 'CXXTaskWorker'
..\ChildView.cpp(194) : error C2079: 'worker' uses undefined class '?$CXXTaskWorker@$1piid$1plibid'
XXTaskWorker.cpp
Error executing cl.exe.
TEST.exe - 3 error(s), 0 warning(s)
My code goes like:
//class delare
template <const IID * pdiid = &GUID_NULL,const GUID* plibid = &GUID_NULL><br />
class CXXTaskWorker : public IDispEventImpl<1, CXXTaskWorker, pdiid, plibid, 1, 0><br />
{<br />
public:<br />
...<br />
}
//use
CComponentInfo* info;<br />
if(m_mapComponent.Lookup(_T("test"),(CComponentInfo *)info))<br />
{<br />
const IID * piid = &(info->EventId);<br />
const GUID * plibid =&(info->TypeLib);<br />
<br />
CXXTaskWorker<piid, plibid> worker; <br />
... <br />
}
|
|
|
|
|
hmm, bad news for you - that would require dynamic template instantiation during the runtime. You have to realize, that the template types (piid and plibid in your cases) must be specified at compile time, that the compiler will be able to deduce the template.
e.g. the use in style
CXXTaskWorker< &IID_IUnknown, &LIBID_MyLib > worker;
is valid because compiler knows what types/constants have to use while building the template code.
while the 'same' case
<br />
const IID * piid = &(info->EventId);<br />
const GUID * plibid =&(info->TypeLib);<br />
<br />
CXXTaskWorker<piid, plibid> worker;
not being valid, because then the template parameters depends on some runtime value and this is not possible
|
|
|
|
|
Yes,that's what i am wrong.as an alternative,I can use an extern variable to handle this problem.
|
|
|
|
|
|
I'm just learning STL. I have a vector of pointers to objects of a class I created. I'm trying to use lower_bound() and upper_bound(), but I don't see any way to specify how to compare my objects...the pointers are being compared instead. Does anyone know how to do this?
Thanks-
Patti
|
|
|
|
|
I got it. There is a version of lower_bound() that takes the comparison function.
I'm not liking the STL too much, tho...
|
|
|
|