OutputDebugString() does not work on Windows 7x64 - windows-7-x64

My program works great with windows xp. I am trying to add some more functionality and using OutputDebugString() to show some debug information. works flawlessly on XP. Now when i want to use the same program on windows 7x64. I dont see any output in DebugView.
F1! F1! F1!

Sorry for reviving an old question, but we spent a good couple of days searching the internet to answer this one and eventually ended up logging a connect call. I am posting here to help anyone else in the same situation. Our specific problem was getting the output from OutputDebugString, MFC TRACE etc in the debug output window when debugging an x64, mixed mode application.
According to Microsoft, apparently for debugging x64 mixed mode applications the debugger type of 'auto' (set in the Debugging->Debugger Type property page) defaults to managed rather than mixed. This will need to be explicitly set to 'Mixed' for both managed and native debug output to be seen when debugging a 64 bit build.

There are a number of reasons why this may or may not work. I accidentally disabled this -- here are all the things you need to check to get this working:
Is the debug output text getting redirected from the Output pane to the Immediate pane, thus you are not seeing it? To turn this off:
Debug
Options and Settings
[ ] Redirect all Output Windows text to the Immediate Window
Is the Output pane visible?
Debug
Windows
Output
In the Output pane do you have Program Output enabled?
Debug
Windows
Output
Right-Click anywhere inside the pane
[x] Program Output
Do you have the right Debugging Type selected?
In the Solution Explorer (View > Solution Explorer) pane
Right-click on your project
Properties
Debugging
Debugging Type: change from Auto to either Native or Mixed
Is the debugger tried to get attached before the program has started? To turn Attach off:
In the Solution Explorer (View > Solution Explorer) pane
Right-click on your project,
Properties
Debugging
Attach: change to No
Are you using OutputDebugStringW()? Try using OutputDebugStringA() instead.
Lastly, did you start the program in debugging mode? :-) Hey, you never know!
Debug
Start Debugging (F5)
I hadn't seen a comprehensive list before so the above are all the things I had to verify were set correctly.

3 small suggestions:
make sure you are actually capturing events (top menu -> capture -> capture win32 is marked)
if you program is running in low integrity (does it give a security warning when you are running it) you need to run debug view in low integrity as well. to do that you need to change the integrity level of dbgview.exe before running it.
if you are using visual studio and running with debugger (pressed F5) then the debug output is actually captured by visual studio (in the output window). try running your program with ctrl f5.

Related

Need clarification on vs code debug

Can anyone explain these three debug symbols on VSCode I have found on the internet?
My vs code has the one with the play icon.
All demos online on debugging have the one in the middle. How do I get that?
Also, node js debugging is installed but I think it shows as disabled, with no option I can find to enable it.
To answer your question directly [TL;DR]: you already have it if you are using the latest version of vscode. It will take you to the same view as the one on the right
If you look at the codicon libray ref the middle one you pointed out is not present.
Visual Studio Code made changes in February 2020 ref that incorporates running and debugging to be something more harmonious:
User studies revealed that new users have difficulties finding how to run their programs in VS Code. One reason is that the existing "Debugging" functionality is not something that they relate to "Running" a program. For that reason, we are making "Run" more prominent in the UI.
The main menu Debug has become the Run menu.
The Run and Debug view has become the Run view and the corresponding Activity Bar icon now shows a large "Play" icon with a small "bug" decoration.
So in other words, there is no difference. The 'Run' and 'Debug' view is synonymous and the icon reflects those changes. As they noted, the Debug view is now called the 'Run' view, but it still offers debugging and breakpoints.
There are 2 possibilities you are running into however:
The tutorials and guides you are using are out-dated (showing an outdated version of vscode)
The tutorial or guide is using an extension that offers debugging capabilities. Extensions have some control over the icon you see
The extension is for single file debugging, according to the June 2020 ref notes, vscode recommends the following:
For debug extensions that want to improve the single file debug experience by adding a "Run" and/or "Debug" button to the editor, we recommend following these guidelines for a consistent look and feel:
Contribute Run and/or Debug commands in the package.json (see Mock Debug):
Use the command titles "Run File"/"Debug File" or "Run Python File"/"Debug Python File".
Use the $(play) icon for Run and $(debug-alt-small) for Debug.
Where their codicon library was updated in June to reflect the following:
As you can see, none of them are prefixed with verbiage like 'run', but they all represent the same functionality.
Additionally, you may see this icon as well:
This represents the panel (view) where the output of your debug will go.

Flash not running debugger any more. Possible socket issue in Windows-10?

