|
hi!
i want to develop file filters for win2k.
i have installed win2k ddk.
i am using visual c++6.0 Enterprise Edition
i tried to run samples provided with the ddk.
/src/storage/filters/diskperf
when i compiled it i got 102 erros,just pasting a couple:
c:\ntddk\inc\ddk\ntddk.h(370) : error C2061: syntax error : identifier 'PULONG_PTR'
c:\ntddk\inc\ddk\ntddk.h(371) : error C2059: syntax error : '}'
c:\ntddk\inc\ddk\ntddk.h(824) : error C2061: syntax error : identifier 'KSPIN_LOCK'
c:\ntddk\inc\ddk\ntddk.h(824) : error C2059: syntax error : ';'
c:\ntddk\inc\ddk\ntddk.h(825) : error C2143: syntax error : missing '{' before '*'
c:\ntddk\inc\ddk\ntddk.h(3654) : error C2061: syntax error : identifier 'ULONG_PTR'
so i traced back the definitions of 'PULONG_PTR',
'ULONG_PTR' etc.. those are defined in basetsd.h
basetsd.h is included in ntdef.h which is inturn included in ntddk.h, for which we are getting the errors.
there are 2 versions of basetsd.h on my system
one provided by ms-visual studio and the other is provided by win2k ddk.
the basetsd.h provided by win2k ddk has the definitions of the 'PULONG_PTR','ULONG_PTR' etc..
while compiling the compiler is taking basetsd.h provided by ms-visual studio and not the one provided by win2kddk.
so i changed the path in #include for basetsd.h in ntdef.h
so that while compling ddk's verion of basetsd.h is used.
i complied and it worked 102 errors were cut down to 3 following ones:
c:\ntddk\inc\ddk\ntddk.h(9106) : error C2061: syntax error : identifier 'PCONTEXT'
c:\ntddk\inc\ddk\ntddk.h(9107) : error C2059: syntax error : '}'
c:\ntddk\inc\ddk\ntddk.h(10347) : fatal error C1189: #error : "Target architecture not defined"
now i dont know whats the problem.
the ddk is not compatilbe with vc complier or i cannot guess.
so please enlighten me with the above said problem
regards
anshu
|
|
|
|
|
I suspect you're not using the DDK command prompt that the DDK installed, which sets up the include path properly, and you're not using the BUILD tool for building drivers.
Stick to using BUILD .
A good resource for device driver development is OSR Online[^]. I suggest subscribing to their NT Insider newsletter. I seem to recall a back issue describing how to use the VC IDE with the BUILD tool.
|
|
|
|
|
I checked OSR Online, It is a very useful web site for WDM developers.
Thanks Mike,
A. Riazi
|
|
|
|
|
Hi all programmers!
Does anybody know how to set the attribute to Hidden for a file using VC++.
I have only found how to set attributes like Read-only.
Martin_j
|
|
|
|
|
Both attributes can be set with SetFileAttributes .
|
|
|
|
|
Hello all
I'm using ComboBox control and adding some strings to it. Assume that I'm adding 4 strings to ComboBox and at runtime if I select dropdown from ComboBox it's showing only two elements where to see the next two I need to scroll down.
My question is there anyway to see the entire list when dropdown is selected. If anyone knows how to do it, please help me.
Thanks for your help.
Hari.
|
|
|
|
|
Yes, you can enlarge the size at design time by clicking on the arrow and resize the rectangle to the size you want (if it's bigger than all the strings it contains, it will be clipped).
Hope this helps
|
|
|
|
|
Hello Cedric
Thanks for the reply, now I'm able to view all the list items.
Thanks for your time.
Hari.
|
|
|
|
|
You're welcome
haritadala wrote:
Thanks for your time.
Hum, I think my time is not sooo precious
|
|
|
|
|
How can I link to a .lib file in the .NET IDE?
Themis
|
|
|
|
|
In Project Properties, go to Configuration Properties > Linker > Input and add your .lib file to the Additional Dependencies field.
|
|
|
|
|
Where are the project properties? I can't find them.
Themis
|
|
|
|
|
Ah yes, the amazing disappearing menu option...
In the Solution Explorer panel, highlight your project. Go to the Project menu > Properties.
I think the idea was that the properties dialog would be context sensitive, but for someone coming from VC6, it's just annoying.
Note that the dialog isn't modal - if you click something else in Solution Explorer you'll get properties for that instead. If you click an editor window the dialog changes to a window reading 'There are no property pages for the selection'.
|
|
|
|
|
It's really amazing how magnificiently they hid it!
Thank you, Themis
|
|
|
|
|
I want to add MouseDown Event on my CButton
I try to make my class so that it inherits from CButton.
Still no luck. Please help me to solve this!!
|
|
|
|
|
Derive your own button class from CButton, e.g. CYourButton.
If you have a button in your dialog, e.g. IDC_BUTTON, do this in OnInitDialog:
m_YourButton.SubclassDlgItem(IDC_BUTTON, this);
and in the.h file: CYourButton m_YourButton;
Add the mouse button down message handler in CYourButton.
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Thanks for your quick post.
I tried to add the MouseDown event(it is going to be
protected member, rigth!?) on CYourButton
and those parts you mensioned in red, but
when i tried to debug and put a break point
inside of MouseDown Event, it doesn't go to
CYourButton. I am missing something here?
Thanks for your help.
Shin
|
|
|
|
|
You are not giving me a lot of information to go on.
Anyway, if you add CYourButton in the class view and then use the Class Wizard to add a message handler for WM_LBUTTONDOWN (in CYourButton), your derived button class should look something like this:
.h:
class CYourButton : public CButton
{
public:
CYourButton();
public:
public:
public:
virtual ~CYourButton();
protected:
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
.cpp:
CYourButton::CYourButton()
{
}
CYourButton::~CYourButton()
{
}
BEGIN_MESSAGE_MAP(CYourButton, CButton)
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
void CYourButton::OnLButtonDown(UINT nFlags, CPoint point)
{
TRACE("> Left mouse button down\n\r");
CButton::OnLButtonDown(nFlags, point);
}
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Fredrik Thank you very much,
seems like i had to put presubclasswindow in my dialog class.
Now it's working.
Thanx
Shinya
|
|
|
|
|
How to input Greek in VC++(.h, .cpp)?
How to input Greek in VC++ resource(.rc)?
How to show Greek in English Windows98 or Windows2000?
Thank!
|
|
|
|
|
I have a "parent" application. I want to create and destroy a child process using the parent application. I am successfully creating a new process (notepad) but unable to destroy it. Can any one tell me how to destroy a process ?
For creation of process i am doing something like:
STARTUPINFO si;
PROCESS_INFORMATION pi;
GetStartupInfo(&si);
::CreateProcess(NULL, "notepad",
NULL,
NULL,
TRUE,
0,
NULL,
NULL,
&si,
&pi);
and for ending process i am doing:
DWORD exitCode ;
BOOL a =::GetExitCodeProcess(pi.hProcess, &exitCode);
::ExitProcess(exitCode);
But when i try to end process my parent process destroys itself. Very strange that if i use TerminateProcess instead of ExitProcess , the child process successfully ends. But i want to use ExitProcess because MSDN recommends it. What is the problem here ?
Imtiaz
|
|
|
|
|
Imtiaz Murtaza wrote:
But when i try to end process my parent process destroys itself. Very strange that if i use TerminateProcess instead of ExitProcess, the child process successfully ends.
It's not strange at all. This is exactly what the docs say will happen. ExitProcess() exits the current process, TerminateProcess() terminates another process.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Note that TerminateProcess is extremely brutal. If you can, try to find top-level windows belonging to that process (see EnumWindows and GetWindowThreadProcessId ) and send them a WM_CLOSE message. This will allow the process to tidy up properly before it quits.
|
|
|
|
|
Mike Dimmick wrote:
Note that TerminateProcess is extremely brutal.
Absolutely. I like being brutal
But yes, it's not really a good idea to use. It doesn't allow the process to finish whatever it's doing, and files and settings may become corrupted.
Mike Dimmick wrote:
If you can, try to find top-level windows belonging to that process (see EnumWindows and GetWindowThreadProcessId) and send them a WM_CLOSE message.
If it has a window and is behaving itself this will work. If it has no window, use PostThreadMessage() to post a WM_QUIT message to the application's main thread (use the toolhelp library to get the thread id of the main thread of the process). If this doesn't work, then TerminateProcess() is the only alternative (or do nothing of course).
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi, all
i capture the images from the video input source(eg. cam) by using directshow's ISampleGrabberCB's callback function. but now i need to change the output's resolution from 320*240 to 640*480, the capture image's size also need to be changed into 640*480, anyone knows how can i do that? thanks
|
|
|
|