|
I did think of this approach, but I'm not sure how to do it. I'm actually new to Windows GUI programming, so I'm stumbling around in the dark a bit. What I have tried are WH_CALLWNDPROC hooks for both the toolbar button and the list control and watching all the messages that these controls received. Didn't get to far. Maybe someone has a better way...
|
|
|
|
|
|
As a software developer with an Electronic and Electrical ENgineering bacground, I always wanted to write device drivers and on Windows NT, 2000 and XP. I downloaded the DDK from MS but could not even write a single line of code despite being familiar with Win32 and MFC?
Where do I find a short and very goo tutorial and how do I get to write and run my codes from the Visual Studio Environment??
Thanks in advance.
Inyang Isaac
Isaac Inyang
Ansyl Technologies
|
|
|
|
|
I don't know anything about DDK but I since I wanted to learn how to use it a while ago, I have this link http://www.osronline.com[^].
I just have a question? Do you have to buy DDK because I can't find a link that lets you download it. On Microsoft's website there are links that tell you how to place orders and stuff. Is there a free version?
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Toni78
Pick the followin files:
http://www.vckbase.com/tools/drv/win2kddk.exe [139MB - Win 2000]
http://windriver.ssarang.net/pds/DDK_XP.ISO [65MB - Win XP]
http://download.microsoft.com/download/win98SE/Install/Gold/W98/EN-US/98DDK.EXE [25MB - Win 98]
I hope that helps you. I need a HYPERLINK TO A PAGE where I can get a proper introduction to DDK. Can you help with that??
Isaac Inyang
Ansyl Technologies
|
|
|
|
|
I have the new ddk, but I bought it from M$. It's not free to download anymore, I suggest you take a look at the software bundle you got and make sure it's the ddk.
I also just popped in the DDK setup CD to confirm, there is a whole section of documentation you can install when you double click the setup icon on the CD. When you arrive at the "DDK Group Components" section of the install dialog you can expand the documentation tree node and select them all. Not to mention the wide variety of samples below on the same tree.
I've also seen a recently published MSPRESS book on the new DDK and drivers, so you'll want to pick that up as well.
|
|
|
|
|
I got my DDK from M$ when it was still free. I burnt it on a CD and still have it with me.
Do you get to write your codes from the Visual Studio IDE or do you use a console / command prompt option?
Isaac Inyang
Ansyl Technologies
|
|
|
|
|
I haven't gotten around to writing a driver for my device, (or building my actual device for that matter) so I can't answer your question yet.
I suppose I will use the VC++6 IDE as usual. From all the examples, and source they have on the CD, when you install, I'm sure you can just double click some .dsw's in the samples folder and check out how it's done. That and read that new black cover M$PRESS book on making device drivers.
|
|
|
|
|
Hello all, I am trying to make a program that counts to a certain number and writes to a seperate file when it started and when it ended. Can anyone help me because I'm really new to logging.
[It is possible to represent everything in this universe by using 0 and 1]
I was born intelligent
Education ruined me!.
An idea is useless until it has been implemented.
|
|
|
|
|
There are tons of log file classes on CodeProject.
cheers,
Chris Maunder
|
|
|
|
|
ok Thx I'll try to look....
[It is possible to represent everything in this universe by using 0 and 1]
I'm going to live forever or die trying.
|
|
|
|
|
I am getting confused in declaring a 2d array
I need a n*4 matrix (n rows with 4 cols in each row)
I wanted to do something like
__int8 stepArray[][]={{1,2,3,4},{5,6,7,8}};
corresponds to
1 2 3 4
5 6 7 8
where n is implicitly 2
I am getting an error . Please help
|
|
|
|
|
only last dimension can be undefined
try
__int8 stepArray[2][]={{1,2,3,4},{5,6,7,8}};
better yet use std::vector
|
|
|
|
|
Actually, it's the opposite. The first dimension can be undefined, as in:
__int8 stepArray[][4]={{1,2,3,4},{5,6,7,8}};
|
|
|
|
|
you can use pointers and memmory allocation to do the trick! try this, it should work, I had an assignment on this, a while ago... Let's see if I can dig up some code
__int8 *stepArray[4] = NULL;
stepArray = (__int8 **) malloc(n * sizeof(__int8*));
while(n-- > 0)
stepArray[n] = (__int8*) malloc(sizeof(__int8));
after this, you can use it as a normal 2d matrix (stepArray[n][m] =...)
It is far more easy to use a vector of some sort, but it's more fun to do it yourself (at least, I experience it that way )
hope this helps
ps.
I don't want te scare you, but beware of memory leaks, because they sneak in very easy...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
(note: italics will contain the text from the documentation of Chris' Grid control. I got it from here)
The underlying class of the grid control is CGridCtrl which is derived from CWnd.
So far, so good
To use it, either use the MS Visual C++ dialog editor to place a custom control on a dialog, and enter "MFCGridCtrl" (no quotes) as the Class name. To subclass the control using the DDX mechanism (this will be done by default by the ClassWizard) use the DDX_GridControl function instead of the DDX_Control function (just manually change the ClassWizard entry). This ensures your control is correctly registered as a drop target and avoids some weird win95 issues.
I am assuming that all of the above is the "either" half of the "either...or" and the below is the "or" half........
Alternatively you can use CGridCtrl::Create:
CGridCtrl grid;
grid.Create(rect, pParentWnd, nID);
where rect is the dimensions, pParentWnd is the parent window, and nID is the id.
Here is where I am stuck. Is nID the control ID of the Grid? Does this mean I still need to create it in the dialog editor? If so, do I still make it a custom control?
I'd really like to use this control. I looked at the demo app and it is really nice!
Any help would be appreciated.
|
|
|
|
|
I generally use the first method. However the second method also works.
Terry O`Nolley wrote:
Here is where I am stuck. Is nID the control ID of the Grid? Does this mean I still need to create it in the dialog editor? If so, do I still make it a custom control?
No, you do not have to use the dialog editor for this, however it is generally easier to do this. You assign it an ID that is not the same as any ID in its parent.
If you wanted to create it in the dialog editor you could make a static control with a specific ID and in your OnInitDialog get the rect. Then create the grid with this rect and give it the id of the static control. Then delete the static control.
John
|
|
|
|
|
Thanks! I got it to compile, but even after calling the SetColumnCount and SetRowCount it is invisible.
So I ripped out that code and went back to the dialog control:
To subclass the control using the DDX mechanism (this will be done by default by the ClassWizard) ......
Since it says it is done by default, does this mean I don't need to do this?
Or does he mean that I need to create a member variable for the control and only if I want to override it should I do the below?
use the DDX_GridControl function instead of the DDX_Control function (just manually change the ClassWizard entry).
Sorry for all the newbie questions, but I am only at this late time getting off of the SDK programming model and I get paranoid when I let something automatically generate weird code mappings for me
|
|
|
|
|
Terry O`Nolley wrote:
use the DDX_GridControl function instead of the DDX_Control function (just manually change the ClassWizard entry).
This is what you need to do.
John
|
|
|
|
|
John M. Drescher wrote:
This is what you need to do.
I am trying to do that, but the control ID for the grid control doesn't appear in class wizard.
The dialog box that contains the grid control fires up when it is supposed to and I included the GridCtrl.h in the source file for the dialog class that contains the grid control.
But when I go to Class Wizard, the only controls it sees are the 2 default buttons.
The grid control appears in the class wizard's first screen when I select the CDIalog derived class that holds the GridCtrl, but it disappears when you click on the Member Variables tab.
I realize the documentation is probably more than enough for most people but I guess I am just dense
|
|
|
|
|
Add this to your class definition:
CGridCtrl m_Grid;
Add this after CDialog::DoDataExchange(pDX); in your DoDataExchange(CDataExchange* pDX) member function
DDX_GridControl(pDX, IDC_GRID, m_Grid);
John
|
|
|
|
|
Grinding along. Thanks for putting up with me.
Well, I added the following:
At the top of my dialog class header file, I added #include "GridCtrl.h"
In my dialog class header file at the top of the public: section I added CGridCtrl m_Grid;
I added DDX_GridControl(pDX, IDC_GRID, m_Grid); per your instructions
When I compiled, I got this:
c:\dev\visualstudio\vc98\include\wtypes.h(369) : error C2632: 'char' followed by 'char' is illegal
c:\dev\visualstudio\vc98\include\wtypes.h(369) : warning C4091: 'typedef ' : ignored on left of 'unsigned char' when no variable is declared
c:\dev\visualstudio\vc98\include\wtypes.h(375) : error C2628: 'DWORD' followed by 'unsigned' is illegal (did you forget a ';'?)
c:\dev\visualstudio\vc98\include\wtypes.h(375) : error C2628: 'DWORD' followed by 'long' is illegal (did you forget a ';'?)
c:\dev\visualstudio\vc98\include\wtypes.h(375) : warning C4091: 'typedef ' : ignored on left of 'unsigned long' when no variable is declared
Is this maybe a #if defined block that is being left open somewhere?
|
|
|
|
|
Are you compiling for UNICODE??
[EDIT]
I am really not sure what is causing the problem is in this case.
[/EDIT]
John
|
|
|
|
|
No unicode.
I'm about ready to shell out the $500 bucks for HalloGram's Ultimate Grid.
Thanks for walking through this with me.
If I ever get this to work, I am going to submit an article that walks a newbie to MFC through getting the thing to function.
|
|
|
|
|
Don't be discouraged. I am not sure what your problem is but it should not be too hard to fix. I have used the grid in at least 5 of my applications...
John
|
|
|
|