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
  • Inter Process Communication between C++ - C#

    performance csharp c++ question
    4
    0 Votes
    4 Posts
    1 Views
    J
    ptr_Electron wrote: I dont want to implement logging in the same project as it will hit performance. I was involved in a C++ project years ago. Unix based. Performance was a contractual requirement. The architect was sure that logging was a performance problem. So we removed logging. Absolute zero impact on performance. And that was back when spewing stuff to a console (stdio) could impact performance. If you have a performance problem then you need to address the requirements and design first before looking for problems in the implementation and technologies. ptr_Electron wrote: which has the mechanism to Log from C++ to C# code please Every logging library that I have seen for at least the past 10 years if not longer uses pluggable designs. Which means if the plugs that are already available do not meet your needs then you can create your own. However at least when I looked some already supported remote logging plugs.
  • 0 Votes
    5 Posts
    0 Views
    V
    Thank you.
  • app is not running in debug mode

    visual-studio debugging help question
    5
    0 Votes
    5 Posts
    1 Views
    V
    Well, after re reading your OP I'm afraid I was wrong with my "hint". It seems to more probable the reason is in a mixing some 32/64 bit settings or linked DLLs. BTW, doe the Release 64 build work? And Debug 32 build?
  • 0 Votes
    9 Posts
    0 Views
    J
    One approach is to not bother; just initialize the array to what the maximum size could be and then store the actual size in a static variable. If this isn't time critical, just do it dynamically. Or, make sure the default values is zero and do a memset early on. In this case, they're all the same, so doing a quick loop early on solves the problem.
  • CListCtrl with group view enabled and long subtitles

    csharp tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • CMFCPropertyGridCtrl from Dll and exe assert

    help question c++ css data-structures
    8
    0 Votes
    8 Posts
    0 Views
    O
    Hey, I encountered the exactly same problem while working with CMFCPropertyGridCtrl in my DLL project. After many trial, i found a way to use CMFCPropertyGridCtrl in DLL without this error. All you have to do is Create a derived class of CMFCPropertyGridToolTipCtrl(),Make its protected static variable "m_strClassName" NULL in Constructor. for example; ////////////////////////////////////////////////////////////////////////////////// Class CMyToolTipCtrl::CMFCPropertyGridToolTipCtrl(); CMyToolTipCtrl::CMyToolTipCtrl() { m_strClassName = ""; } /////////////////////////////////////////////////////////////////////////////////// Now create ToolTipctrl from your CMFCPropertyGridToolTipCtrl() derived class on Init of the CMFCPropertyGridCtrl derived Class. for example, /////////////////////////////////////////////////////////////////////////////////// Class MyPropertyGridCtrl::CMFCPropertyGridCtrl(); void MyPropertyGridCtrl::Init() { CMyToolTipCtrl p_tooltip; p_tooltip.Create(this); } ////////////////////////////////////////////////////////////////////////////////////// There is always a way. Priyanka Oza.
  • Linux C++ implementation of ioctl SOLVED

    help c++ javascript linux hardware
    4
    0 Votes
    4 Posts
    0 Views
    V
    Thanks for replies. I am currently "on the road" and will reply when I get home. In short I did try "just GPIO" , it worked to the point, but it got too convoluted. Hence I am after using ioctl. I'll take a look at the bcm2835.h, hopefully I can use it for bcm2837 chip used in RPi 3B. I think my main concern is still to be able to "see" the code following / running the I2C spec - mainly changing hardware pins directions and reading START /STOP and ACK/NACK back. Of course I am verifying the actual LCD and sometime even using scope. Thanks for all your comments, appreciate that.
  • Help compiling OpenCV

    help html asp-net question announcement
    6
    0 Votes
    6 Posts
    0 Views
    J
    I have no experience with OpenCV but the reason for those errors is obvious. Quote: I have generated the project file for VS2008 The int_fast and int_least types has been introduced with C++11 and are supported by Visual Studio since VS 2015 (see Standard Types[^]). You might define them yourself as typedef uint64_t uint_fast64_t; You might also check if using C++11 is set somewhere in the OpenCV make file and disable that in the hope that the types are then defined somewhere.
  • 0 Votes
    4 Posts
    0 Views
    L
    To me you are sort of asking a strange question well outside the literal string part, so lets just check you understand some basics First a string is class or if you want an object it has constructors, destructor and methods it isn't just an array of characters. string - C++ Reference[^] You can't remotely equate those two lines as anything similar, do you understand that? So with a string class when you declare it as a const (like your commented out) what are you expecting it will do? So you are clear you are asking for a constant pointer to an object and trying to set some literal string to that object. This may also help understand Victors response and David deals with the literal part. The point here is you can only create a string when it matches one of the constructor types of the class. What constructor functions exist controls how you can create it. Here is the examples of showing the seven standard constructor methods for the class string::string - C++ Reference[^] The situation with just a character array is very different const char *ptr = "tarun"; We have a simple array of characters that can never be changed AKA they are constant Everything from a C to a C++ compiler understands the later because it's very trivial. In vino veritas
  • 0 Votes
    14 Posts
    0 Views
    L
    I am not going to make the situation worse but I would like you to go thru it as an exercise Your Point 1> I still have no idea what you are saying, I think you are objecting to me referring to assignment as homework is that the issue? Your Point 2> I understood your point but I have no idea what code belongs to your lecturer and which belongs to you? Your Point 3> No use online forums but remember we are not mind readers, things that may be obvious to you are not to us. You may care to review the conversation and consider I may not be clear exactly what you are trying to do. I also took the time to write code and give you my best guess at an answer which is hardly the actions of someone trying to be "unjustifiably obnoxious" and I took the time to answer each of your responses. You may care to review the sticky, points 5 & 11 are very pertinent HOW TO ASK A QUESTION - C / C++ / MFC Discussion Boards[^] I actually didn't and still don't know if it was just missing an asterix because there are multiple problems as none of the types matched up. It is the same as structs being rolled in as strings in variadic printf statements, it's hard to work out what was intended. This rolls back to point 5 on the HOW TO ASK A QUESTION sticky. I am sorry you feel I was being toxic that was definitely not my intent and if that belief spurred you to solve the problem at least that was a positive and hopefully you will be more careful with postings in future. In vino veritas
  • 0 Votes
    8 Posts
    0 Views
    T
    i am currently following "C++ The complete reference by : Herbert Schildt"
  • Is it possible to link a DLL in another DLL and call its functions?

    question
    2
    0 Votes
    2 Posts
    0 Views
    L
    Yes, it's possible, and the same way that you access the functions of any DLL. But your question is not clear, what problem are you having.
  • 0 Votes
    8 Posts
    0 Views
    J
    Hi Jochen Arndt, Thank you very much for your support. I got it now and I am not getting any assertion after "you must first ensure that it is not checked (usually by checking another button of the group)." Thank you very much once again.
  • What is the best tool to find C++ Memory issues

    c++ performance question
    3
    0 Votes
    3 Posts
    0 Views
    P
    Using Code Gear /RAD studio. Please advise
  • How to map a matrix index to a memory location

    question css database performance help
    5
    0 Votes
    5 Posts
    0 Views
    D
    Before using such micro-optimisations, I would ensure that we have used all higher-level optimisations, first. For example: 1. How are the data received? Are they stored in memory in order of reception, or does some processing (e.g. address calculation) need to be performed? 2. How are the data processed? Is the access pattern sequential? random? If a single pass through the data is performed, is it possible to store the data (see question 1 above) in the order of processing, and thereby avoid all indexing? You may be able to think of other optimisations, based on your knowledge of the hardware and the problem. Ad astra - both ways!
  • Memory allocated out side of try and Delete in finally

    performance help question
    4
    0 Votes
    4 Posts
    0 Views
    J
    So it is the BCC compiler. According to the __finally (C++) - RAD Studio[^] it should be __try and __finally. When omitting the leading underscores the code should not even compile because try requires a catch and __try requires an __except or __finally. Is it still not working with the correct syntax and an empty __try block? Then you might ask this in a BCC specific forum like Recent Topics - Forum - Embarcadero Community[^].
  • AsyncIO - how to use it?

    sysadmin tutorial question
    3
    0 Votes
    3 Posts
    1 Views
    Y
    not sure, but maybe https://djangostars.com/blog/asynchronous-programming-in-python-asyncio/this guide will help
  • error C2143: syntax error: missing ':' before 'constant'

    help
    10
    0 Votes
    10 Posts
    0 Views
    F
    THANKS
  • problem understanding a functionality of constructor.

    question help
    4
    0 Votes
    4 Posts
    0 Views
    CPalliniC
    Welcome to C++. :-D I mean: constructors are the very basics of an OOP language (you must be sure to grasp them before even attempting to code). accessing an otherwise unaccessible member is the very purpose of the friend declaration.
  • In type conversion of 2 different classes can i convert both ways ?

    question
    6
    0 Votes
    6 Posts
    1 Views
    CPalliniC
    You are welcome.