Skip to content

C / C++ / MFC

C, Visual C++ and MFC discussions

This category can be followed from the open social web via the handle c-c-mfc@forum.codeproject.com

111.5k Topics 465.7k Posts
  • Hooking pr_write problem

    help
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Create a Makefile from this mess

    linux c++ hosting cloud tools
    8
    0 Votes
    8 Posts
    11 Views
    K
    CXX is defined in the bowels of make somewhere. It is the default variable for the C++ compiler, and is used in the rules for constructing default recipes. So for example, suppose you had an otherwise empty directory with only one file, hello.cpp, in it. Without needing to create a Makefile, you can build the hello executable just by saying "make hello". There's default rules for all kinds of things, C, Fortran, ranlib (.a) libraries, yacc, tex, and on and on. You can get a list of available recipes by saying "make -p", which for my version of make produces 1357 lines of output. The CXX variable can be overridden by specifiying a shell variable of the same name at run time, so if for example you wanted to see what error messages clang++ spits out instead of g++ you can say CXX=clang++ make target Similarly you have CXXFLAGS and CPPFLAGS which pass arguments to the C++ compiler and the CPreProcessor, respectively. So you could say CXX=clang++ CPPFLAGS="-I /path/to/includs" CXXFLAGS="-O2 -Wall -Wextra" LDFLAGS="-L /path/to/lib" LDLIBS="-lmylib1 -lmylib2" make hello and make will apply the variables to the generated command line as expected, and produce: clang++ -O2 -Wall -Wextra -I /path/to/includs -L /path/to/lib hello.cc -lmylib1 -lmylib2 -o hello gnu make hack: You can rebuild everything from scratch, even if already compiled, without having to "make clean" by using the -B flag It should also be noted that the Makefile I provided earlier uses GNU makeisms e.g. $(wildcard),$(patsubst). If you find yourself on a BSD or other unix like system that does not have GNU tools installed, the given make file will fail. But the variable substitutions mentioned here will still work. Keep Calm and Carry On
  • 0 Votes
    2 Posts
    4 Views
    CPalliniC
    It looks your are trying to assign apples to oranges (while, unfortunately, fruit polymorphism is not in place :-) ). You should provide more code in order to get better help. "In testa che avete, Signor di Ceprano?" -- Rigoletto
  • Is this array of 2D vectors?

    question graphics data-structures
    2
    0 Votes
    2 Posts
    4 Views
    L
    Try breaking it down into its constituent parts: mark is an array of 5 elements. Each element is a vector. And each element of the vector is also a vector. And each element of the inner vectors is an integer. As it stands though, the array is null, so you need to initialise each of its elements with a new vector. You then need to decide what actual information you want to store in the vectors.
  • Connect to terminal native window - repost

    help question c++ linux tutorial
    20
    0 Votes
    20 Posts
    0 Views
    L
    Member 14968771 wrote: you are avoiding to provide a solution. Yes, mainly because I still do not really understand what you are trying to achieve. But, hey ho, that seems to be par for the course with your questions.
  • Style question

    question c++ docker tutorial
    10
    0 Votes
    10 Posts
    15 Views
    Mircea NeacsuM
    No problem: the iterator is a pointer in a UTF-8 encoded string and the function (called next) has to advance to the next code point (1, 2, 3 or 4 char). If iterator is at end of string it doesn't advance. Although a very simple function, I had a number of design decisions to make: - How should I deal with improperly encoded UTF-8 strings? I decided to return false if the string is not properly encoded. - Should I just leave out the boundary check and just document it? I decided against as it would have been unsafe. And the last one I was asking about: For limit check, should I just pass the string or the end iterator. Mircea
  • List assertation failure

    7
    0 Votes
    7 Posts
    10 Views
    F
    Was thinking how to that don’t know if it’s practical my list represents the output of VSMLIST z/os assembler mainframe macro representing the amount allocate free and I unallocated storage for an address space It’s listed by storage blocks ( address and length ) storage descriptors representing a storage subpool which different attributes and storage keys and the TCB task control blocks of the task that own them
  • 'System': a namespace with this name does not exist

    help csharp dotnet c++ asp-net
    7
    0 Votes
    7 Posts
    10 Views
    K
    OK thanks. I'll take a look If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
  • x86 Assembly Language

    2
    0 Votes
    2 Posts
    4 Views
    Richard DeemingR
    OK, I've done that. Where do I submit my invoice for payment? :laugh: Seriously, nobody here is going to do your homework for you. "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • type trait is_base_of compiles here but not there

    question c++ asp-net help
    3
    0 Votes
    3 Posts
    5 Views
    B
    Thank You for your interest. Please see updated post. Kind Regards
  • 0 Votes
    4 Posts
    14 Views
    P
    I haven't done anything serious in that area for at least a decade, but from memory you need to set the locale programmatically to be sure of where you are when you parse input. Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
  • .hex file converter

    7
    0 Votes
    7 Posts
    27 Views
    CPalliniC
    Do you mean Intel HEX - Wikipedia[^] ? That is pretty straightforward. Using it for creating a 'plc language' or a 'program in plc language' is a bit obscure, as far as I can understand. "In testa che avete, Signor di Ceprano?" -- Rigoletto
  • 0 Votes
    8 Posts
    23 Views
    M
    strTst *pt = Sp1[0]; pt->s1; // is spst1.s1 pt->s2; // is spst1.s2 pt->s3; // is spst1.s3 pt = Sp1[1]; pt->s1; // is spst2.s1 pt->s2; // is spst2.s2 pt->s3; // is spst2.s3 // alternative strTst **ppt = Sp1; ppt[0]->s1; // is spst1.s1 ppt[0]->s2; // is spst1.s2 ppt[0]->s3; // is spst1.s3 ppt[1]->s1; // is spst2.s1 ppt[1]->s2; // is spst2.s2 ppt[1]->s3; // is spst2.s3
  • basic C++ question...

    c++ design help tutorial question
    5
    0 Votes
    5 Posts
    8 Views
    L
    It is a single parameter constructor of the MainWindow class. The constructor accepts a single parameter which is a pointer to a QWidget object. The constructor sets its QMainWindow property to the input parameter - in this case the pointer named parent. It then sets its ui property by calling the Ui::MainWindow constructor, to create a new object of that class. To find out what the latter returns you need to look at the Ui class documentation.
  • 0 Votes
    4 Posts
    6 Views
    L
    Thanks for reply. I am actually looking for "discussion forum" . I am running out of ideas how to fix my problem. Yes , I did try qterminal - it has no option to run command with options - so I ended up with xterm. It works OK, but I cannot figure out how to FULLY integrate it with my application. I am able to display the command output in my app "window" but it is NOT really my app window - some folks call it "xterm native window ". So I can display it - it is "inside my other window" , I can move it , using my app "wrapper window", but I cannot process anything in it. I am actually hoping that somebody with good grasp of "windows hierarchy" can shed some light on this. In not so techie terms - how do I process data in xterm native window ? I will take a look at xterm man again, maybe the answer is there.
  • Problem creating an array of "class"

    c++ data-structures help
    27
    0 Votes
    27 Posts
    73 Views
    L
    I have no idea where that question came from or what it actually says. But I would assume that if you want an explanation then the place where you found it is the best place to ask. The forums here are more for help in diagnosing and fixing specific problems. There are other sites that offer well written tutorials, such as Learn C++ – Skill up with our free tutorials[^] and C++ Tutorial[^].
  • MAPI error MAPI_E_NOT_SUPPORTED problem

    help sysadmin csharp c++ visual-studio
    11
    0 Votes
    11 Posts
    20 Views
    L
    I think you still need to confirm the Outlook and MAPI versions; if you're looking for differences between computers. [Choose a specific version of MAPI to load | Microsoft Docs](https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/how-to-choose-a-specific-version-of-mapi-to-load) "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
  • How can do it in c++?

    c++ oop question
    4
    0 Votes
    4 Posts
    10 Views
    CPalliniC
    Coding? "In testa che avete, Signor di Ceprano?" -- Rigoletto
  • 0 Votes
    5 Posts
    10 Views
    L
    Member 14968771 wrote: The att6ached code is being posted here because it is C++ code No, it has nothing to do with C++, it is purely a QT/qterminal issue. And this is the C/C++ forum. In your code ... QString exec = "qterminal"; QStringList params = QStringList() << "qterminal" << "-e" << "bluetoothctl" ; // help\n"; processTERMINAL->start(exec, params); ... you are passing "qterminal" as the first parameter to "qterminal". So remove that field from your params. And that is still not a C++ issue.
  • foreach - basic C++ question

    question c++ data-structures
    8
    0 Votes
    8 Posts
    12 Views
    L
    It looks I was totally of. foreach(CommandString,BT_Setup[CommandIndex] ) works as expected since the BT_Setup is QStringList . It does what it is designed and with QString pulls separate characters. So the moral of the story - convert QString to QSTringList...