Thanks so much problem is solved added them by hand much quicker! Thanks again!
simoncoul
Posts
-
Help With Dialog Based App -
Help With Dialog Based AppHi 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
-
Help With Dialog Based AppI 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
-
How to pad a string?David you are such a great help. Thank you!
-
How to pad a string?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
-
How to Update Dialog valuesThanks for all the help guys!
-
How to Update Dialog valuesYes I am, does that make this easier?
-
How to Update Dialog valuesHey 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
-
How to Update Dialog valuesHi 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
-
Help With Serialdo{
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.
-
Help With SerialI'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.
-
Help With SerialHello, 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
-
Help With Arraysok Thanks I see what u mean doesn't make sense to say sendbuf[6]. Thanks again!
-
Help With ArraysYeah they are! Thanks for all the help guys!!
-
Help With Arraysint 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?
-
Help With ArraysYeah 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).
-
Help With ArraysThanks 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!
-
Help With ArraysHi 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
-
Winsock InterruptThanks for the information helped me alot!
-
Winsock InterruptI 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