render-with-notepad icon indicating copy to clipboard operation
render-with-notepad copied to clipboard

Error: Pattern not found -- in Ray Tracing

Open epic-guy opened this issue 4 years ago • 6 comments

raw

It gives me this error, the notepad opens well and the program starts writing lines, then it stops as the error appears. Am I missing something or doing anything wrong?

I opened the repo is VS and Built the project from the source and ran the exe file with the path to the notepad as it's parameter.

I'm using windows 7,64x bit 8 gb of RAM and GEFORCE graphics card

epic-guy avatar May 20 '20 18:05 epic-guy

Had the same problem with both Raytracing and Snake

saxobroko avatar May 21 '20 01:05 saxobroko

Likely need to use System32 instead of system32 (@epic-guy @saxobroko). Copy the full path for notepad.exe for good measure (i.e. RayTracer.exe C:/Windows/System32/notepad.exe)

lloydtao avatar May 21 '20 19:05 lloydtao

@LloydTao Nope, that did not work, same error woo my point is that, the notepad is detected and opened, but later it just says the error after writing some 4 lines

epic-guy avatar May 22 '20 06:05 epic-guy

This looks like it's timing issue, if it's outputting "pattern not found" before it finishes filling the notepad screen. I have a hardcoded wait in the code, but you may need to adjust that duration for your machine (or do something more intelligent with it).

Right now what looks like is happening is that your machine is looking for the byte pattern for the entire window, but at the time of searching, notepad's on screen text buffer only has a subset of them.

khalladay avatar May 22 '20 17:05 khalladay

@khalladay if this aint too much to ask, can u tell me which line u have defined the wait code? atleast which file, might me good enough

epic-guy avatar May 22 '20 18:05 epic-guy

https://github.com/khalladay/render-with-notepad/blob/master/Render-With-Notepad/RayTracer/notepad_frontend.cpp , line 192.

Just change the Sleep call to something like Sleep(30000) and see if it fixes it (bearing in mind that this will pause the program for 30s, so your notepad window might fill and then hang out for a bit before it tries to acquire the pattern).

khalladay avatar May 23 '20 00:05 khalladay