Search found 47 matches

by sw
Wed Sep 09, 2020 10:05 am
Forum: C++ Development
Topic: How to specify format for wxAutomationObject date property
Replies: 2
Views: 173

Re: How to specify format for wxAutomationObject date property

It was a PEBKAC error...

I did not realize I could get a wxDateTime on the wxVariant. Thank you for your help @PB
by sw
Wed Sep 09, 2020 8:06 am
Forum: C++ Development
Topic: How to specify format for wxAutomationObject date property
Replies: 2
Views: 173

How to specify format for wxAutomationObject date property

I am reading meetings from Outlook using wxAutomationObject's and one of those properties is a DateTime, so to speak (it comes as a string). The problem is that when reading it via wxAutomationObject.GetProperty, the format of date comes out as so: Mon Sep 7 12:00:00 2020 The equivalent VBA code (ru...
by sw
Wed Sep 02, 2020 9:55 am
Forum: C++ Development
Topic: wxStaticText not centering in dialog after other control hidden
Replies: 2
Views: 255

Re: wxStaticText not centering in dialog after other control hidden

Thank you @doublemax!

Calling Layout() at the end of the code resolved the problem
by sw
Tue Sep 01, 2020 6:49 pm
Forum: C++ Development
Topic: wxStaticText not centering in dialog after other control hidden
Replies: 2
Views: 255

wxStaticText not centering in dialog after other control hidden

I am trying to center a wxStaticText on a wxDialog after a control (wxActivityIndicator) was hidden. The problem is that if adding the wxStaticText after having started and stopped the wxActivityIndicator and then hiding it, the wxStaticText gets placed in the top left corner of the wxDialog. But I ...
by sw
Mon Aug 24, 2020 9:25 pm
Forum: C++ Development
Topic: wxAutomationObject CoInitialize has not been called error in wxThread
Replies: 5
Views: 250

Re: wxAutomationObject CoInitialize has not been called error in wxThread

@PB Thank you for your assistance though :) @doublemax It was indeed the context! I don't understand why the constructor and Entry() run in a seemingly different contexts, but calling wxOleInitialize() in Entry() did not throw any errors and worked as expected. I presume you meant OnExit()? And in O...
by sw
Mon Aug 24, 2020 12:50 pm
Forum: C++ Development
Topic: wxAutomationObject CoInitialize has not been called error in wxThread
Replies: 5
Views: 250

Re: wxAutomationObject CoInitialize has not been called error in wxThread

Oh, that makes sense. I didn't know wxWidgets would initialize it for you. Thus I have added wxOleInitialize() and wxOleUnitialize() in my wxThread class constructor and destructor, respectively, and I still get the same error. Calling the actual Windows functions (OleInitialize() and OleUninitializ...
by sw
Mon Aug 24, 2020 9:34 am
Forum: C++ Development
Topic: wxAutomationObject CoInitialize has not been called error in wxThread
Replies: 5
Views: 250

wxAutomationObject CoInitialize has not been called error in wxThread

When using a wxAutomationObject in a wxThread it fails with the following error: "(caller: 7503540B) ReturnHr(1) tid(c79c) 800401F0 CoInitialize has not been called." This is coming from the combase.dll. This happens with GetInstance() and CreateInstance() However, running the same code on the main ...
by sw
Sun Aug 09, 2020 9:05 pm
Forum: C++ Development
Topic: Overlay and center wxActivityIndicator over all other widgets
Replies: 1
Views: 151

Overlay and center wxActivityIndicator over all other widgets

As per the title, how can I get a wxActivityIndicator to be the foremost control in a wxDialog-derived window? The wxDialog window has a wxCalendarCtrl and wxDataViewCtrl in it and I'm trying to get a wxActivityIndicator to render on top of those controls and center it in the wxDialog window. Once t...
by sw
Wed Jul 22, 2020 4:05 pm
Forum: C++ Development
Topic: wxAutomationObject Outlook call method results in invalid object (wxVariant)
Replies: 7
Views: 407

Re: wxAutomationObject Outlook call method results in invalid object (wxVariant)

It displays the correct object types for me now too.

But earlier, I was missing the Logon call so maybe that messing with the objects somehow?

Or it is possible that I'm logging too many things and interpreted the wrong thing...
by sw
Wed Jul 22, 2020 1:02 pm
Forum: C++ Development
Topic: wxAutomationObject Outlook call method results in invalid object (wxVariant)
Replies: 7
Views: 407

Re: wxAutomationObject Outlook call method results in invalid object (wxVariant)

The code was correct all along #-o That being said, the LCID by default was 0x800 and I couldn't find any info about 0x800. Outlook is running in 0x409 (en-us) so I set my C++ code to do the same. My Outlook has two work emails. In VBA code, I was using the second one which tends to get more traffic...
by sw
Wed Jul 22, 2020 7:42 am
Forum: C++ Development
Topic: wxAutomationObject Outlook call method results in invalid object (wxVariant)
Replies: 7
Views: 407

Re: wxAutomationObject Outlook call method results in invalid object (wxVariant)

I went further up into my code and added some more logging and I see all object variants (which I expect to contain IDispatch) are getting logged like so variant type: "IDispatch - <Invalid object>", value: "00CCEA8C", name: "". variant type: "IDispatch - <Invalid object>", value: "00CCEB64", name: ...
by sw
Wed Jul 22, 2020 7:32 am
Forum: C++ Development
Topic: wxAutomationObject Outlook call method results in invalid object (wxVariant)
Replies: 7
Views: 407

Re: wxAutomationObject Outlook call method results in invalid object (wxVariant)

Retrieving the Count property returns Int.Max - 1 (2147483647). I get the same result in VBA too. Ok, let me try stepping into wxAutomationObject code and try to figure out what's happening in there... I think I'll use that as a last ditch attempt if I don't come right with wxAutomationObject. I'm k...
by sw
Tue Jul 21, 2020 9:36 pm
Forum: C++ Development
Topic: wxAutomationObject Outlook call method results in invalid object (wxVariant)
Replies: 7
Views: 407

wxAutomationObject Outlook call method results in invalid object (wxVariant)

I am writing this VBA code into wxAutomationObjects // omitted... strFilter = "[Start] <= '2020/07/21 23:59' AND [End] >= '2020/07/21 00:00'" Debug.Print strFilter Set olTodayCalendarItems = olCalendarItems.Restrict(strFilter) Set olItem = olTodayCalendarItems.GetFirst() Do While Not olItem Is Nothi...
by sw
Mon Jul 13, 2020 10:03 pm
Forum: C++ Development
Topic: Access array data in wxVariant from wxAutomationObject call
Replies: 4
Views: 314

Re: Access array data in wxVariant from wxAutomationObject call

Thank you for the detailed response! Yes, after reading a bit more through the Outlook VBA documentation I understand that a bit more. Yeah, your suggestion to use the official documentation and playing around in the Office built-in VBA IDE is useful and easier to get a working solution and then por...
by sw
Sun Jul 12, 2020 8:26 pm
Forum: C++ Development
Topic: Access array data in wxVariant from wxAutomationObject call
Replies: 4
Views: 314

Re: Access array data in wxVariant from wxAutomationObject call

I realize I used wxWidgets and Microsoft terminology interchangably and I'm still getting to grips with OLE. Apologies. Yes, we are talking about Folder.Items And I missed the fact that it is a Object property... So Items is actually a Folders object type correct? Because the Count property exists o...