|
pkfox wrote: +1 Is that down vote or just a minor up?
Veni, vidi, abiit domum
|
|
|
|
|
Good morning, I don't get the option of upvoting on my tablet so its my way of saying "I agree with you"
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
Veni, vidi, abiit domum
|
|
|
|
|
I have an MFC C++ desktop application (unmanaged code)that still uses DBGrid. What control would be a good replacement. I am displaying record sets in the control, fixing the number of rows in the control and range checking each cell value when leaving the cells. Vertical scrolling may be necessary.
Thanks for your input
Clayton
|
|
|
|
|
Is there something specific that DBGrid (I'm not familiar with it) doesn't give you, or is it looking dated, or ...?
|
|
|
|
|
DBGrid is dated. I have a number of annoyances with it, I have listed some of my issues below.
Documentation is scarce.
It is not well supported in VS2012. One can crash VS2012 by editing through the Property Pages dialog (try setting the headfont to bold).
Trying to provide error checking on a cell basis when leaving a cell seems dependent on what method you chose to leave the cell(Tab key versus arrow key).
It is slow to fill from a database.
The necessity to change rows before an update is done to the data.
Clayton
|
|
|
|
|
|
Hi,
I'm reading this old article about window regions from file: CreateRegionFromFile[^]
Sice this article is very old, I'd like to know if there is a better solution for this, and also if there is a quick way to do this using Codeblocks instead of VC++ dependant code.
Thanks for the help,
Luca
|
|
|
|
|
|
Thank you very much, using this tutorial I was able to build regions on codeblocks!
|
|
|
|
|
Don't think there's a "quick way" of doing this... if using codeblocks, you have to work directly with the WinAPI, so it's not exactly trivial. I don't believe this is a widely supported action so frameworks don't really include an easy way to do this.
|
|
|
|
|
Thanks to both for the reply.
|
|
|
|
|
Dear All,
i had write a code in C, but when execute, it an error.
May i know how to combine a correct structure ? kindly advise, thank you
Output results
**Enter integers: 23 12 34 56 78 12
Traversing the list : 23->12->34->56>78->12
Minimum value : 12
Reversing the list: 12->78->56->34->12->23**
#include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node *next;
}*head;
void insert_data(int value)
{
struct node *var,*temp;
temp=head;
var=(struct node *)malloc(sizeof(struct node));
var->data=value;
if(head==NULL)
{
head=var;
head->next=NULL;
}
else
{
while(temp->next!=NULL)
{
temp=temp->next;
}
var->next=NULL;
temp->next=var;
}
}
void reverse_list()
{
struct node *temp,*temp1,*var;
temp=head;
var=NULL;
while(temp!=NULL)
{
temp1=var;
var=temp;
temp=temp->next;
var->next=temp1;
}
head=var;
}
void display()
{
struct node *var;
var=head;
printf("\nlist of elments are \n");
while(var!=NULL)
{
printf(" %d ->",var->data);
var=var->next;
}
}
int main()
{
int i,value;
char ch='y';
head=NULL;
printf("\nEnter Integers: ");
scanf("%d",&value);
insert_data(value);
display();
}
getch();
}
|
|
|
|
|
caulsonchua wrote: i had write a code in C, but when execute, it an error. You need to show what the error is and where it occurs.
Veni, vidi, abiit domum
|
|
|
|
|
int main()
{
int i,value;
char ch='y';
head=NULL;
printf("\nEnter Integers: ");
scanf("%d",&value);
insert_data(value);
display();
}getch();
}
You have a spurious an extra closing brace ('}') in your code. Remove it in order to correctly compile.
As it stands, you main function retrives just one integer from the user.
Change from
Quote: scanf("%d",&value);
insert_data(value); to
while (scanf("%d", &value))
{
insert_data(value);
}
This allows the user to enter many integers (one at time).
Inserting a not-valid-number (e.g. "foo" ) ends the insertion in the list.
Also, I suppose your reverse_list function is plainly wrong.
Veni, vidi, vici.
modified 13-Nov-13 11:14am.
|
|
|
|
|
CPallini wrote: You have a spurious closing brace ('}') in your code. Extra, or superfluous, perhaps?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Yes, of course, thank you.
(It is wrong even in Italian )
Veni, vidi, vici.
|
|
|
|
|
caulsonchua wrote: i had write a code in C, but when execute, it an error. Is this supposed to be helpful? Be specific. What error? What is the code supposed to do (I know it's a linked list, so don't play that card)? What is it doing instead? Have you used the debugger to step through the code?
caulsonchua wrote: May i know how to combine a correct structure ? What structure are you trying to combine?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
MCU program, no cache, can anybody explain the performance comparison between global and local variables?
|
|
|
|
|
Your question is far from clear; does it have anything to do with C/C++/MFC?
Veni, vidi, abiit domum
|
|
|
|
|
I just not very clear which way is better in programming a C program, that will run on a 32 bit RISC Microcontroller platform.
Using globals or using locals as possible as many.
|
|
|
|
|
as I understand, local in stack, and possibly replaced by register.
but local variable needs push/pop operation.
Globals in RAM, no need to allocate memory/retrieve memory every time
|
|
|
|
|
Given the speed of most modern processors the time difference will most likely be too small to measure.
Veni, vidi, abiit domum
|
|
|
|
|
It depends on the architecture and how quickly the processor can form an address in comparison to how fast an instruction gets through the pipeline. The only way you're going to know for sure is to measure the speed of your app using both types of variables.
|
|
|
|
|
If a code block locates in an infinite loop, choose locals, then with locality principle, it is better than globals, I think.
If a code blcck just run a few times, accessing global vs push/pop stack operation, which one is better?
|
|
|
|