Search found 62 matches

by wpb
19 Feb 2016, 10:06
Forum: Ask For Help
Topic: Nested class inheritance
Replies: 4
Views: 1490

Re: Nested class inheritance

I spent ages creating a more concrete example of what I mean only to find that lexikos is of course right, and that I can actually instantiate the object of the nested class via the object that called it, and if the derived class also extends the nested class, I'll get an object of the derived type,...
by wpb
19 Feb 2016, 07:11
Forum: Ask For Help
Topic: Difference between instance variables and "this." variables created inside __New()
Replies: 3
Views: 1840

Re: Difference between instance variables and "this." variables created inside __New()

Thank you both for your insights. I appreciate you taking the time to clarify things.
by wpb
19 Feb 2016, 07:09
Forum: Ask For Help
Topic: Ultramon causes AHK to fail to control 3rd party windows fully
Replies: 0
Views: 521

Ultramon causes AHK to fail to control 3rd party windows fully

I have UltraMon installed (https://www.realtimesoft.com/ultramon/). When I enable a secondary monitor, it causes a script I have been using for some time to fail. The script controls a third-party application by writing to its controls, etc., using standard AHK commands like WinSetTitle and ControlS...
by wpb
16 Feb 2016, 18:01
Forum: Ask For Help
Topic: Nested class inheritance
Replies: 4
Views: 1490

Re: Nested class inheritance

Thanks, kon. You may be right - I will experiment. If so, it makes having a complex abstract base class quite a pain. In my actual code, the equivalent of MyNestedClass contains its own nested class. That class has code which returns objects of a type that is nested within the base class and also in...
by wpb
16 Feb 2016, 15:41
Forum: Ask For Help
Topic: Nested class inheritance
Replies: 4
Views: 1490

Nested class inheritance

Class MyBaseClass { ; Has a nested class Class MyNestedClass { __New() { this.SomeData := [5,4,3,2,1] } } } Class MyDerivedClass extends MyBaseClass { ; Inherits MyNestedClass? } obj1 := new MyDerivedClass() obj2a := new obj1.MyNestedClass() MsgBox % obj2a.__Class ; MyBaseClass.MyNestedClass obj2b ...
by wpb
15 Feb 2016, 06:54
Forum: Ask For Help
Topic: Difference between instance variables and "this." variables created inside __New()
Replies: 3
Views: 1840

Difference between instance variables and "this." variables created inside __New()

Is there any difference between the following? Class MyClass { __New() { this.MyArray := Object() return this } } Class MyClass { MyArray := Object() } Both are instance variables, only created when _New() is called, as far as I can see from the documentation. In the second example, MyArray doesn't ...
by wpb
15 Feb 2016, 06:26
Forum: Ask For Help
Topic: Object syntax enclosed in percent signs %obj.member%
Replies: 2
Views: 645

Re: Object syntax enclosed in percent signs %obj.member%

Ah, thank you. I mistakenly thought that the single % sign affected the remainder of the arguments of a command on the line, not just the current one. That's brilliant then! Many thanks.
by wpb
15 Feb 2016, 06:18
Forum: Ask For Help
Topic: AHK Progress command's progress bar seems misaligned
Replies: 4
Views: 932

Re: AHK Progress command's progress bar seems misaligned

Ah, is see the bar reaches the end when the script is forced to stay resident, but "Number 149" (FullRange) is reached quite a while before that happens. So in fact that whole thing is delayed, is that the idea? Is there an easy workaround, or do I have to use an alternative type of progress indicat...
by wpb
15 Feb 2016, 06:11
Forum: Ask For Help
Topic: Object syntax enclosed in percent signs %obj.member%
Replies: 2
Views: 645

Object syntax enclosed in percent signs %obj.member%

For some commands, eg. Progress, it seems that expression syntax isn't supported: Progress, % number, "Text here" (Doesn't fail, but the % doesn't seem to be interpreted.) So you are left with so-called "command syntax": Progress, %number%, Text here That's fine, but if you want to use object syntax...
by wpb
15 Feb 2016, 05:56
Forum: Ask For Help
Topic: AHK Progress command's progress bar seems misaligned
Replies: 4
Views: 932

AHK Progress command's progress bar seems misaligned

FullRange := 149 Progress, R0-%FullRange%, Number %A_Index%, We'll see..., Progress? Loop % FullRange { Progress, %A_Index%, Number %A_Index% Sleep, 50 } It looks like the progress bar doesn't quite reach the end. It also looks like it starts a little "late". So perhaps the progress bar code isn't ...
by wpb
15 Feb 2016, 01:51
Forum: Ask For Help
Topic: Extending a nested class
Replies: 4
Views: 834

Re: Extending a nested class

Yeah, I've been doing that a lot up to now, and then using arrays of associative arrays to build up databases of information, which is basically the start of an object model and AHK's dot syntax lets you treat it all like objects anyway. In fact, there seems to be very little difference. But in my c...
by wpb
15 Feb 2016, 01:30
Forum: Ask For Help
Topic: Getting a menu name from its handle
Replies: 20
Views: 3385

Re: Getting a menu name from its handle

Lexikos - if I'm reading the changelog correctly on the latest AHK release build, I think you added a function to look up a menu name from its handle. Thank you very much - that will tidy up my code no end! Your obvious hard work is much appreciated.
by wpb
15 Feb 2016, 01:26
Forum: Ask For Help
Topic: Extending a nested class
Replies: 4
Views: 834

Re: Extending a nested class

Thank you for your reply. I was just doubting myself. I come from a C++ OOP background, and I'm finding it hard to get my head around the way things work in AHK. Extending classes feels largely academic at the moment, because, eg., in the above example Encyclopaedia.Page would happily accept assignm...
by wpb
14 Feb 2016, 16:06
Forum: Ask For Help
Topic: Extending a nested class
Replies: 4
Views: 834

Extending a nested class

Class Book { ; Nested class Book.Page Class Page { } } Class Encyclopaedia extends Book { Class Page extends Book.Page { } } Does this correctly extend Book.Page? Will Encyclopaedia.Page inherit all of Book.Page's members as expected? And is it okay to call it "Page", because it's Encyclopaedia.Pag...
by wpb
14 Feb 2016, 12:32
Forum: Ask For Help
Topic: Array members of a class behaving strangely
Replies: 2
Views: 494

Re: Array members of a class behaving strangely

Argh! Thank you!

Unbelievably, not only did I make this mistake in my original script that I'm writing, but when I produced the little code fragment above for posting here, I made the SAME mistake! And it's not like I don't know that's wrong. Anyway, kind of you to point it out.
by wpb
14 Feb 2016, 09:12
Forum: Ask For Help
Topic: Array members of a class behaving strangely
Replies: 2
Views: 494

Array members of a class behaving strangely

Could someone tell me what I'm doing wrong, please? ; The following works as expected... Data := Object() Loop % 3 Data[A_Index] := "Test" . A_Index MsgBox % Data[1] " - " Data[2] " - " Data[3] ; The following doesn't... Class Something { Data := Object() } s = new Something() s.Data := Object() Loo...
by wpb
30 Jan 2016, 05:43
Forum: Ask For Help
Topic: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text
Replies: 10
Views: 1392

Re: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text

Okay, thanks for confirming. I hadn't realized there was no unsigned 64-bit int type. I guess I'll just have to imagine a negative address space!

Also, huge thanks for your pointers about this whole issue. I now have it working, which is great.
by wpb
29 Jan 2016, 21:35
Forum: Ask For Help
Topic: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text
Replies: 10
Views: 1392

Re: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text

To respond in reverse-order... NumPut(&TextBuf, strTextRange, 8, "UPtr") You did get my point that &SomeVar is not going to work with a remote process, right? Very sharp! :roll: I just threw that in to make sure you're awake. I have it working now, and am using the result of a call to VirtualAllocEx...
by wpb
29 Jan 2016, 08:31
Forum: Ask For Help
Topic: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text
Replies: 10
Views: 1392

Re: SCI_GETTEXTRANGE fails to retrieve Scintilla control's text

Quick follow-up question - is the pointer to the remote buffer going to be 32 bit or 64 bit? In other words, when I do this: NumPut(StartPos, strTextRange, 0, "UInt") NumPut(EndPos, strTextRange, 4, "UInt") NumPut(&TextBuf, strTextRange, 8, "UPtr") Is that last NumPut going to occupy bytes 8-11, or ...

Go to advanced search