|
Yes! It may have some problems running on NT/2000/XP, but that is rare.
I still have to occasionaly update code written to run on Windows 3.1. The only problems we have had with it are related to serial communications, and that may be a security issue as only 1 or 2 customers have ever had a problem.
INTP
|
|
|
|
|
I am having problem creating a simple C++ MFC Application using Visual C++ .NET with database support. In the wizard, I selected ODBC and an Oracle table. Here is the error message during the source code generation:
Microsoft Development Environment
Error occurred while converting the wizard's text to the code page of the existing text in the file: C:\Excercise\db4\db4Set.h
However, if I select a desktop database, for example a DBF file, the problem does not occur.
Eilzabeth
|
|
|
|
|
Hello all
I create an application which contains CPropertySheet. I want to include a help file for this propertysheet which will be activated whenever user click on HELP. How do I associate a help file for an existing MFC application. I tried creating a new application with help files and copied those files into my application, changed the names but no use.
I also changed the include file in XXXX.hpj to cpropertysheet.hm. If anyone know's how to link help file to CPropertySheet's HELP button, pls help me with an example.
Thanks for your help.
Hari.
|
|
|
|
|
|
How can I copy a 2dim array?
thanks,
Steven
|
|
|
|
|
|
|
I believe you can use memcpy in the same way you did as a 1 dimensional array.
John
|
|
|
|
|
If it's the same as in your previous question, but in two dimensions, then you can do the same thing
char a1[10][10];
char a2[10][10];
memcpy(a1, a2, sizeof(a2)); Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks,
I must be doing something ese wrong, because it keeps crashing.
I'll keep pecking
sj
|
|
|
|
|
johnstonsk wrote:
must be doing something ese wrong, because it keeps crashing.
Post the array declarations, and the code that causes the crash, and we'll see what we can do for you
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
The error I get is there is a call to undefined function memcpy()
I included the string.h
Can this function only copy chars or strings?
The program that I have reads data from a pci card and puts it in the structures below:
This data gets updated 2 times a second.
struct TSimHeader
{
char Name[47][20];
char Unit[47][20];
double Min[47];
double Max[47];
int SignalCount;
int SimStatus;
}static TSimHeader_arr[10];
struct TSimSignal
{
double Value[47];
double TimeStamp;
}static TSimSignal_arr[10];
I have added a new feature to the program that will allow the recording of data.
This will be done by writiing the data to a *csv file so it can be read in excel.
Since the data in the structures is getting updated 2 times a second I thought that it would be good to just make a new array and copy the data to the array so, if the user wanted to start recording the data it would be there ready to start recording. That is why I call the copyData() function everytime the data is updated.
I also created arrays that are of the same type and size of the ones in the struct
char name[47][20];
char unit[47][20];
double min[47];
double max[47];
double value[47];
Below is the copyData() function:
void RFMAccess::copyData(){
if(firstTime1){
memcpy(pflight_data->name, TSimHeader_arr[0].Name,
sizeof(TSimHeader_arr[0].Name));
memcpy(pflight_data->unit, TSimHeader_arr[0].Unit,
sizeof(TSimHeader_arr[0].Unit));
memcpy(pflight_data->min, TSimHeader_arr[0].Min,
sizeof(TSimHeader_arr[0].Min));
memcpy(pflight_data->max, TSimHeader_arr[0].Max,
sizeof(TSimHeader_arr[0].Max));
}
if(!firstTime1){
memcpy(pflight_data->value, TSimSignal_arr[0].Value,
sizeof(TSimSignal_arr[0].Value));
}
}
Then I call the writeData() function from another class that writes teh data in the copied arrays to a file.
Here is the writeData()
void LogData::writeData(){
Sleep(350);
int count;
if(firstTime){
fout<<"flight_data,";
for(int i=0; i<RFMAccess::TSimHeader_arr[0].SignalCount; i++){
if(passes == 1){
if(i == 0){
fout<<aflight_data->name[i]<<endl;
passes++;
writeData();
}
else
fout<<aflight_data->name[i]<<",";
}
else if(passes == 2){
if(i == 0){
fout<<aflight_data->unit[i]<<endl;
passes++;
writeData();
}
else
fout<<aflight_data->unit[i]<<",";
}
else if(passes == 3){
if(i == 0){
fout<<aflight_data->min[i]<<endl;
passes++;
writeData();
}
else
fout<<aflight_data->min[i]<<",";
}
else if(passes == 4){
if(i == 0){
fout<<aflight_data->max[i]<<endl;
firstTime = false;
writeData();
}
else
fout<<aflight_data->max[i]<<",";
}
}
}
if(!firstTime && (aflight_data->log == true)){
for(int j=0; j<RFMAccess::TSimHeader_arr[0].SignalCount; j++){
if(j == 0){
fout<<aflight_data->value[j]<<endl;
writeData();
}
else
fout<<aflight_data->value[j]<<",";
}
}
}
Sorry fo rall the code snips, I just wanted to make sure that the problem was understood.
Thanks for the intrest,
Steven
|
|
|
|
|
are you sure you're including string.h in the file that uses memcpy? that error you're getting means it can't find the memcpy function at all.
|
|
|
|
|
Yes it is definetly in there.
The program will compile but, if I run the debugger on the memcpy() function it reads that the function is undefined.
Strange.
Steven
|
|
|
|
|
well you can try a double for loop to copy the data.
for(int i=0; i<47; i++)
for(int j=0; j<20; j++)
old[i][j] = new[i][j];
i wouldn't recomend that (memcpy should work) but at least you can get your debugger going again to examine the memory. if it still crashes then you have some other problem =/
|
|
|
|
|
johnstonsk wrote:
I run the debugger on the memcpy() function it reads that the function is undefined.
What do you mean it is undefined?? If it compiled then it is defined... You mean that the debugger will not step into the memcpy() function? If so you do not have the correct symbols installed..
John
|
|
|
|
|
johnstonsk wrote:
How can I copy a 2dim array?
CIS101 [Introduction to Computer Science]
|
|
|
|
|
Just wanted to extend to all members a hello and to let you know that I am working with MS VC++ 6.0. I have written a database application for my wife's orchid hobby in MS BV 6.0 and hope to duplicate that effort - as I said, I'm new to c++ and to this board. Hello, and I'm looking forward to learning from all of you. Until I'm more comfortable - I will lurk...;)
Paul
|
|
|
|
|
|
Ryan Binns wrote:
we're a pretty nice bunch of people usually
Yes, as long as you don't ask Programming questions in the Lounge or submit an article that it looks like a four year old wrote you should be ok...
John
|
|
|
|
|
John M. Drescher wrote:
Yes, as long as you don't ask Programming questions in the Lounge or submit an article that it looks like a four year old wrote you should be ok...
Exactly
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
Paul Southwick wrote:
in MS BV 6.0
That's the new MS Bisual Vasic programming language that just came out, right?
Seriously though, welcome to CP !
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
I have a number a different arrays.
double t1[10];
char t2[10];
...
double cpT1[10];
char cpT2[10];
If I make a array of the same size to copy into can I use the memcpy() function like this?
memcpy(cpT1, t1, sizeof(t1));
memcpy(cpT2, t2, sizeof(t2));
Or should I create a function that I pass the amount to the memcpy() function?
If So how can I make it so that I can pass any array to the function?
Thanks,
steven
|
|
|
|
|
If the array are statically created (like in your example), that will work, otherwise not !
|
|
|
|