|
Hi All,
Is there an interface in IE I can get hold of to sink the event of someone clicking the print button on the print preview window in IE?
Thanks for any help or ideas
Cheers
Tom
Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
|
|
|
|
|
|
Thanks for the reply. I'll look into it.
Cheers
Tom
Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
|
|
|
|
|
Hi all again, i'm developing an application based on the tabbrowser sample. I added some event handling
and other operations but when i try to open a pdf file from a link the app crash (c000005).
This happens only with acrobat reader installed, if i use something else (like the freeware foxit reader)
it runs properly.
Any idea?
|
|
|
|
|
I've just built the sample with VS2005. Running the browser (on XP) I just typed a link to a local pdf file. I saw the Adobe Reader 6.0 splash screen start up and the file was opened in the browser with no problems. But maybe you're using different version of something to me.
|
|
|
|
|
Have you tried running the app under the debugger so you can see where the access violation (for that's what it is) occurs and what the call stack is?
|
|
|
|
|
Just found that with newer version of acrobat reader the problem is solved.
Once again, thanks to everybody
|
|
|
|
|
Hi Experts,
I m devlopeing a COM application which takes one string and gives list of similar
words.
for that purpose I have used VARIANT* to store and return the list.
My code for the exported function is as :
LngGenSugg( BSTR* pcIpIscii, VARIANT *pacSuggArray, int* piNSugg, LFONT lfIOLayout, int *iResult)
{
// TODO: Add your implementation code here
USES_CONVERSION;
char buffer[20];
HRESULT hr= S_OK;
// Create SafeArray of VARIANT BSTRs
SAFEARRAY *pSA;
SAFEARRAYBOUND aDim[1];
aDim[0].lLbound= 0;
aDim[0].cElements= WordLen +1;
pSA= SafeArrayCreate(VT_BSTR,1,aDim);
if (pSA != NULL)
{
_variant_t vOut;
VariantInit(&vOut);
vOut.vt= VT_BSTR; // set type
long aLong[1];
for (LONG l= aDim[0].lLbound; l< (aDim[0].cElements + aDim[0].lLbound); l++)
{
aLong[0]= l; // set index value
ltoa(l,buffer,10);
vOut.bstrVal = A2W("Victory");
if((hr= SafeArrayPutElement(pSA, aLong, &vOut)) != S_OK)
{
SafeArrayDestroy(pSA); // does a deep destroy
return hr;
}
MessageBox(NULL,(char*)pSA[l].pvData ,"pSA",0);
}
}
V_VT(pacSuggArray)= VT_ARRAY | VT_BSTR;
V_ARRAY(pacSuggArray)= pSA; // (pSA may be null)
.
.
.
.
}
I just try to give words as "Victory";
so Is it correct way to do thiss???
and
Exception occured during execution at MessageBos() cal.
can anyone help me??
and Another problem is..
I have tried the same function by using char** str Array that stores similar words list but..
I m failed to assing it to return VARIANT array pacSuggArray.
so plz help me..
Thanx in advance...
waiting for ur valuable reply...
regards ,
Victory
|
|
|
|
|
You seem to be creating an array of type VT_BSTR , which is fine, but then complicating things somewhat.
I'd recommend using SafeArrayAccessData to get a pointer, say pData, to your array of BSTR pointers then in a loop using pData[n] = SysAllocString(L"Victory"); to set the pointers and then SafeArrayUnaccessData at the end.
|
|
|
|
|
Thanx ur reply...
If I want to assign my char *str[50] array of word list to that safearray.
then what should I do?
Do I assign each word from str array as above
or.
Is there any another way..
that I can assign just address of str array to safearray??
plz reply..
I m waitng for ur valuable reply.
regards,
Victory
|
|
|
|
|
Using the method mentioned its only memory for the BSTRs (which are pointers) that been assigned so to get a complete string you'd need to assign memory somehow. Using SysAllocString takes care of that for you and also looks after the length of the string, something that could complicate matters.
You can assign memory to the SAFEARRAYS data area, if the rest of the SAFEARRAY has been setup to expect the type of data you put there. Personally I'd get it working using the method mentioned before looking for other ways but I'm sure there are plenty of articles etc on other ways.
|
|
|
|
|
Hi,
I have developed a COM Add-In for MS-Office 2003 & 2007. I am able to register this Add-In (DLL / EXE) using regsvr32.exe and I am able to use the functionalities of this component. But I am able to use this in my profile but if different user logs in to the system the same Add-In functionality will not be available, the user needs to register again this DLL / EXE in his own profile.
I would like to know how to register this DLL / EXE so that all users logging this m/c should be able to use this Add-In functionality.
Thanks
SNI
SNI
|
|
|
|
|
Try creating the following registry key.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\<Office App>\Addins\<Add-in Name>
By default an office add-in is registered as the following registry key.
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\<Office App>\Addins\<Add-in Name>
So you will need to duplicate the key in the first location to the second location.
«_Superman_»
|
|
|
|
|
Hi,
I have ATL (EXE server) component, which is Add-In for Office applications (Word,Excel,PowerPoint). When we installed / register this Add-In we are able to trap Document Open, Close etc events.
We have implemented Interfaces in ATL (EXE server) component and we want to call these Interfaces from my DLL. I am able to call this Inteface from DLL's constructor. But when i am trying to call this Interface from member function of the same DLL it is giving "-2147417843" error.
Also I am trying to call this Interface from Callback function it is giving the same error.
The flow of communication between different component is
[MFCDLL ----Calling Callback impleneted in ---> MFCEXE ---This callback is calling Interface of ATL Add-In---> It is giving error. ]
Please suggest is there any possiblity to call CallBack / Interface implemented in ATL (EXE server) component from DLL.
Thanks
SNI
SNI
|
|
|
|
|
SNI wrote: But when i am trying to call this Interface from member function of the same DLL it is giving "-2147417843" error.
This error is a COM related error.
The description is this:
"An outgoing call cannot be made since the application is dispatching an input-synchronous call."
I'm not able to follow your explanation of how the different modules are connected, in what process the DLL is located, what calls are made from where to what and in what order.
And what do you really mean by "callback"?
Is it a COM event sink or what? I suspect it is.
However, I'm quite familiar with the error you've got.
It means that you are making a call to a COM server that resides in another apartment and that COM server wants to call you back in the same call chain.
This is not allowed since it would generate a deadlock.
I suppose you've heard that COM threads always have to process messages, at least the ones that create COM objects.... The reason is that when you make a call from one apartment to another, the call will generate a message that is sent from the calling apartment (the proxy) to the called apartment (the stub). When the call has been processed a message is sent back that the calling apartment is waiting for. During that time the calling apartment is not available for incoming COM calls and thus the COM library generates an error if you're attempting to do it.
This is the same problem you'll get if you're sending a message to another thread with ::SendMessage() instead of ::PostMessage() ; if the receiving thread does not process messages you'll get a nice little deadlock.
SNI wrote: Please suggest is there any possiblity to call CallBack / Interface implemented in ATL (EXE server) component from DLL.
I strongly recommend that you re-evaluate your design in a way that you don't make an outgoing call from the called interface function. You could post a message inside the server with the information needed.
There is another solution.
It will probably make your project increase in complexity ten fold at least, but you could make the servers free-threaded and let effected threads live in the multithreaded apartment of the process.
It's possible, but don't say I didn't warn you.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks for your reply.
I would like to put the same question in other words. I am rephrasing this to understand the question properly.
-----------------------------------------------------
I have created Office AddIn Exe (Out Proc Server ) Com Component in VC++.
When i am creating instance of COM Exe in my MFC DLL by following way,
HRESULT hRes = CoInitialize(NULL);
HRESULT hr=::CoCreateInstance(CLSID_TestILGAddIn,NULL,CLSCTX_LOCAL_SERVER,IID_ITestILGAddIn,(LPVOID *)&pILGComAI);
if (hr != S_OK)
{
AfxMessageBox(_T("CreateInstance Failed"));
}
Here CoCreateInstance is failed with return error no "-2147417843"
------------------------------------------------------
Please let me know what can we do in this case?
Thanks
SNI
SNI
|
|
|
|
|
SNI wrote: I have created Office AddIn Exe (Out Proc Server ) Com Component in VC++.
When i am creating instance of COM Exe in my MFC DLL....
If this is an Office AddIn, doesn't the Office application create the server?
Why do you have to create it?
It should be "installed" or "registered" in the Office application so it knows that the server should be created at start up.
From where is your DLL called when you're trying to create the server?
SNI wrote: Here CoCreateInstance is failed with return error no "-2147417843"
Without knowing from where your code is called, I cannot answer why you get this error better than in my previous post.
But, since this is a dll, you may be called in a thread that doesn't pump messages. So you should create a secondary UI-thread (one that pumps message) and create your server from there. Also be sure to initialize COM in that thread.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi,
Thanks for your reply and it is very usefull. We are sending msg using SendMessage which bolcks the thread. We have simulate this using by sending msg using SendMessage and it reproduced. So we use PostMessage instead of that and it resolves the problem.
Is there any way other than PostMessage we can use?
Thanks
SNI
SNI
|
|
|
|
|
Hi,
we need to send some information such as file name and we can do it by sending msg using SendMessage but we cannot send it thru using PostMessage. Is there any way by which we can send file name to other thread.
Thanks
SNI
|
|
|
|
|
Hi all,
I have a ATL&COM project, the problem is when I add a new object of ATL it pop a dialog and displayed like this "Currently ATL objects may only be added to ATL projects, or certain types of MFC projects (EXE, Control, Regular DLL)."
Who can tell me how to deal with this poblem?
Thanks
|
|
|
|
|
I just created a small ATL DLL project (with VS2003). Commenting out the declaration of the variable _AtlModule and/or its type caused this issue for me - so make sure you're not doing that! You may need to rebuild the project to get VS to recognise your project's ATL-ness.
I think the ATL class wizard is looking for a valid LIBID definition?
|
|
|
|
|
hi all,
i need help for making a CTrackBarCtrl transparent.
followed various threads around, but still haven't found
a working answer.
I have a template class:
template <class t=""> class CTrackBarTransparentT : public CWindowImpl<ctrackbartransparentt><t>,CTrackBarCtrl>
{...}
with handled WM_ERASEBKGND and WM_PAINT:
...
HDC dc = (HDC)wParam;
HBRUSH hbrOld = NULL;
HBRUSH hbr = NULL;
hbr = (HBRUSH)GetStockObject(HOLLOW_BRUSH);
//hbr = CreateSolidBrush(RGB(255,0,0)); //to impart color
hbrOld = (HBRUSH)SelectObject(dc, hbr);
RECT rc;
GetClipBox(dc, &rc);
PatBlt (dc , rc.left, rc.top, rc.right - rc.left , rc.bottom - rc.top,PATCOPY);
SelectObject(dc, hbrOld);
...
but this got no effect...
i think that the point should be to paint with an hollow brush, but this doesn't seems to
work for me.
Thanks in advance
|
|
|
|
|
Looking at this article[^], the difference between that and what you've got is setting the DC's background mode[^] - don't know if that'll make the difference.
I also saw this article[^] which says:
A TrackBar control does not repaint itself until it gets the focus. So, if you enable run time changes of appearance, and you have one, you'll have to set and reset the focus in order to show it properly.
That may be of more relevance...
|
|
|
|
|
hi experts,
Currently I m doing a COM DLL which exports some functions and enums structures.
can anybody help me to exports the enums from COM.
my enum definition is like this:
typedef enum LANG{
HIN,ENG,MAR,JAP,CAN
}LANG;
how can i declare this so that i can use it in client side using VB.
and I m using VC++ 6.0 and VB 6.0
plz help me.
thanx in advance.,
regards,
Victory
|
|
|
|
|
I did a quick search for enum in my .idl files and found the following where an enum is used as a parameter in an interface if its of any help. This was definitly for VC++ 6.0 COM called from VB.
typedef [v1_enum] enum CoolingSystem
{
System1 = 0x00000001,
System2 = 0x00000002
}CoolingSystem;
[
uuid(B30CF430-3E47-11D5-8088-0050DAD52C1D),
helpstring("IFridge Control Interface"),
]
interface IFridgeControl : IUnknown
{
[id(0x00000001), helpstring("Select working System")]
HRESULT SelectSystem([in] CoolingSystem System);
|
|
|
|