Bounty Update
I am leaving the question essentially the same, but I just want to point out at the beginning here that I'm most interested in help trying to get the socket between flash (Adobe Animate) and the native debugger working again, as I believe that is the issue I'm having. Or is it a socket between flash and Windows?
Original Question
I've apparently turned something off? Even when I write really bad code (like trying to call a function that isn't there or divide an integer into a fraction), the flash player boots, shows a background color and stops there. No messages in the output window or compiler errors window. If I fix my code, it all runs fine, but for about 30 minutes (ever since I started trying to work with bitmaps for a sprite sheet) I get no runtime errors no matter what kind of mistake I type in my code. Anyone know how to turn it back on?
I've checked my actionscript settings and I have both warning mode and strict mode checked on.
Could it be a socket issue? I admit I have little to no experience working with sockets and only a surface understanding of what that even means. I've added the socket tag. If someone can see that this is clearly nothing to do with sockets, by all means, I'll remove the tag.
UPDATE: 6/22/16
I just reinstalled Adobe Animate CC 2015.2 and no change. I'll try compiling it in flash builder when I get a chance to help pigeon hole the problem. (Edit 6/24: flash builder worked! But my trial version expired the next day so is no longer a viable option).
And I just tried something in the command prompt in Windows 10 as an administrator:
netsh winsock reset catalog
netsh int ip reset reset.log hit
which I found another user on flashdevelop.org used to fix a similar issue, but no change.
And I just tried debugging in Flash Builder. It worked fine (debugger caught bugs) but my trial version expired the next day.
update 6/24
I've tried launching debugger for AIR from within the Adobe Animate CC IDE and it works fine if there are no bugs; it fails to do anything visible (no Iphone emulator, no swf window) if I put a typo or error in the code.
I also just deleted winsock and winsock2, rebooted Windows, then reinstalled winsock and winsock2. No change.
update 6/25
Just tried a system restore in Windows to set all my files and settings and drivers etc. to the way it was a week and a half ago... Also completely uninstalled all Adobe products and reinstalled. No change. I can only imagine that wiping my hard drive and reinstalling Windows would do the trick, but come on, it hasn't come to that has it?
As VC.One suggested, I checked the compile error window (cannot believe I didn't check before! Maybe when I checked before there were no compile errors... Only runtime errors?) and the errors are showing up there. Does this mean that it's catching compile errors but just not runtime errors?
When you force/test a runtime error... make sure you check
Compiler Errors (ALT+F2) and also Output (F2). By Output I mean the window that shows traces (and runtime issues). One of those two should have some feedback for you.
A possible solution is to save a new Workspace. So with those windows for Compiler Errors and Output both open (or tabbed, I tab them next to my Timeline) go to Window (in top options like File/Edit/Debug etc) and choose Workspace, then into that you choose New Workspace. Give it a name in the pop-up and okay everything.
Flash should always load that current workspace (next time, go to Workspace option again, check that your specified workspace [by name] has a tick next to it...).
Possible pitfalls:
1 - Use the debug player
2 - Make sure there isn't somewhere a try/catch enclosing the portion of code that triggers the event that may lead to an error
3 - Socket issue: may be exported in debug mode but swf cannot connect to debugger (it waits in a blank state for 60 seconds I guess)
4 - Does it compile ok? If there are compilation errors you may get an SWF anyway but then it will not start
...

Vscode attach debug output window

I do not want Vscode to open up another window while debugging. Is there a way to attach this window inside the IDE?
If the above is impossible, is there a way to choose a more usable terminal? The default terminal doesn't allow for text selection which makes it unacceptable.
Since VSCode is not an IDE, we do not have a built-in terminal.
I tried the terminals on OS X, Linux, and Windows. They all allow me to select and copy text (however on Windows it is through the 'Edit' > 'Mark' mechanism).
Andre Weinand, Visual Studio Code
The vscode forums have a request for an integrated terminal with a number of upvotes, i'd advise adding your voice to the chorus.
It's a must to output the debug console writes to an attached panel in Visual Studio Code. Click an highlight a word in the debug output console text to do a global project search to find all code containing that string. A common thing like tagging error blocks with a unique ID that gets output to the console when the error happens. Full text search of the project source code tree for the ID...

Are there more explicit commands/toolbars and feedback for Eclipse for Android?

I'm new to Eclipse. I may need a better understanding or a plugin that would provide me with features described below. While doing some Android development, and I while making changes to my code at one point Eclipse warned me that this emulator doesn't support hot-swapping and if I want to disconnect. I'm used to see status in either the toolbar or in some log from Visual Studio. Is there a way to see this feedback in Eclipse?
My problem is that there are quite much implicit stuff in eclipse I would like get feedback of and control, like whether I'm
connected or not to a device,
if I'm attached to a process on it or not with debugger,
some kind of build log with a timestamp so I know it happened,
the automatic uninstalling and installing of the project on the device
which project is "active" ("featured") in "Run" and "Debug" buttons/configurations
Is there a plugin that can give me explicit commands over these automatic features? Like a toolbar or command. What I would expect of this tool:
be able to indicate the current status (eg. currently connected or not)
gives me control to eg. connect
gives me control to eg. disconnect
Preferably on a toolbar, as I know some of these are available as menu commands.
Furthermore I tried to configure my toolbar by Window menu -> Customize perspective..., but pin-pointing the features I want made my Eclipse put empty space up for the buttons I disabled, and next time I got to the same config screen it got the checkboxes wrong and displayed some stuff active what was actually disabled.

Eclipse PyDev completion hangs (yet again)

I'm using PyDev in Eclipse as my Python editor. It's fine in terms of feature set. Everything works fine except for one very annoying thing:
Code completion itself works fast. When I press Alt+Space, the window pops out almost instantly and all the options are there. The option at the top is selected. Then comes the trouble. The detailed description won't appear until about 5-10 seconds. All this time CPU is working at maximum load and the interface is not responding. All the processor is consumed by the Eclipse Java process (the spawned Python process seems idle). Then a yellow window pops up, and all it contains is just a Python code of a selected function/variable. All consecutive details are displayed instantly. The procedure repeats when I close the completion window (for example by accepting one of the options and asking for completion again). This drives me crazy.
I've tried so far:
creating a whole new workspace,
creating an Eclipse/PyDev project from scratch,
tweaking JVM to make sure it has loads of memory,
making sure the right JVM is chosen (the latest Oracle JVM available),
making sure Python process communicates freely with the Java instance (I read about possible problems with that, but it seems not to be the issue).
making sure all the installed plugins are up to date.
The version I use is Eclipse Helios, because the last time I checked certain extensions weren't yet ported to the latest one.
Has anyone observed a similar issue? Was anyone able to get around it? General ideas on how to debug it and file a sensible bug report possibly? Other things worth checking for.
Any workaround less drastic than turning completion off completly?
Thanks!
EDIT:
I've also noticed a problem with a similar popup window in HTML/CSS editor. It looked somewhat similar (a yellow window, with some text inside) and it also took ages to display. Don't really know if that is related, but could be.
EDIT(2):
Ok, No I've started with a fresh install of the newest Eclipse Indigo, without any additional plugins apart from PyDev and the issue remains. Seems like I'll have to look for a new IDE.
What version of Java are you using?
If you are on Windows 7, later versions of Java (I think 6+) will default to IPv6.
This is probably causing the problem as Python maybe wanting IPv4.
Anyway, since I had this problem I tried disabling
PyLint
Code Analysis
but it was still hanging.
Pal's answer about "ipv4 utilization" triggered my memory about another problem I had solved by "preferring" IPv4.
See http://docs.oracle.com/javase/1.4.2/docs/guide/net/ipv6_guide/
What you want to do is to edit your eclipse.ini and add "-Djava.net.preferIPv4Stack=true" in the vmargs section
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
...
-vmargs
-...
-Djava.net.preferIPv4Stack=true
...
I no longer get hangs.
Is there any chance you can provide the code that's making that happen (and add it to a bug report see: http://pydev.org/about.html for links)?
I use PyDev daily with some very large projects and don't have that problem, so, it may be some specific construct or scenario in your code -- or maybe you just haven't given Eclipse enough memory (which would make the garbage collector work much more), in which case, take a look at: What are the best JVM settings for Eclipse? (in specific, raise your -Xmx flag, although you can probably use the other tips there too).
If you can't provide a reproducible scenario, the other choice would be getting a profiler (i.e.: YourKit java profiler has a 15 days free which would help in this case), running that use-case in the profiler and passing a snapshot of what's happening in this situation (if that's the case, please open a bug report at pydev.org and I can help you there).
I got this from pydev.org FAQs and it works fine for me.
When I do a code-completion, PyDev hangs, what can I do?
PyDev does most of its things in the java side, but some information can only be gotten from the python side (mainly builtins), so, in order to get that info, PyDev creates a shell and communicates with it through sockets.
The main problems when that happens are:
There's a firewall blocking the communication to the shell
In Linux, some kernels do not allow ipv4 utilization, which may make PyDev fail.
To enable it, do: echo 0 > /proc/sys/net/ipv6/bindv6only
The timeout to connect is too smal.
It depends upon the "Timeout to connect to shell" in the code-completion preferences (window > preferences > PyDev > Code completion)
If nothing works, please report a bug (also, check if there is anything on the error log (window > show view > PDE Runtime > Error log) and on the eclipse '.log', which is located at the .metadata folder of the workspace location.