|
Ya your understanding is correct. How to use use thread for RS232?
|
|
|
|
|
Read this essay: http://www.flounder.com/serial.htm[^]
It shows that serial programming is not trivial, explains mnay of the mistakes you can make, and gives good sample code.
Good luck.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: It shows that serial programming is not trivial, explains mnay of the mistakes you can make, and gives good sample code.
I would like to have a beer too, sir...
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]
|
|
|
|
|
See what happens when you don't read an article on serial programming? You get transmission transcription errors.
As for Beer? Real men use Scocth Whisky on their cereal!
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: Real men use Scocth Whisky on their cereal!
I see...
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]
|
|
|
|
|
This is why I think intellisense is so good!
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Klingon developers need intellisense like a fish needs a cheeseburger (or like "The Edge needs a handycam").
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]
|
|
|
|
|
CPallini wrote: Klingon developers
for (int nKaplah = 0; nKaplah < AGoodDayToDie (); nKaplah++)
{
ShoutUnintelligibly (nKaplah);
}
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi Friends,
I have one problem i m creating MDB(access databse) file from text file.i get field name and field value sequentially.But when mdb file is generated,it's sequence is different.So how to solve this problem.I want MDB file data sequential.
Reply me.
Thanks in advance..
|
|
|
|
|
The SQL statement would be
SELECT * FROM <TABLENAME>
WHERE <CONDITION>
ORDER BY <FIELD>
Not sure if there is any change for access database.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
jadhavjitendrar wrote: How to use order by clause in insert into statement
AFAIK you cannot do than. However, you may add a counter field to the table and then use it to order data when querying.
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 have compiler design in C practicals and i have encountered a problem. This goes as :
We have to take n number of productions(string) from user.
Each production is of different size.
I want the array size for each production to be dynamic with exact size as that of the entered string. There should not be any blank elements in array as it would spoil the output.
How this can be achieved. I am someone who not so good in C.
|
|
|
|
|
You could create an array of pointers if you know the value of n at compile time.
char *strings[50];
Now as you save each string to this array allocate the size.
strings[count] = malloc(sizeof(string) + 1);
strcpy(strings[count], string);
If the value of n is not known at compile time, create a pointer to a pointer.
char **strings;
When you get the value of n, allocate the array.
*strings = malloc(sizeof(char*) * n);
Allocation for each string is the same as above.
Don't forget to increment the count variable after to store every string.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi All,
Can anybody tell me how to use command EXECUTE_OFFLINE_DIAGS and subcommand SMART_SHORT_SELFTEST_OFFLINE.How to get its result.I know its used with IOCTL code SMART_SEND_DRIVE_COMMAND.But I am unable to get the result of SMART_SHORT_SELFTEST_OFFLINE.It would be better if anybody could help me with the help of a source code.
Regards
Abinash
|
|
|
|
|
Hi
how to Drawing lines, shapes on bitmaps ??
Plz give any sample pgm
thanks
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
1 Create a memory DC( CreateCompatibleDC )
2 Select the bitmap to that dc ( memdc.SelectObject )
3 Draw your lines/shapes to that DC.
4 Unselect the bitmap from dc.
Now your original bitmap will be having the drawings...
|
|
|
|
|
Hi naveen
Thanks for your replay .. i tried
HDC pDC=::GetDC(0);
HDC TmpDC=CreateCompatibleDC(pDC);
CImage _image;
_image.Load(_T("//read.tif"));
CRect Recto(20, 20, 20, 20);
int width=_image.GetWidth();
int height=_image.GetHeight();
HDC dcBmp=CreateCompatibleDC(TmpDC);
HGDIOBJ TmpObj2 = SelectObject(dcBmp,(HGDIOBJ)_image);
BitBlt(TmpDC,0,0,width,height,dcBmp,0,0,SRCCOPY);
SelectObject(TmpDC,TmpObj2);
DeleteDC(dcBmp);
but its not showing the rectangles in image ..??
plz reply
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
You could try changing the line
SelectObject(dcBmp,(HGDIOBJ)_image);
with
SelectObject(dcBmp,(HGDIOBJ)(HBITMAP)_image);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
its not working "superman"
its not showing any effect on images till the same image ...
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
Check are return values for errors.
There was probably some error encountered at Load or one of earlier functions called.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
No its not showing any error msg ...
i dont know why ..??
please
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
you said you want to draw some lines and shapes. But the above code is not doing any of that.
rajugis wrote: HDC dcBmp=CreateCompatibleDC(TmpDC); HGDIOBJ TmpObj2 = SelectObject(dcBmp,(HGDIOBJ)_image); BitBlt(TmpDC,0,0,width,height,dcBmp,0,0,SRCCOPY);
What the above code does is copy the image in dcBmp to TmpDC. The dcBmp has your image, but the target dc TmpDC doesnt have any bitmap selected into it. So basically that BitBlt function does nothing. To have a valid image in the TempDC, you have to select one bitmap to that dc. Check the below code(especially the one in the bold ). The hBmp conatins the final image.
HDC dcBmp=CreateCompatibleDC(pDC);
HBITMAP hBmp = CreateCompatibleBitmap(pDC, 20,20);
HGDIOBJ OldBmp = SelectObject(TmpDC,(HGDIOBJ)hBmp);
HGDIOBJ TmpObj2 = SelectObject(dcBmp,(HGDIOBJ)_image);
BitBlt(TmpDC,0,0,width,height,dcBmp,0,0,SRCCOPY);
SelectObject(dcBmp,TmpObj2);
SelectObject(TmpDC,OldBmp);
|
|
|
|
|
hi Naveen
Still its not drawing rectangles in image ...plz mention where i can correct it ..??
HDC pDC=::GetDC(0);
HDC TmpDC=CreateCompatibleDC(pDC);
CImage _image;
_image.Load(_T("read.tif"));
int width=_image.GetWidth();
int height=_image.GetHeight();
HDC dcBmp=CreateCompatibleDC(pDC);
HBITMAP hBmp = CreateCompatibleBitmap(pDC, 20,20);
HGDIOBJ OldBmp = SelectObject(TmpDC,(HGDIOBJ)hBmp);
BitBlt(TmpDC,0,0,width,height,dcBmp,0,0,SRCCOPY);
SelectObject(TmpDC,OldBmp);
please replay me !!!!!!!1
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
rajugis wrote: Still its not drawing rectangles in image ...plz mention where i can correct it ..??
Where is the code to draw a rectangle?
rajugis wrote: //HGDIOBJ hgdiobj = SelectObject(TmpDC,(HGDIOBJ)_image);
Why did you comment it? Also correct this line as SuperMan mentioned.
HGDIOBJ hgdiobj = SelectObject(TmpDC,(HGDIOBJ)(HBITMAP)_image);
|
|
|
|
|
Sorry to say naveen ..really i dont know the rectangle code..
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|