|
I suggest to read the CP article Serial library for C++[^]. The article is a very good introduction to serial I/O with Windows. You may use the provided library or use the sources as base for your own code.
|
|
|
|
|
Lots of samples to get you started here[^].
|
|
|
|
|
See here.
"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
|
|
|
|
|
A great, classic link. Joseph Newcomer has written many great articles. Any beginner can gain knowledge from browsing through his contributions.
Soren Madsen
|
|
|
|
|
How to get list of C++ class name from source code. I have created few sequence and class diagram using EA tool which I need to verify. I tried to use sourcmonitor tool but it gives only number of classes in a particular source file. But does not generate any class name list.
|
|
|
|
|
Some pseudocode to get you started:
Open .h file
Repeat
Read line from file
If line starts with "class ", next word is class name
Until EOF
Close file There may be some situations where this might not work.
"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
|
|
|
|
|
|
hi,
i'm using opencv with mfc for image processing and getting this error, "error c2071 : 'CvMouseCallback' illegal storage class", which i don't understand why. the code giving this error is:
typedef void CvMouseCallback( int CV_EVENT_LBUTTONDBCLK, int x, int y, int flags, void* param )
{
}
and it has been defined in header file as
typedef void (CV_CDECL *CvMouseCallback )(int event, int x, int y, int flags, void* param);
can someone help me.
Regards
-J
|
|
|
|
|
jawadali477 wrote: typedef void CvMouseCallback( int CV_EVENT_LBUTTONDBCLK, int x, int y, int flags, void* param )
{
}
When you are defining (writing the code of) your function to handle the callback, you don't want typedef , and you want to USE the typedef from the header file. So what you want is something like
CvMouseCallback my_callback_function(int event, int x, int y, int flags, void *param)
{
}
Also, you don't want the constant CV_EVENT_LBUTTONDBCLK in your function definition.
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
thank you Peter for your reply.
i did modified the code as you suggested but now i'm having this errors
error C2660: 'SetDlgItemTextW' : function does not take 2 arguments
error C2660: 'SetDlgItemTextW' : function does not take 2 arguments
error C2660: 'SetDlgItemTextW' : function does not take 2 arguments
error C2664: 'cvSetMouseCallback' : cannot convert parameter 2 from 'CvMouseCallback (__cdecl *)(int,int,int,int,void *)' to 'CvMouseCallback'
the lines that are giving this errors are
CvMouseCallback on_mouse( int event, int x, int y, int flags, void* param )
{
CvScalar s;
CString Blue, Green, Red;
IplImage* zoomed = (IplImage*) param;
s=cvGet2D(zoomed,x,y);
Blue.Format(_T("%0.2f"), s.val[0]);
Green.Format(_T("%0.2f"), s.val[1]);
Red.Format(_T("%0.2f"), s.val[2]);
SetDlgItemText(IDC_Blue, Blue);
SetDlgItemText(IDC_Green, Green);
SetDlgItemText(IDC_Red, Red);
}
cvSetMouseCallback("box.png", on_mouse, (void*) zoomed)
(defined some other place);
|
|
|
|
|
First regarding error C2660, who have used the MFC version of SetDlgItemText, which is a wrapper for Win32 API. If your function is a member of dialog class then the handle to the dialog is passes as a first param. So to get rid of C2660 pass the handle of the dialog as first param and then pass the next two params.
And regarding C2664 the declaration is incorrect. Your callback function should return void with calling convention as CV_CDECL (or equivalent basic calling conevention, check this in your code)
Do your Duty and Don't Worry about the Result
|
|
|
|
|
I have rich control used in my project display the current activity. It should only allow the copying of that log. Now the issue is using Ctrl+Shift+> keys user able to zoom that text, what should we do to disable that feature?
Live life happily until your last second
|
|
|
|
|
I'm not sure if you can properly disable it's zooming function, but you could interfere the event, by doing the following below.
You could probably add a timer OR a key down event on your form/window when those three key combos are set, it immediately forces the rich text box back to it's original zoom config. or you could just set a timer to an interval of 100 and let your timer reset the rich text box's zoom config. over and over.
Simple Thanks and Regards,
Brandon T. H.
Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst).
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
hi,
i am developing a program using MFC in vs2008. i'm using opencv lib with MFC for image processing. part of the program has been developed where i can open an image residing in a file. now i wanted to get the coordinates of the opened image with double click of mouse on the image using mouse callback function. can any one help me regarding this?
Regards
Jawad
modified 21-Jun-12 5:50am.
|
|
|
|
|
jawadali477 wrote: get the coordinates of the opened image with double click of mouse on the image using mouse callback function.
When you click on any Window you will get a notification from the system which includes the location of the mouse when it was clicked. See here[^] for details of each specific message.
|
|
|
|
|
Quote: get the coordinates of the opened image
You mean you want to get the Image Height and Width. What Co-ordinate you are talking about?
|
|
|
|
|
yes, i'm talking about the pixel coordinates (i.e pixel height and width).
|
|
|
|
|
The bitmap file usually have a BITMAP header, color palette and actual pixel information (Bits referring the color palette or raw bits if color palette not used). The bitmap header will have the height and width of the image.
Quote:
typedef struct tagBITMAPINFO {
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[1];
} BITMAPINFO;
Taken the above one from msdn. The Quote: BITMAPINFOHEADER structure has the information you need.
|
|
|
|
|
Hi, I want to just show a powerpoint presentation in my VC++ windows application like a picture box. but I'm new to VC++ and don't know how to do it! please help me!
tanx for any answers!
|
|
|
|
|
See here[^] ... is good sample.
|
|
|
|
|
tnax for your answer,
It seems to be good, but I dont get how it works!!! and it gives an error when I try to insert powerpoint presentation object : "Failed to create the object, Make sure the object entered in system registery"
my powerponit version is 2010 can it make problem?!
|
|
|
|
|
(i upvoted)
Nice question. hope you get an answer.
Watched code never compiles.
|
|
|
|
|
amir700 wrote: show a powerpoint presentation in my VC++ windows application like a picture box
Good question, I agree.
Simple Thanks and Regards,
Brandon T. H.
Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst).
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
I hope to find best answer by your helps,
thanks my friends!
|
|
|
|
|
Does function with other office components ? Excel, for sample ...
modified 22-Jun-12 14:49pm.
|
|
|
|