|
|
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...
|
|
|
|
|
pfoo wrote:
I'm not liking the STL too much, tho...
It grows on you. Patience.
--
Ich, du, sie, er, es, ihr, sie, Sie.
|
|
|
|
|
Hi guys, I really wasn't sure whether or not to post this here as it might be generic to C++. Anyway, I have a WTL project.
I have some generic set up code like so...
LRESULT CMainFrame::OnCreate(...)
{
//toolbars get created here etc
lfh = new LogFileHandler();
lfh->ReadLogFile();
}
Now in the header file I have declared LogFileHandler lfh.
I have nothing yet in this class except
LogFileHandler::LogFileHandler()
{
int i = 0; //i have a breakpoint here
}
whats strange is that I get a "debug assertion failed" prompt whenever I step through the code. It tells me "m_hImageList != 0" in atlctrs.h (line 1533)
I have no idea why this happens. The app runs fine though when you hit Ctrl+F5.
Is there something I didn't pick up?
Thanks guys.
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
Sorry folks, I was caught in a bit of a brain lapse there. Figured it out.
Thanks
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
I was working on a C++ ATL server project and been using m_HttpResponse object like "cin" object to stream response back to client.
However, I can't find where this m_HttpResponse object comes from, I searched the entire handler class declaration. m_HttpResponse is nowhere to be found. And what's more interesting is that the handler class doesn't derive from anything!?? And there's no #include or#using statements at the top of the header file:
#pragma once
[ request_handler("Default") ]
class CMyHandlerClass //Derive from nothing - no inheritance observed!
{
//m_HttpResponse declaration??
};
The code works fine, just not sure why/how it worked.
norm
|
|
|
|
|
Erm, aren't all request handlers done as CRequestHandlerT< yourclass [, CComSingleThreadModel [,CHtmlTagReplacer< yourclass >]] > anyway?
That means they that yourclass doesn't need to derive from it...
Steve S
[This signature space available for rent]
|
|
|
|
|
Note this line:
norm wrote:
[ request_handler("Default") ]
From MSDN: "The request_handler attribute will usually add CRequestHandlerT as a base class. If the soap_handler attribute has been applied to this class, CSoapHandler will be added as a base class instead. If the class to which this attribute is applied already derives from IRequestHandler, then no base classes will be added."
To be honest, I don't like these attributes - they hide too much IMHO.
|
|
|
|