Well, i am feeling a little bit foolish asking something like this, but i' have no idea where the main function is in code i got from another person.
It's a pretty large Visual C++ project. So my question is simple, and please forgive me for asking this, but is there an easy way to find the entry point in a c++ solution in visual studio? It may not be called main, because there is a link to MFC tools (so perhaps WinMain).
Thank You!
Debug->Step Into used while you are not debugging should start debugging and will break at the entry point.
ctrl+, will give you some kind of search for member thing, then you look for your main function and it will possibly give you where it is declared.
Related
This is a short post since I'm in a hurry.
I was just wondering if there was way build and compile my c# project into an exe and dll so I can share them without having to have 6 files I need to run it outside of vs code, if possible, I'm new to the whole programming thing, so I don't really know what I'm saying or doing, to you I may just be talking nonsense.
thanks internet!
Reduced138
I tried searching it up but nothing, and I'm new to this so I don't really know that much, but I do know about this site.
I am a student programmer using Qt to build several GUI applications for my company and embarrassingly I have a tendency to misspell words from time to time. Obviously it's not really much of an issue for my code as the compiler would be the first to let me know but is there any way to automatically check the spelling of strings or data that is displayed?
I really would like to know if Qt offers anything; boy that would be nice. I didn't see anything in the documentation though. I don't often have this problem but when it does happen it's so embarrassing.
Ever since I installed VisualAssist, it highlights spelling, even in comments.
Not sure what it looks like or if it only works with VS... I am using it in plain c++.
http://blog.qt.nokia.com/2012/05/22/qt-4-8-2-and-visual-studio-add-in-1-1-11-released/
I hope this helps.
OK, I have been looking for weeks now. I have looked through Eclipse and Visual Studio, but all the plugins for this sort of thing is for Java or C# and not C++. ReSharper does not work, nor does NArrange. How in the world can I sort my methods in a .cpp file without having to go in and cut and paste by hand (there are hundreds of files and there is not enough time in the world to do that)?
I have tried writing the program myself, but I am not very skilled in scripting and have zero experience in Python. Creating the program in C++ I believe is possible but if there is a simpler way then I would like to know.
I didn't use it but take a look at Regionerate. It is a plugin for Visual Studio. I am sorry, I saw now that it is also only for C#. I thought that it worked with C++ too. Sorry.
I have looked for a long time and talked to many co-workers and am now convinced we should not do it. Too many headaches and one of the developers said he didn't want that because of the way he writes his code. Thank the lord he said something!
If anyone else is looking to do this and trying to find a solution, I would just like to let you know that it is not worth the trouble. If you HAVE to do something like this in C++ then you have got to do it by hand. Pray that you don't have to.
I realize you've concluded you don't want to do this, but just in case someone else does, you might be able to use Doxygen to do the "heavy lifting" and extract the functions from your source.
You can configure Doxygen to extract the code structure from undocumented source files.
You'd then have to extract starting line numbers of the functions from Doxygen's output, sort, and reassemble. It gets messy because you might need to introduce forward declarations.
Thankfully you decided against doing it.
How to find address of function pointers in a running process?
I am currently using C++ under Windows XP and wish to find the address of a function. Could somebody help me please? If you could, please give me an example. Thanks.
Simplest way: Use the debug symbols.
If there are no symbols, you're going to have to figure out where your functions are the hard way (reverse compile, find entry points, find function which looks like the one you want). Software such as IDA Pro is your best bet.
I'm just being introduced to C++, and want to know a basic question....
What happens when using C++? Is there anywhere I can see a working example? Textbooks break it down, segment by segment. I would really like to SEE what happens.
ANY suggestion would be appreciated. Hope MY question is not too vague.
Thanks!
You get into the office around 8:30am, get some tea, and you sit down and run a program called an IDE. It lets you type code with the keyboard, such as:
(*m_pHopeThisIsntNull)->doIt();
You can then hit F5 and the code runs and you find out it doesn't work the way you expected. Pretty soon it's 5:30pm.
If you are trying to learn C++, you cannot just read from the textbook -- programming is learned best through hands-on practice. You should get a C++ compiler and run through the textbook examples yourself.
When I use C++, other programmers bow down to me because of my awesomeness. But that's just my experience.
Sounds like a short session with your TA (at an American university, this is the graduate student who helps with the hands-on stuff, does the grading, etc., as a help to the professor) is in order. Get him/her to show you how to use whatever IDE (integrated development environment) your class is requiring/suggesting. Or wait for your lab session, where you will learn this.
You can use a debugger to execute your program step by step, looking at the variables. If that's not enough, debuggers can also show you the a disassembled version of the machine code along with the processor's registers.
Would that help?
You are using C++! your browser is written in C++!
If you want to see it step by step:
Set a breakpoint at the first line and start in debug (F5 in Visual Studio). You can step through the program step-by-step and see what's going on with varying granularity (Step Over or Step Into - usually F10 and F11 in Visual Studio). Stepping into will follow a function call whereas F10 will call it, and step forward over it after it returns.
If you want to see what's going on at a lower level you can use disassemble on your code.
I've used Visual Studio/Windows stuff here b/c that's what I'm most used to but these things are in every major C++ IDE I've seen.