Search found 4300 matches

by jeeswg
Today, 11:50
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

nnnik wrote:Well I guess I never mentioned that you need to use VarSetCapacity to initialize data in them then.
Did you fix this yet? Can you explain what you meant. Thanks.
by jeeswg
Today, 11:16
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

- Add VarSetCapacity to the script? Add a VarSetCapacity C++ equivalent to the C++ code? - Any ideas re. what's causing the access violation? It seems that a lot of users have had that error when using machine code, but never got a response on the forum. Thanks. - Or what, is 'char *str', a pointer,...
by jeeswg
Today, 07:35
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

Factorial - Wikipedia https://en.wikipedia.org/wiki/Factorial Fakultät (Mathematik) – Wikipedia https://de.wikipedia.org/wiki/Fakult%C3%A4t_(Mathematik) Thanks, Google Translate didn't suggest it. And searches for mathematics and Fakultät just gave me faculties (institutions).
by jeeswg
Today, 07:29
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

- @nnnik: Yes. Where did you come across this function: MyFunction(a-1,b*a), you call it the 'faculty' function, do you have a reference for it in German/English? Thanks. - [EDIT:] Looking at it again the function pointer stuff looks like it could be relevant, but from reading the tutorial I'm not c...
by jeeswg
Today, 07:20
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

- If 15 works but 16 doesn't, that suggests that *something* can only handle a nibble (4 bits of information). Although some of my other functions suggested that there is no limit of 16.
- I looked through a tonne of links: AutoHotkey mcode "access violation", I didn't find any solution.
by jeeswg
Today, 06:50
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

Helgef wrote:It works as I expect, it returns 20 and initialises the char array as: 0, 1 ... 19
So it worked for you didn't it?

The error 0xc0000005 is access violation, suggesting a problem reading/writing data, however, the 1st of 4 stringedit examples successfully wrote to the first 20 bytes.
by jeeswg
Today, 04:59
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

YES. OK Helgef, here we are. As you imply, if I comment out the AStr line, I get the 52 for the other lines that I was expecting. AStr is *modifying* the string. Hmm, it's a surprise that AStr is modifying the string, however! I had thought that AHK would create a temporary variable based on vText, ...
by jeeswg
Yesterday, 21:35
Forum: Ask For Help
Topic: Loop through all instances of a class
Replies: 7
Views: 98

Re: Loop through all instances of a class

- Just thought I'd mention that some of this information is visible when you do ListVars. - So for a quick-and-dirty script you could grab the ListVars text and parse it, and put each pointer into the Object function, to then operate on the instance. - To grab that information without displaying the...
by jeeswg
Yesterday, 19:46
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

- There are some basic examples here, but the 4th one isn't working. - All 4 compile, but the last one doesn't seem to have an effect, or return a value. C++ int stringedit(char *str) { int i=0; for (; i<20; i++) str[i]=3; return i; } int stringedit(char *str) { int i=0; for (; i<20; i++) str[0]=i; ...
by jeeswg
Yesterday, 17:41
Forum: Bug Reports
Topic: 1.1.29.00 Display Issue
Replies: 7
Views: 124

Re: 1.1.29.00 Display Issue

- Here's the issue, you can put a space between the object name and the first square bracket. - If you use a literal string for the object name, it refers to the base object for strings. q:: ;get value from object/string "".base.__get := "f" Arr := {"A": {"B":...
by jeeswg
Yesterday, 09:04
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

- Thanks, I've fixed it. My repnulls function is now working. - [I hadn't double-checked that function yet because the stringlen function still wasn't(/isn't) working.] - However, I still haven't got the stringlen function working. - I've looked through what you've said carefully, multiple times. Ap...
by jeeswg
Yesterday, 08:55
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

- @Helgef: Thanks. Sorry but I'm still unclear. - Ignoring AStr/WStr for the moment. My thoughts are these: if I use Ptr and &var, the function should receive a pointer to the start of the string, and loop through each byte. If it's a 26-char Unicode string with no null bytes inside of it, that'...
by jeeswg
Yesterday, 08:32
Forum: Ask For Help
Topic: Simple File Explorer Fix
Replies: 8
Views: 196

Re: Simple File Explorer Fix

- This slightly altered script should be easier to understand: #Persistent ;EVENT_SYSTEM_FOREGROUND := 0x3 DllCall("user32\SetWinEventHook", UInt,0x3, UInt,0x3, Ptr,0, Ptr,RegisterCallback("OnExplorerActive"), UInt,0, UInt,0, UInt,0, Ptr) ;plays a sound every time an Explorer win...
by jeeswg
24 May 2018, 23:53
Forum: Ask For Help
Topic: Copy file name from inactive window title Topic is solved
Replies: 4
Views: 57

Re: Copy file name from inactive window title Topic is solved

One way:

Code: [Select all]GeSHi © Codebox Plus

q:: ;get active window title (a path is expected), split path to get name/name no ext
WinGetTitle, vWinTitle, A
SplitPath, vWinTitle, vName, vDir, vExt, vNameNoExt, vDrive
MsgBox, % vName
MsgBox, % vNameNoExt
return
by jeeswg
24 May 2018, 22:28
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

Re: C++: C++ to machine code via TDM-GCC

- A further point: - Why do WStr and Ptr not work here as expected? ;stringlen := MCode("2,x86:i0wkBDPAOAF0B0CAPAgAdfnD,x64:M8A4AXQKSP/B/8CAOQB19vPD") ;equivalent to line below stringlen := MCode("2,x86:i1QkBDHAgDoAdBCQjXQmAIPAAYA8AgB19/PD88M=,x64:gDkAdBpIg8EBMcAPH0QAAEiDwQGDwAGAef8Ad...
by jeeswg
24 May 2018, 18:59
Forum: Ask For Help
Topic: Simple File Explorer Fix
Replies: 8
Views: 196

Re: Simple File Explorer Fix

Here's a script which plays a sound every time an Explorer window is activated. #Persistent ;plays a sound every time an Explorer window is activated OnExplorerActive(hWinEventHook, vEvent, hWnd) { ;EVENT_SYSTEM_FOREGROUND := 0x3 static _ := DllCall("user32\SetWinEventHook", UInt,0x3, UInt...
by jeeswg
24 May 2018, 18:11
Forum: Ask For Help
Topic: Code won't type letters Topic is solved
Replies: 7
Views: 149

Re: Code won't type letters Topic is solved

tRy ThIs. ChEeRs. ;switch between upper/lower case letters when typing lower case letters ;put at the top the of script (in the auto-execute section) Loop, 26 Hotkey, % "$" Chr(96+A_Index), SubInvertLetter return ;q:: ;w:: ;e:: SubInvertLetter: vLetter := SubStr(A_ThisHotkey, StrLen(A_This...
by jeeswg
24 May 2018, 16:14
Forum: Scripts and Functions
Topic: MCode4GCC -- C/C++ to MCode Generator
Replies: 48
Views: 7619

Re: MCode4GCC -- C/C++ to MCode Generator

I've tried to create a stand-alone script for C++ to machine code:

C++: C++ to machine code via TDM-GCC - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=23&t=49554
by jeeswg
24 May 2018, 16:07
Forum: Other Programming Languages
Topic: C++: C++ to machine code via TDM-GCC
Replies: 22
Views: 305

C++: C++ to machine code via TDM-GCC

Based on the code and tutorials here (thanks joedf and nnnik): MCode4GCC -- C/C++ to MCode Generator - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=6&t=4642 MCode Tutorial (Compiled Code in AHK) - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=7&t=32...
by jeeswg
24 May 2018, 12:57
Forum: Scripts and Functions
Topic: MCode4GCC -- C/C++ to MCode Generator
Replies: 48
Views: 7619

Re: MCode4GCC -- C/C++ to MCode Generator

- Hmm, so I used gcc and it produced machine code that works with both x64 and x32. Cf. the examples which were about half as long, and were either x64 or x32 only. - Do you mean to replace 'gcc' with 'gcc -m64'/'gcc -m32' in the GUI, or to edit the 'flags' variable in the script directly. (Since th...

Go to advanced search