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
  • Run powershell in C#

    question csharp com windows-admin help
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Connect to bluetooth service watch and read HR data

    c++ tutorial question learning
    19
    0 Votes
    19 Posts
    3 Views
    D
    That almost looks like tools one could use to read data from a Garmin device. I wonder if it would help the OP! "One man's wage rise is another man's price increase." - Harold Wilson "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
  • Example C code to use API "GetProcessIoCounters"

    json help tutorial
    5
    0 Votes
    5 Posts
    3 Views
    V
    So what is wrong with GetProcessIoCounters function?
  • Control PDF from c ++

    question
    4
    0 Votes
    4 Posts
    0 Views
    D
    You don't "control the PDF". You have to control the application that is opening and displaying the PDF file. How you do that depends entirely on the application you're using to display the PDF. There's probably going to be applications where you don't have that control. You can do it if the machine has Acrobat Reader installed it, which is what the previous answer is using. Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak
  • Other program access and data extraction

    csharp java com question
    7
    0 Votes
    7 Posts
    2 Views
    L
    1. Why are you calling ToInt32 on a value that is already an int type? 2. If WM_GETTEXTLENGTH returns zero, then that tells you the Window is not a Text type. As I said yesterday, if the contents are shown in a grid then you need to find out what actual control it is, and use the control's methods to extract the contents.
  • What is makegetstatuscmd() command function?

    question
    7
    0 Votes
    7 Posts
    1 Views
    M
    Thank you. Did you see my second reply? I think this information is enough to understand what would be the function. This project is tied on QT5 with STM32 and TI DSP F2806x. widget.h Example File | Qt OpenGL[^] This project contains IAR,ECILPSE IDE. A display is added in ST slave, it has APP files. TCP server is involved here. Server is updating the information about DSP register. Its sending modebus Queue initiating this funtion, Quote: void CModebusTCP::OnReceived(BYTE *pData, int nSize) Under the function the variables are, Quote: void MakeGetStatusCMD(void) { WORD *pWord; float *pFloat; WORD Size; pWord = (WORD*)Uart1.TxData; pWord[0] = DSP_CMD_GETTATUS; pWord[1] = g_AdjustOutput; pWord[2] = g_RunMode; pWord[3] = g_Run;
  • 0 Votes
    4 Posts
    1 Views
    M
    Quote: This code fragment contains some global variables, we cannot see how they are declared, initialized and probably used somewhere else Thanks a lot to write here. Yes this code has global variable like Global.c. But this file explains to call internal and external memory and RAM. A summary can find here, DSP Global Variable Specification Syntax[^] Looking at the first defination, in_data = Register[CH1_VOLTAGE] * 1000 - Vfilt_16; Register[CH1_VOLTAGE]=float Register[COUNT_OF_REGISTER]; Vfilt_16 is also a register value. About k the C2000 digital lib manual says, Proportional gain is usually applied directly to servo error, however, a feature of this controller is that sensitivity of the proportional path to the reference input can be weighted differently from that of the feedback input. This is achieved through the Kr variable, and provides an additional degree of freedom when tuning the controller. The proportional control law is shown in Equation v5 (k) = Krr(k) - y(k) In most situations the weighting gain Kr will be unity. Its a PID controller equation. Such functions are typically based on integrating the transient error over a fixed time interval. The DCL.h library header file includes a set of default floating-point values that can be used for initialization purposes. These configure the proportional path to have unity gain, zero integral gain, output saturation limits of ±1. #define PI_DEFAULTS { 1.0f, \ 0.0f, \ 0.0f, \ 1.0f, \ -1.0f, \ 1.0f \ } An example of the C declaration of an initialized PI structure is: PI pi1 = PI_DEFAULTS; The formation of the graph can be find here,7.7. Graph Tools — Code Composer Studio 9.3.0 Documentation[^]
  • 0 Votes
    4 Posts
    1 Views
    L
    1. x -= y means subtract y from x and store the result in x. 2. The same for addition. 3. If not equals. 4. if equals. A single = sign means assign the value on the right to the variable on the left.
  • C++

    c++ question
    5
    0 Votes
    5 Posts
    1 Views
    C
    Yeah, that might go through a C++ compiler, but it's not really C++. I just didn't want to pile on. OP - debugger is your friend. Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
  • 0 Votes
    13 Posts
    2 Views
    G
    Yes, that's right.
  • Dynamically creating CToolBar

    help learning
    2
    0 Votes
    2 Posts
    1 Views
    L
    Then you need to write the code to create the buttons, allocate their ID values and images, and add them to the CToolBar object. See CToolBar Class | Microsoft Docs[^], and Toolbar - Win32 apps | Microsoft Docs[^].
  • Exception handler

    hardware help question
    8
    0 Votes
    8 Posts
    2 Views
    L
    jschell wrote: you write 6 bytes to that you have a problem. Of course, but not an exception. Which is why you are always reminded to use the strxxx_s versions which include bounds checking. But you have to work quite hard to write past the beginning of a buffer.
  • Base types and pointer arrays

    visual-studio data-structures question
    9
    0 Votes
    9 Posts
    2 Views
    Richard Andrew x64R
    Thanks for your input. I appreciate you taking the time to post. The difficult we do right away... ...the impossible takes slightly longer.
  • 0 Votes
    3 Posts
    2 Views
    M
    failed :( Best Regards
  • How do I access private variable of an object ?

    question
    15
    0 Votes
    15 Posts
    1 Views
    M
    Private members are only accessible via public functions. Try int start_X = QPoint.SetX(dimentions.x2);
  • Help me to convert all to C++ (stdio.h)

    c++ help
    5
    0 Votes
    5 Posts
    2 Views
    S
    If you mean to replace std::cout and std::cin with stdio.h functions, then look up the usage of printf() and scanf(), e. g. at C Library - <stdio.h> - Tutorialspoint[^] If you mean to convert everything to C, you also may need to remove the const qualifiers depending on the exact C compiler (and version) you are using. GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
  • Overloading += in c++

    c++
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Literal for a short

    question
    3
    0 Votes
    3 Posts
    2 Views
    Richard Andrew x64R
    Thanks, Greg. The difficult we do right away... ...the impossible takes slightly longer.
  • Debug Application from Service

    debugging question
    5
    0 Votes
    5 Posts
    2 Views
    Richard Andrew x64R
    Thanks for your response. I was asking more about using the service as a debugger and having it attach to a user process. The difficult we do right away... ...the impossible takes slightly longer.
  • 0 Votes
    3 Posts
    2 Views
    L
    The question is impossible to answer as we have no idea what help you need. I suggest you go to OpenGL - The Industry Standard for High Performance Graphics[^] and look at some of their documentation.