|
RockyJames wrote: ...is there any sample application..for the given article
Did you read it? Near the bottom it states:
"There is no download because copy-and-paste from this page should suffice."
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yeah i have..read..thanks for the article..Can i expect any more suggestions like how to start..i want the basic push up..then later on i hope i can handle.it..
|
|
|
|
|
here
That article is more about creating pluggable COM components, but the source code has a serial port component that will fill your needs.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
i am new to COM,i want to develop a DLL in COM for serial port communication,the component side, i want to write code,for opening the COM port,closing,sending and receiving the Data,from the client side i want to use this DLL./and just call the respective function of the DLL..can u please suggest me..how to use your serial communication interface..
thanks in before..
james
|
|
|
|
|
That is what those components do. There are 3 COM components and 1 client app in the demo code for that article. The app itself is very straight-forward. Instead of looking for the components of a specified category, just import the serial port one into your project and initialize it the same way it is done in the application.
Have you written serial port code before? If not, you may want to start by writing a class to communicate with the serial port prior to jumping into COM.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
can i use u r serial communication class directly ,instead of developing new one..?
-- modified at 19:21 Thursday 29th June, 2006
|
|
|
|
|
Serial communication in Windows is handled just like a file. You use OpenFile/CreateFile to open the port, and ReadFile/WriteFile to read from and write to it. The classes people develop just wrap these operations into easy to use methods.
So, yes, you can easily just use the Win32 API directly if you would like.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
yeah i am planing to use OpenFile/CreateFile,ReadFile,WriteFile and other API functions,do we need to write two threads,for reading and writing and how do we spool the data.I want write everthing in a DLL and use this DLL,in a client application,by calling respective functions,i want to open com port,send,and read from it....
Thanks in Before
james
|
|
|
|
|
need to add some images thumbnail to CImageList
|
|
|
|
|
If you use the Bitmap class instead of the Image class you can use the GetHBitmap or GetHIcon methods to get an HBITMAP or HICON that you can add to your image list. The Bitmap class inherits from the Image class so all the functionality of the Image class is available in the Bitmap class.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hello everyone,
I am working on a code related to binary trees (data structures) and there is a small part of it that I can't undserstand because of its strange syntax.
To make things easier for somebody who may help I abstracted this part of code and made it simple and stand alone but still keeping that strange syntax! Looking the output I know what the code does but I cannot understand its syntax at all. I am giving the code below with questions for the lines I don't understand:
<br />
#include <iostream><br />
#include <string><br />
<br />
using namespace std;<br />
<br />
void PreOrder(void(Visit_) (int *s), int *s){<br />
<br />
Visit_(s); <br />
}<br />
<br />
static void Output_(int *t)<br />
{cout << *t << 'Z';} <br />
<br />
<br />
int main(){<br />
<br />
<br />
int *p;<br />
int i=5;<br />
<br />
p=&i;<br />
<br />
PreOrder(Output_, p);<br />
<br />
<br />
getchar();<br />
return 0; <br />
}<br />
I would appreciate it a lot if anyone could explain even a single line, maybe then I can understand the whole image my self.
Thank you all in advance,
Melsi
|
|
|
|
|
void(Visit_) (int *s) is the function pointer (which accepts int* as its paramter) declared (very firstly) as the function parameter.
You are passing PreOrder(Output_, p);
Output_ as the function address to execute
Visit_(s);
here the execution begins.
There's nothing strange inside. the confusing thing nobody is used to define the function poiner as the parameter.
Hope I answered you
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
Sarath.<fon wrote:<="" div="">There's nothing strange inside. the confusing thing nobody is used to define the function poiner as the parameter.
Usually these are typedef'd to make the code easier to read.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Exactly. most of the people declare the function pointer as typedef one.
this is most used way
typedef void(*Visit_) (int*) ;
void PreOrder(Visit_ fxn, int *s)
{
fxn(s);
}
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
Thank you all very much!
Sarath I see what you mean you are clear, you know it may sound stupid but although I have done some coding in different language (as a c.science student) it is the first time to hear this term "function pointer", it is strange to hear that there are pointers to functions.
What is more, I am going to check out this tutorial (thanks led mike, it was a brilliant idea to indicate this tutorial) about "function pointer" and connect all the pieces together, there are a lot of new things to learn now.
Thank you again! I appreceate it very much guys, the answers came so fast!
Melsi
|
|
|
|
|
|
Now I have all the "iamge pieces" conected together, I checked the original code I am working and now it is obvious what it does and how.
Thank you all again!
Melsi
|
|
|
|
|
Can me somebody give an example of an simple iterator (such as STL but simple) ?
Thanks.
-:KNOX:-
|
|
|
|
|
list<char> charList;
for( int i=0; i < 10; i++ ) {
charList.push_front( i + 65 );
}
list<char>::iterator theIterator;
for( theIterator = charList.begin(); theIterator != charList.end(); theIterator++ ) {
cout << *theIterator;
}
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
An example of what an iterator class looks like or how to use them?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Yes an class example.
-:KNOX:-
-- modified at 13:39 Thursday 29th June, 2006
|
|
|
|
|
The most basic example of an iterator is just a pointer:
char buffer[100] = "0";
char* it = buffer;
for (int i = 0; i < 100; ++i)
{
*(it++) = 'a';
}
A more indepth example would include writing a basic container class and an iterator class (iterators don't mean much without a corresponding container).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hey guys I am having a bit of syntax problem
File: ObjectRoot.h
Class ObjectRoot {<br />
<br />
static RTI::RTIambassador* ObjectRoot::ms_rtiAmb; <br />
...............<br />
.........<br />
}
I was just wondering why you would have ObjectRoot:: included in the declaration.
Thanks
|
|
|
|
|
|
Most likely (and you see this a LOT in the RTI codebases), it is a copy-paste thing. When initializing a static member variable, you have to specify the class it belongs to:
static RTI::RTIambassador* ObjectRoot::ms_rtiAmb = NULL;
Someone probably wrote the initialization prior to adding the member to the class and just copied it.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|