Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

TClarke

@TClarke
About
Posts
456
Topics
32
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to get Excel and Word documents to open without the Open,Save,SaveAs box opening in IE9
    T TClarke

    OK this turned out to be very simple but I thought I'd publish the fix any way. Basically, despite the fact that IE 9 doesn't have the check box previous versions of IE have that enables you to save your decission of what to do with a file of a particular type it doesn't mean it doesn't check the registry to see if an old choice (from a previous browser) isn't stored there. So the fix is to replicate the storage of a previous version of IE into the registry of the machine on which IE 9 is running. In my case it went as follows: If it's not there already create the following key path in the registry: HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\AttachmentExecute\{0002DF01-0000-0000-C000-000000000046} Inside the InternetExplorer.Application GUID key create a list of binary values using the COM name of the document opening application as a title. In my case (Office 2003): Excel.Sheet.8 PowerPoint.Show.8 Word.Document.8 If the values are 0000 the the application will open without asking the user.

    Cheers Tom Philosophy: The art of never getting beyond the concept of life.

    Web Development tutorial question

  • How to get Excel and Word documents to open without the Open,Save,SaveAs box opening in IE9
    T TClarke

    Hi All, I work on a web application that has Excel and Word documents in it. At the moment when a user opens these documents in IE9 they get presented with a dialog box asking: What do you want to do with "filename"? The user is presented with Open, Save and Save As as the options. Unlike previous versions of IE there is no check box to tick to remember the user's choice so it comes up every time. I really need to get rid to this box. Does anyone know how to disable it? Thanks Tom

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    Web Development tutorial question

  • 1066 and all this...
    T TClarke

    "Since 4/5ths of the UK is still owned by the descendents of those Norman invaders" Where did you hear that? That sounds way too much. Not that I disagree with pointing out the problems still troubling this country from that most brutal and merciless of conquests. It causes me great distress to think about it. The Normans have a great deal to answer for. The crusaders were also mostly Norman, just look at the problems we still have over there because of their brutality.

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    The Soapbox lounge html announcement

  • How to register an automation enabled application in the ROT when it's started from the command line.
    T TClarke

    Hi All, I have an application generated by the VS2005 AppWizard so that it has Automation enabled and I've setup the interface so it all works correctly. However, I also have the app accepting command line parameters when starting from the command line(which it mainly is since it's fired up from a Java servlet). The app gets called so many times I only want one instance of it to exist at a time so as to cut down on system resource usage. What I want to do is register the IDispatch of the automation object with the ROT when the app is first started up with the command line. That way when a user starts the app again I can check with the ROT to see if an instance of my app is running. If it is, I just get the IDispatch out of the ROT and pass the parameter values to the running instance via the methods on it. I then shut down my app before I've completed assigning all the necessary resources to it. So my question is: How do I get the IDispatch to my app if it has been started with the command line? Thanks very much for any help Thomas

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    C / C++ / MFC question java testing tools help

  • It takes all sorts
    T TClarke

    Weatherley attempted to continue "pleasuring himself in between bouts of wrestling" With what exactly? Makes me wonder about the design of his "home-made sex aid" Must have been quite strange for the cops to have a ten minute car chase that didn't exceed 20kmh.

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    The Soapbox html com question

  • non dialog object sink advise causing assert to be thrown during advise initialisation
    T TClarke

    Thanks for your advice. It's much appreciated. I now know I'm not just being goofy about things too. Which is always good :)

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    ATL / WTL / STL c++ com hardware

  • non dialog object sink advise causing assert to be thrown during advise initialisation
    T TClarke

    Hi, thanks for the response. I have something very similar. In my class declaration I have:

    public IDispEventSimpleImpl<0, COfficeDlgX, &__uuidof(_IOfficeAutomaterEvents)>,
    public IDispEventImpl<IDC_WB,COfficeDlgX>,

    In my class I then create a typedef for calling the advise method.

    typedef IDispEventSimpleImpl<0, COfficeDlgX, &__uuidof(_IOfficeAutomaterEvents)> OfficeAutomaterEventsImpl;

    Then I generate the sink map:

    BEGIN_SINK_MAP(COfficeDlgX)
    SINK_ENTRY(IDC_WB, 259, DocumentCompleteWb)
    SINK_ENTRY(IDC_WB, 252, NavigateComplete2Wb)
    SINK_ENTRY(IDC_WB, 250, BeforeNavigate2Wb)
    SINK_ENTRY_INFO(0, __uuidof(_IOfficeAutomaterEvents), 1, &COfficeDlgX::__OnDocumentClosed, &OnMenuItemClickedInfo)
    SINK_ENTRY_INFO(0, __uuidof(_IOfficeAutomaterEvents), 2, &COfficeDlgX::__OnMenuItemClicked, &OnMenuItemClickedInfo)
    END_SINK_MAP()

    in my code, when I create an instance of IOfficeAutomater I call:

    hr = OfficeAutomaterEventsImpl::DispEventAdvise((IUnknown*)m_spOfficeAutomater, &__uuidof(_IOfficeAutomaterEvents));

    IDC_WB is the dialog id of my WebBrowser. I don't have to call DispEventAdvise for the web browser control myself as the framework does it for me. It does it by using the id to get to the control. Herein lies the problem. Somehow, the framework now thinks all the sink entry ids refer to an item on the dialog box. The system therefore runs through all the sink entry id and calls GetDlgItem with them. When it uses the id of my non dialog item ie 0, it of course comes back NULL. This value runs through an assert and hey presto I get a message box up telling me something's wrong. On one hand it's only an assert and so it won't come up in the release build and it in no way affects whether my app works or not but it does seem very messy. What would be ideal is having two sink maps. One for dialog items and the other for anything else.

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    ATL / WTL / STL c++ com hardware

  • non dialog object sink advise causing assert to be thrown during advise initialisation
    T TClarke

    Hi all, I have an ATL control based on CComCompositeControl. In the control's dialog box I have a web browser, from which I am sinking events. I also have another COM object which is not on the dialog box from which I'm sinking events. I'm getting an assert thrown as my control initialises in AtlAdviseSinkMap. In this ATL method there is a loop which goes over all the ids of the sink entries and calls:

    	HWND h = pT->GetDlgItem(pEntries->nControlID);
    	ATLASSERT(h != NULL);
    

    While this works perfectly for the embedded web browser, the other object not on the dialog box causes an exception. Is there a setting I can use to inform the initialisation that it is not a dialog object and that this is not appropriate but without the assert being thrown. Many thanks

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    ATL / WTL / STL c++ com hardware

  • Sinking IE printpreview toolbar events
    T TClarke

    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.

    ATL / WTL / STL help question

  • Sinking IE printpreview toolbar events
    T TClarke

    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.

    ATL / WTL / STL help question

  • How to identify which toolbar button has been clicked.
    T TClarke

    Hi all, My situation is that I have to intercept a click on the print button on an IE print preview window. The project dictates that the Page Setup dialog should be opened first when Print is clicked. My question is what is the best way to do this? I have subclassed the window but the toolbar buttons are not separate windows so all I'm getting is a WM_LBUTTONDOWN message to the main window with the location of the click. I can of course stop this message getting through but knowing for sure when the right button has been hit is where I'm having a problem with this technique. Is there a way of querying the window to find the rect and position of the print button? I'm unhappy about measuring it myself and hard coding in the value in case some system change invalidates the value I've come up with Thanks for any ideas and help

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    C / C++ / MFC question help tutorial learning workspace

  • limiting print margins
    T TClarke

    Thank you so much Rajkumar, First of all, to respond to your comment: "First of all, obviously, if the margins are overbound it messes up, that is known to the user, do you need to correct it?" I couldn't agree more. It's another completely ridiculous example user madness. Unfortunately, my inclination to tell the user not to set stupid values has been overruled in this case, so here I am. My position is that the page setup dialog box is launched from IE. Therefore, I can either subclass IE's window or I can create my own one and replace the existing dialog box. Is there any way of applying the approach you showed me to an existing Page Setup dialog box owned by IE. I’m working from an ActiveX control running in IE? Many thanks

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    modified on Friday, January 16, 2009 5:33 AM

    C / C++ / MFC collaboration

  • limiting print margins
    T TClarke

    Hi Iain, The actual dlg box in question can be seen in IE. If you click on print preview, the window that comes up has a button which fires up a page setup dialog box. It is on this that the margins can be altered. Sorry for the lack of clarity. ps. Best damn surname there is...

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    C / C++ / MFC collaboration

  • limiting print margins
    T TClarke

    Hi All, Is there a way of limiting the size of the margins when printing. At present I can't think of a better way than subclassing the pring dialog box and intercepting text input to the margin size edit boxes. The reason for this is that our test team have complained that if they put a huge number into the text margin boxes it messes up the appearance of the document and so should be prevented. Can you believe it :doh:

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    C / C++ / MFC collaboration

  • Mouse Click Event Validation Issue
    T TClarke

    Thanks for the response. GetAsyncKeyState also returns a value > 0 if the key was pressed since the last call to it as well as if the event is currently active. If I'm checking for the right mouse key and someomeone enters the sequence: right key, left key, right key and I make a call each time, I should at least get 0,0 1. To counteract the first false negative I ignore the first call's result assuming that the first right click event is always correct as in this case the first event is what sets off the problem. I'm assuming this is what is going on as it now works. It's not the way I would have chosen. I'll have to keep an eye on it. Again, thanks for the comment,

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    C / C++ / MFC help

  • Mouse Click Event Validation Issue
    T TClarke

    I'm now using the lines:

    SHORT rbstate = GetAsyncKeyState(VK_RBUTTON);
    if (!rbstate) {
    return;
    }

    It just makes sure the right mouse button was the one used.

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    C / C++ / MFC help

  • Mouse Click Event Validation Issue
    T TClarke

    Hi all, I have a strange issue where an app which I'm getting events from is sometimes producing right click events when a left mouse click is actually what happened. Is there a windows buffer I can read which will allow me to validate the event without having to record all the mouse events myself. Thanks

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    C / C++ / MFC help

  • PowerPoint Event system is behaving strangely.
    T TClarke

    Hi all, Is anyone aware of why some of the events in PowerPoint do not fire. The WindowBeforeRightClick in particular is the one I wish to trap so that I can prevent the right click menu from appearing. I'm using Office 2000. Thanks

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    COM

  • Excel automation highlight issue
    T TClarke

    Thanks for the response. Adding text as you have done seems to change it somewhat. Unfortunately, I'm dealing with read only files and as such I'm only trying to highlight what's already present. The call to Select() doesn't highlight the content, only the outline of the cell :( Thanks though

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    COM help com testing tools tutorial

  • Excel automation highlight issue
    T TClarke

    Hi all, I'm automating Excel from within an ActiveX control and I'm wondering if anyone knows how to highlight the contents of a cell. I'm writing a specialised search routine and I have no problem finding the cells I want but when I select them only the perimeter of the cell gets highlighted. I'm after being able to highlight the contents but haven't found what I need in the type library. Recording a macro didn't throw any light on the issue either. Thanks in advance for any ideas.

    Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.

    COM help com testing tools tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups