Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DispIds, implement InputBox fake, remove dead TestRunner code.
- Loading branch information
Showing
11 changed files
with
96 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using Rubberduck.Parsing.ComReflection; | ||
|
||
namespace Rubberduck.UnitTesting | ||
{ | ||
internal class InputBox : FakeBase | ||
{ | ||
private static readonly IntPtr ProcessAddress = EasyHook.LocalHook.GetProcAddress(TargetLibrary, "rtcInputBox"); | ||
|
||
public InputBox() : base (ProcessAddress) | ||
{ | ||
InjectDelegate(new InputBoxDelegate(InputBoxCallback)); | ||
} | ||
|
||
[UnmanagedFunctionPointer(CallingConvention.StdCall, SetLastError = true)] | ||
[return: MarshalAs(UnmanagedType.BStr)] | ||
private delegate string InputBoxDelegate(IntPtr prompt, IntPtr title, IntPtr Default, IntPtr xpos, IntPtr ypos, IntPtr helpfile, IntPtr context); | ||
|
||
public string InputBoxCallback(IntPtr prompt, IntPtr title, IntPtr Default, IntPtr xpos, IntPtr ypos, IntPtr helpfile, IntPtr context) | ||
{ | ||
OnCallBack(); | ||
|
||
TrackUsage("prompt", new ComVariant(prompt)); | ||
TrackUsage("title", new ComVariant(title)); | ||
TrackUsage("default", new ComVariant(Default)); | ||
TrackUsage("xpos", new ComVariant(xpos)); | ||
TrackUsage("ypos", new ComVariant(ypos)); | ||
TrackUsage("helpfile", new ComVariant(helpfile)); | ||
TrackUsage("context", new ComVariant(context)); | ||
|
||
return ReturnValue?.ToString() ?? string.Empty; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.