Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

simoncoul

@simoncoul
About
Posts
58
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help With Dialog Based App
    S simoncoul

    Thanks so much problem is solved added them by hand much quicker! Thanks again!

    C / C++ / MFC help question c++

  • Help With Dialog Based App
    S simoncoul

    Hi I cannot find those functions anywhere. I have this

    CDLIADlg dlg;

    m\_pMainWnd = &dlg;
    //Brings up main dialog box
    INT\_PTR nResponse = dlg.DoModal();
    //Ends program
    return FALSE;				
    

    Brings up the main dialog, but I can't find the OnOk or OnCancel in the main dialog

    C / C++ / MFC help question c++

  • Help With Dialog Based App
    S simoncoul

    I have made a dialog based MFC app but found a big problem. If someone is entering values into the edit boxes and then hits enter it closes the program. If you hit enter at all while the program is running and in focus it will end the program. How can I fix this? Thanks

    C / C++ / MFC help question c++

  • How to pad a string?
    S simoncoul

    David you are such a great help. Thank you!

    C / C++ / MFC json tutorial question

  • How to pad a string?
    S simoncoul

    Hi, I need to be able to create a CString that is always 15 characters long. So I just want to have say the filename and then pad the rest of the 15 characters with spaces, anyone know of an easy way of doing this? Currently I'm just using strlen and a loop, but I think there probably is a better way. Thanks Simon

    C / C++ / MFC json tutorial question

  • How to Update Dialog values
    S simoncoul

    Thanks for all the help guys!

    C / C++ / MFC tutorial question announcement

  • How to Update Dialog values
    S simoncoul

    Yes I am, does that make this easier?

    C / C++ / MFC tutorial question announcement

  • How to Update Dialog values
    S simoncoul

    Hey thanks for the quick reply, but the SetWindowText asks for a LPCTSTR as the argument but I need to do integers and sometimes floats. Can I just cast it? Thanks again

    C / C++ / MFC tutorial question announcement

  • How to Update Dialog values
    S simoncoul

    Hi I'm getting streaming data to the program I'm writing and I need to update the data constantly. I'm currently just doing a switch statement to determine what needs to be updated and then after the switch I have UpdateData(false); This works but it will not allow me to enter values into over boxes in the display as it is constantly being updated. Is there a way to update just the single box value and not the whole display? Thanks Simon

    C / C++ / MFC tutorial question announcement

  • Help With Serial
    S simoncoul

    do{
    SerialLib.Read(recvbuf, 5, &BytesRead);
    if(BytesRead == 0)
    return 0;
    for(i=0; i 0);

    This is the code that I'm using to read the data, and the problem is being caused in here as we have another program written in TCL that recieves that date from the controller just fine so we know it's not a hardware issue. Any help would be great thanks.

    C / C++ / MFC help hardware performance question

  • Help With Serial
    S simoncoul

    I'm also using a baudrate of 115200, thought that might help a bit cause I have heard and read people have problems with higher baudrates.

    C / C++ / MFC help hardware performance question

  • Help With Serial
    S simoncoul

    Hello, I'm trying to stream data from a microcontroller and I think I have found problem. The data does not stream consistently so it will sometimes send a bunch of packets(5 byte packet) at once and then sometimes send them individual. When the speed at which they come in changes the data seems to become corrupted as only a couple of packets are wrong and then the data continues streaming properly again. I have no idea of what is going wrong here. I'm using the CSerial library and using the CSerialMFC for the notifications, and just a simply read on event received. Any idea of what could be going wrong here would be great. Thanks Simon

    C / C++ / MFC help hardware performance question

  • Help With Arrays
    S simoncoul

    ok Thanks I see what u mean doesn't make sense to say sendbuf[6]. Thanks again!

    C / C++ / MFC data-structures help

  • Help With Arrays
    S simoncoul

    Yeah they are! Thanks for all the help guys!!

    C / C++ / MFC data-structures help

  • Help With Arrays
    S simoncoul

    int main(void){
    unsigned char sendbuf[6];
    myclass::makesendbuffer(SendPacket, sendbuf);
    }

    void myclass::makesendbuffer(Packet SendPacket, unsigned char sendbuf[6]){
    if(SendPacket.data < 0){
    SendPacket.data += 65536;
    }
    sendbuf[0] = SendPacket.data % 256;
    sendbuf[1] = floor(double(SendPacket.data/256));
    sendbuf[2] = SendPacket.address % 256;
    sendbuf[3] = floor(double(SendPacket.address/256));
    sendbuf[4] = SendPacket.command;
    }

    That was what I finally ended up with and it works, is there a problem with it that u can see?

    C / C++ / MFC data-structures help

  • Help With Arrays
    S simoncoul

    Yeah that code works perfectly, since I'm sending the point of sendbuf, I am able to manipulate it as if it was being declared inside of the function. I dunno if this is the correct C++ way of doing it but it makes sense to me(but I know know C).

    C / C++ / MFC data-structures help

  • Help With Arrays
    S simoncoul

    Thanks for the help I got it to work

    unsigned char sendbuf[6];
    myclass::makesendbuffer(SendPacket, sendbuf);

    unsigned char myclase::makesendbuffer(Packet SendPacket, unsigned char sendbuf2[6]){
    unsigned char sendbuf2[6];

    if(SendPacket.data < 0){
    	SendPacket.data += 65536;
    }
    sendbuf2\[0\] = SendPacket.data % 256;
    sendbuf2\[1\] = floor(double(SendPacket.data/256));	
    sendbuf2\[2\] = SendPacket.address % 256;
    sendbuf2\[3\] = floor(double(SendPacket.address/256));
    sendbuf2\[4\] = SendPacket.command;
    
    return sendbuf2;
    

    }

    Made much for sense to send a pointer to the array and do stuff to in in the function then what ever I was trying to do!

    C / C++ / MFC data-structures help

  • Help With Arrays
    S simoncoul

    Hi I'm trying to write a function that will return an array this is what I have

    unsigned char sendbuf[6];
    sendbuf[0] = myclass::makesendbuffer(SendPacket);

    unsigned char myclase::makesendbuffer(Packet SendPacket){
    unsigned char sendbuf2[6];

    if(SendPacket.data < 0){
    	SendPacket.data += 65536;
    }
    sendbuf2\[0\] = SendPacket.data % 256;
    sendbuf2\[1\] = floor(double(SendPacket.data/256));	
    sendbuf2\[2\] = SendPacket.address % 256;
    sendbuf2\[3\] = floor(double(SendPacket.address/256));
    sendbuf2\[4\] = SendPacket.command;
    
    return \*sendbuf2;
    

    }

    The return is just giving me the value of the first element and everything else is not used. Any ideas of what I'm doing wrong here would be great thanks! Simon

    C / C++ / MFC data-structures help

  • Winsock Interrupt
    S simoncoul

    Thanks for the information helped me alot!

    C / C++ / MFC sysadmin workspace

  • Winsock Interrupt
    S simoncoul

    I have created a small program that creates a 5 byte TCP packet to a server then the server sends it back. I'm unsure of how the wisock send and recv functions work exactly, does it just poll the connection until there is something in the buffer or is there an interrupt. I'm suppost to setup an interrupt, so any info you know or a good place I could find this info would be great! Thanks Simon

    C / C++ / MFC sysadmin workspace
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups