|
But when I use the WinDDK I get 3 files for whats suppost to be 1 file (the .sys file or driver). What I want to know is that if the driver or .sys file can work without those 2 other files (one .obj file and a debug database file) independently.
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
|
|
|
|
|
Your original question asked for a list of compilers, so I'm not sure where you are going with this or why you are concerned. The .obj files are the output of the compiler which is then passed in to the linker to produce the executable code. In most projects there will be many .obj files input to the linker. In the case of driver builds the executable is a .sys file which has a special header used by the driver loader. The debug database is another extra that helps in debugging a new driver and, while not essential, is a useful tool for the developer. Using some other compiler would not make any difference to the build process or final product, and indeed why would you want to when the WinDDK kit has been created to do all the menial tasks and allow you to focus in writing your driver?
|
|
|
|
|
Richard MacCutchan wrote: Your original question asked for a list of compilers
Your right, but when you said I already had them.
Richard MacCutchan wrote: I'm not sure where you are going with this or why you are concerned
I'm wondering why I got 3 files when I compiled (successfully), when I compile a driver, I get the .sys file, but two files aswell.
But now I get it, I thought the .sys file needed those two files to run, like as if it was a dependency, but I guess not. But does WinDDK compile it as a binary build.
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
|
|
|
|
|
Brandon T. H. wrote: But does WinDDK compile it as a binary build.
No, WinDDK does nothing, it is merely a set of templates and libraries collectively known as the Windows Driver Development Kit. You use that framework to write your driver code which is then built into the binary files as follows:
The C/C++ compiler (any one will do) converts the source code into interim object files which are in themselves not complete. They may have references to functions in other modules, and are all based on a starting address of 'relative' zero. These object files must then be combined by the linker which fixes external references by finding the object or library that satisfies the reference, rebases all the starting addresses to reflect the real start of the final program, and builds them into a single binary file, with various bits of meta-data required by the system to load the program. Whether the final object has a .sys or .exe extension is just a matter of convention laid down by the operating system. Any interim files may be used to rebuild the executable or aid in debugging as required by the developer, but are not critical to running the program.
|
|
|
|
|
Brandon T. H. wrote: if the driver or .sys file can work without those 2 other files (one .obj file and a debug database file) independently.
Yes, of course, even if it is a debug build.
|
|
|
|
|
Ok, thanks thats what I wanted
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
|
|
|
|
|
Ok, thanks thats what I wanted.
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
|
|
|
|
|
Ok, thanks thats what I wanted to know.
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
|
|
|
|
|
Unfortunately my internet was acting weird and posted my message 3 times :S.. could you excuse those please.
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
|
|
|
|
|
Just use the DDK, everyone else does, and it works, very very well.
|
|
|
|
|
Hi, I have no idea how to start programming C++ for a serial port.
I need some help/ examples for me to start. I tried looking through the net but I have no luck.
I have previously written some simple C++ programs that I can use the keyboard or scanner.
I have a PLC connected through RS232-USB cable to my PC (COM3).
It will send a simple string text like 12A456789, 1288U
It is transmitted through 9600 speed, 8 data bits, 1 stop bit, even parity and flow control none.
Once the program receives the string text, I need to do a simple comparison and save the text to a txt file according to the content received. EG, if contains 1288U, save as 1288U SN.txt. if contains 1288I, save as 1288I SN.txt It should be a simple if and else statement that I can do.
If possible, once the save is completed, the program will send a confirmed message to the PLC (COM3).
Ultimately, I will use bartender commander to extract the txt file for label printing.
Any kind souls can help me with the serial port portion of the C++ program? It will be greatly appreciated. Thanks.
|
|
|
|
|
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.
|
|
|
|
|