|
Guys i need help here!
I'm working on Final year project for this year, my project is using a mobile phone just as a Modem to send and receive SMS control by the PC, and the PIC microcontroller is use to control the house system by respond to what the message is detected.
The PIC microcontroller with be connect to PC through serial port.
At this moment i don;t know what type of phone should i use and what type of program should i wear on this project!
The mobile phone i have at this moment is Iphone 1G,Nokia E65,Sonic ericcson k700 and w850.
The program i search in web related to this topic is ActiveXpert sms/mms toolkit and SMS client.
Honestly i'm new in this topic i hope you guys can lead me forward!! Please
|
|
|
|
|
You could ask your teacher(s), couldn't you?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I understand 1 Application (a.exe) is 1 Process (view in task manger).
How can i create 2 independent process for same 1 application in MFC?
Can i create two independent process in one application?
|
|
|
|
|
duongcntt4b wrote: How can i create 2 independent process for same 1 application in MFC?
How about just running it again?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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 and your radical solutions.
Steve
|
|
|
|
|
i want 1 application have more process and 1 porocess have more threads,
because my application have many big task, i want 1 big task is one process, every process have many thread.
can i have create many process in 1 application?
|
|
|
|
|
duongcntt4b wrote: ...and 1 porocess have more threads...
So have you looked at CreateThread() , _beginthread() , or AfxBeginThread() ?
duongcntt4b wrote: can i have create many process in 1 application?
No. A process is just an instance of a running application.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
So , I have this SDK from a manufacturer. They use malloc in their code..and so I have to use it. They use C along with C++ in their SDK.
They do something like this:-
void *ptr;
ptr=malloc(40*50);
pArrivedFrame->GetBytes(ptr); //The bytes I need are referenced to ptr
and I do:
char *b=(unsigned char*)(pFrame); //This is to get the data.
Now my question is how do i free the void ptr?
free(ptr); does not work and results in an exception being thrown. Any help will be appreciated.
Thanks
|
|
|
|
|
It sounds like you need to check who owns the memory you allocated. That is, if you allocate the memory and then attach it to an object of their library, it now belongs to that object; unless it is detached before that object is destroyed. There does not have to be a method named ‘Attach’ in order to pass ownership, it could be done via the constructor or some other method.
Of course the above could be wrong; it sounds like the pointer is no longer valid when you call ‘free’, because it has already been freed.
Calling ‘free’ is the only/correct way to free the memory allocated by ‘malloc’ or ‘calloc’.
Run some experiments and/or try locating the Microsoft article “Detecting and Isolating Memory Leaks Using Microsoft Visual C++” to get you started, or grab a trial version of one of the commercial memory tracker programs like Bounds Checker.
Good Luck!
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hello everybody,
I'm new to the site and this is my first post,
I am trying to write a program in 'C' that will give the user a menu to choose from. The choices are to 1)Add a new book (ISBN, Title and Author stored to a binary file)
2)Search for a book by its title, this will give a displayed result
3)Search for a book by its ISBN, this will also display results
4)Display a record of all books on file
5)Exit program.
The program must also have error checking for wrong user choice and for duplicate isbn numbers.
Any help with this would be appreciated.
thanks warpbro
modified on Tuesday, June 2, 2009 5:20 PM
|
|
|
|
|
warpbro wrote: Any help with this would be appreciated.
So what do you have coded up so far?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
I can say only belows just now to help you.
You must decide the program basic design at first.
1) console type or GUI type?
2) who (which) own the data? using database or ordinary file?
3) estimate data size. many people cant see too many records at a grance.
4) think about task flows. it decides the program structure.
|
|
|
|
|
It's to be a console application done in C. Some problems with what I have so far are; when search results are found it must only show the result once, if only one book has been entered to the file, the search kicks out the result 8 times because of the loop any suggestions? I' ve been using other similar source code to try and get a working program but I keep hitting errors. How can I get the program to handle spaces between words, eg; 'The book of games'
Here's what I've got so far,
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int choice,isbn,title,author;
typedef struct
{
char author [15];
char title [30];
char isbn [15];
}
library;
FILE *lbooks;
while (choice != 5)
{
library books;
printf ("\n\n\t\t\t\tForth Valley Training\n\n\n");
printf ("\t\t1. Add a new book.\n\n");
printf ("\t\t2. Search for book by ISBN\n\n");
printf ("\t\t3. Search for book by Title\n\n");
printf ("\t\t4. Display Details of Books Held\n\n");
printf ("\t\t5. Exit\n\n\n");
printf ("\t\tPlease enter your choice..");
scanf ("%i", &choice);
switch (choice) {
case 1 : system("cls");
lbooks = fopen("BookFile.bin","ab");
printf ("Please enter ISBN..\n");
scanf ("%s", &books.isbn);
printf ("Please enter Author..\n");
scanf ("%s", &books.author);
printf ("Please enter Title..\n");
scanf ("%s", &books.title);
fwrite(&books,sizeof(books),1,lbooks);
fclose(lbooks);
break;
case 2 : system("cls");
int srch1 [15],loop;
loop == '0';
printf ("Please enter ISBN number..");
scanf ("%s", &srch1);
for(loop = 0;loop <=8;loop++)
{
lbooks =fopen("BookFile.bin","r+");
fseek(lbooks,sizeof(books)*loop,SEEK_SET);
fread(&books,sizeof(books),1,lbooks);
if (srch1 == library.isbn)
printf ("\n%10i %10s %20s\n\n", books.isbn,books.author,books.title);
fclose(books);
}
system("PAUSE");
break;
case 3 : system("cls");
int result;
char srch2[25];
loop == '0';
printf ("Please enter book Title..");
scanf ("%s", &srch2);
for(loop = 0;loop <=8;loop++)
{
books =fopen("BookFile.bin","r+");
fseek(books,sizeof(books)*loop,SEEK_SET);
fread(&books,sizeof(books),1,books);
result = (strcmp(srch2, books.title));
if (result == 0)
{
printf ("\n%15s %15s %12i\n\n", books.title,books.author,books.isbn);
fclose(books);
} }
system("pause");
break;
case 4 : system("cls");
books = fopen("BookFile.bin","rb");
while (!feof(books))
{
fread(&books, sizeof(books),1,books);
if (!feof(books))
printf (" %10i %10s %20s\n",
books.isbn,books.author,books.title);
}
fclose(books
);
system("PAUSE");
break;
}
fclose(books);
system("cls");
}
system("PAUSE");
return 0;
}
Thanks for looking at this program warpbro
modified on Thursday, June 4, 2009 9:11 AM
|
|
|
|
|
Also I for got to say that it only need to hold the ISBN - 15, Title - 30, Author - 20 of 8 books.
|
|
|
|
|
Hi,
I wish to log/trace all 3rd party library API calls made by the application. I have a 3rd party DLL which exports certain methods and classes and header files containing the class declarations and global methods declaration.
Is there a way I can include the header file in windbg for tracing/logging purpose.
WinDbg has nice logger, but it logs only standard Windows API calls.
Please let me know if this is doable. It can greatly help me to understand the flow of the application.
Thanks and Regards
modified on Friday, June 5, 2009 7:30 AM
|
|
|
|
|
hey everybody,,
below is the code which i have written which gives the time diff for two inputs,,,,
but now i want to calculate time diff when input date is specified
eg: input 1 : 2/12/09 9:30:00
input 1 : 2/14/09 9:30:00
how do i do this ???
------------------------------------code-----------------------------------------
#include <iostream>
using namespace std;
struct timeType {
int hours;
int mins;
int secs;
};
void main(void)
{
struct timeType start, stop, diff;
cout << "\n Enter the start time (hh:mm:ss): ";
cin >> start.hours; cin.ignore(1,':'); cin >> start.mins; cin.ignore(1,':'); cin >> start.secs;
cout << "\n Enter the stop time (hh:mm:ss): ";
cin >> stop.hours; cin.ignore(1,':'); cin >> stop.mins; cin.ignore(1,':'); cin >> stop.secs;
int intStartSeconds, intStopSeconds, intDiffSeconds = 0;
intStartSeconds = start.hours * 3600 + start.mins * 60 + start.secs ;
intStopSeconds = stop.hours * 3600 + stop.mins * 60 + stop.secs;
cout << "\n start = " << intStartSeconds << " seconds, stop = " << intStopSeconds << " seconds";
intDiffSeconds = intStopSeconds - intStartSeconds;
cout << "\n difference (in seconds) = " << intDiffSeconds;
diff.hours = intDiffSeconds / 3600;
intDiffSeconds = intDiffSeconds - (diff.hours * 3600);
diff.mins = intDiffSeconds / 60;
intDiffSeconds = intDiffSeconds - (diff.mins * 60);
diff.secs = intDiffSeconds;
cout << "\n difference = " << diff.hours << ":" << diff.mins << ":" << diff.secs;
cout << "\n\n";
}
-------------------------------------code------------------------------------------
thx you fer ur help
|
|
|
|
|
And what is your doubt?
You may first calculate the day difference (I know it's a bit tricky due to leap years...) and then the remaining time difference.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Have you seen _difftime() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
I downloaded the ReHash console-based hash calculator by Dominik Reichl. Included is the file: testvect.txt. It appears that a test vector for sha256 is missing. I went to the NIST website http://csrc.nist.gov/groups/STM/cavp/index.html#03 and used some of the SHA Test Vectors for Hashing Byte-Oriented Messages. Unfortunately, I didn't get their same results for the sha256 test cases using Dominik's utility. Does anyone know why there's not a test vector for sha256 included with the utility, or why the utility would give a different result from the NIST standard test vectors?
Thanx.
bill s
|
|
|
|
|
MFC, STUDIO 2008
How to increase height of text
CStatic* pStatic = (CStatic*) GetDlgItem(IDC_STATIC2);
CFont font;
font.CreateFont(640, // 320 - same
0, // int nWidth,
0, 0, 400, FALSE, FALSE,
0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY, DEFAULT_PITCH | FF_ROMAN,
L"Times New Roman");
// Do something with the font just created...
pStatic->SetFont(font,1);
pStatic->SetWindowTextW(L"Any text");
|
|
|
|
|
durban2 wrote: font.CreateFont(640, // 320 - same
Why 640?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Use following method for a try.
CFont font;
VERIFY(font.CreateFont(
12,
0,
0,
0,
FW_NORMAL,
FALSE,
FALSE,
0,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_SWISS,
_T("Arial")));
GetDlgItem(IDC_STATIC_TITLE)->SetFont(&font);
studing is processing in this life.
|
|
|
|
|
two things could I use to this code anywhere
Or does it have to be in let's say ::OnInitDialig ::OnCtlColor
Also I read that using SetFont I would have to process the WM_SETFONT
Message
Thanks
|
|
|
|
|
MFC, STUDIO 2008
Created in class with help wizard function
my_func1
which must return variable CStrimg
CString CMainDlg2::my_func1(void)
{
return CString();
}
But I want for example:
CString CMainDlg2::my_func1(void)
{
CString s;
s = ”test”;
// is necessary return s;
// return CString(); How to use value of variable ‘s’ from my_func1?
}
|
|
|
|
|
do you try this:
CString CMainDlg2::my_func1(void)
{
CString s;
s = "test";
return s;
}
?
|
|
|
|
|