"Step Over" and "Step Into" in Visual Studio [closed] - c

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have noticed that using F10 - Step Over in VS automatically skips my functions. Why is that?
I did noticed that F11- Step Into, does enter my functions, however it enters the implementation code of the functions I am using from the various C libraries, which is really annoying.
Is there any way I can run step by step inside my functions without entering the implementation code of the included libraries?

It is annoying, especially if you happen to call several functions just to get parameters into yours. You can use step out (Shift+F11) to quickly get out of uninteresting code. (and then F11 to get into the next one)

Yes, there's an undocumented feature which allows you to not step into any of a list of functions you specify. See this blog post for an example of how to set that up. But again, since it's an undocumented feature, it could break with future versions of Visual Studio, and it may not always behave reliably.

You could step into your function and then step over instructions inside your functions.

If the problem is that you have multiple function calls that are part of the same expression and you're only interested in stepping into one of them, the "Step into specific" functionality added in VC++ 2008 might be helpful.
Just right click on the line and select "Step into specific" - you'll get a list of functions involved in the expression and can choose which one you want to step into.
On my machine it's also bound to keystroke Shift-Alt-F11.

Related

GUI for Text Steganography C program [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
How to develop a GUI for my program.I have made a c program to encrypt and decrypt any secret text message. I am hiding the message in the spaces between the words.
There are some GUI frameworks for C.
GTK is one of the most used when porting Linux applications
IUP is very lightweight
other listed on Google
However, my preferred solution to to add a rich GUI to C programs in a quick way, is to use Tcl/Tk. You can separate completely your application from the interface, test the C code at your leisure using the command line and concentrate on the GUI as a separate effort.
There are two possible approaches for mixing Tcl/Tk and C:
Create an executable and call it from the Tcl/Tk GUI with [exec ... ]
Create a DLL and call the functions as tcl commands
The first approach is extremely easy but might be unsatisfactory from an esthetic point of view.
The second approach is a little bit more complex and has two variants: create a real tcl module or use [ffidl][4] to call the dll directly. This time, the second is simpler than the former.
Finally, if you need to have a single, self-contained executable you can rely on tclkit which will embed everything you need in a single executable.
P.S. I see from one of you comments that your on Windows. You can create Windows GUI directly in C (here is an old tutorial) but I can ensure you it's a real pain! If you want something more modern you have to switch to C++
To develop your GUI, you could use GTK: https://developer.gnome.org/gtk-tutorial/2.90/ .

How do programs like PhotoShop, Word, etc. run forever and react to the mouse? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
This is a general question, and one that I have yet to find a good solution.
First, some pretext. I'm new to programming and all I have done (mainly anyway) are sequential programs in C.
This leads me to wonder how do big programs such as word, photoshop,visual studio etc. work.
To be less vauge, how do they remain open for one? All the programs I have written are top to bottom, the code runs and then the program terminates. Also What always user to say click save and the file writes or to click font and change the font. Clearly these operations can be performed in any order, infintely many times.
In general I do not see from my limited experiecne how real world applications are made. I want to try and make something "real" or useful, but school has not yet begun to teach me where to start.
Most desktop applications are programmed using a style called event-driven programming. In this setup, the program usually looks (at a very high level) like this:
while (true) {
wait for an event to occur.
react to that event.
}
These "events" tend to be things like mouse clicks, keyboard events, window resizings, etc. Typically, event-driven programs set up windows and attach pieces of code to them so that when an event occurs, the given piece of code can run. Each piece of code that's attached tends to look exactly like what you've seen - it executes from the top to the bottom in a normal fashion. The fact that different events can happen in different orders just means that they run when the user asks them to.
Every language and framework has their own way of handling events, so I'd recommend consulting the documentation for your favorite language / system for more details.
Hope this helps!

Multithreaded C code breaks under compiler optimization, works perfect without it, is this expected to happen, or is it definitely a bug? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a network program which involves several interacting threads and a thread pool for overlapped network I/O. I'm compiling with MinGW, which is gcc for Windows.
It works 100% fine without compiler optimization, across several different machines, however when I turn optimization on it breaks.
Should this be expected to happen, or is this revealing a bug that I need to fix?
The most likely explanation is that it is revealing a bug that you need to fix. It is most likely a race condition in the threading, but it's also possible that it's an aliasing violation.
One trick that might help you localize the problem, especially if you replicate it easily, is to do a binary search to find the affected file. Basically, compile half your files with optimization and half without. See if the code works or crashes. That will localize the problem to half your code. Repeat, narrowing down the files with the issue, until you localize it to a file. If needed, split that file in two and move code from one file to the other to figure out the chunk of code that fails when optimized and not when unoptimized.

Delphi. SynEdit - load big files. Virtual mode? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
can anybody help? How to load big files (2-5 MB) into SynEdit/UniSynEdit and do not let application get stuck, to make fast work? Is there virtual mode?
Thanks!!!
If resizing is slow, the problem is not loading, but rendering. Text is already in memory, but the component has to compute each line beginning on screen. If this part of the editor is not optimized, it could be slow (especially if it does allocate a lot of small strings for each line or word on screen).
The bottleneck of this component is when you use text word wrapping: the TSynWordWrapPlugin.DoWrapLine method '(doing all the work) do rely on the highlighter and will tokenize all text. I suspect that with a profiler, you'll see that most time is spent here. But I don't see any other way of handling it, without a major code modification. There is no so called "virtual mode" in SynEdit: it loads all and renders all lines in memory.
You could try the Letterpress version, which claims to be faster than original SynEdit. But it uses the same wrapping logic, so I guess there won't be a huge difference.
If you are using a Delphi 6 - 7 version of the compiler, please use FastMM4 as your memory manager: SynEdit does a lot of memory allocation, and the older BorlandMM is much slower than FastMM4. With modern version of Delphi, FastMM4 is the default MM (Memory Manager).

Modifying an open source program? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I would consider myself a fairly competent programmer with experience in Java and VB.net. My latest swim around the programming lake is having me modify a program written in C. (The program is Wireshark, an open source network analyzing tool.) I followed the instructions here http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html and simply don't know where to go from there. I'd like to use Visual Studio 2008 to work with the code if possible, but will do whatever is necessary. (I'm a total noob at using command prompt to do anything though.)
If you followed those steps, then you've built it. I'll copy Section 2.2.10 here.
2.2.10. Build Wireshark
Now it's time to build Wireshark ...
If you've closed cmd.exe in the meantime, prepare cmd.exe again
nmake -f Makefile.nmake all to build Wireshark
wait for Wireshark to compile - this may take a while!
run C:\wireshark\wireshark-gtk2\wireshark.exe and check if it starts
Just make changes in the code, do these steps over again, and presto! you've modified the program. You may want to bone up on C debuggers if you're doing anything very complicated.

Resources