User application with GUI

I’m wondering if we can build an user mode application with GUI or only an console application?
Because when I created a new project in Visual Studio, it cannot recognize the variables of system driver.
Do I have to include the header files, or the library files to my project? Can anyone help me?
Thanks a lot.

I have seen user mode applications with GUIs (i’m using one right now) so I’m sure it’s possible :).

Still, what are you trying to do? Are you trying to build a driver or a user mode application ? What version of Visual Studio are you using ?

Thanks,
Alex.

In Visual studio, you typically build GUI applications. Perhaps 1% or
less of my work in the last 15 years has involved console applications,
and most of that work was to get examples of optimized code for
instructioal purposes.

But why in the world would you ever need “variables of system drivers” in
a user-level GUI app? This would already be a serious design error,
unless you are doing something really exotic like using the undocumented
native API. Note that if you are trying to write a user-mode driver, that
is an entirely diferent question, but it is a user mode DRIVER, which is
neither a console app nor a GUI app, and I’ve seen much debate on the
feasibility of using VS to build drivers. Don Burn has commented that he
uses the compiler for syntax checking, but would never build actual driver
code in VS. AFAIK, the building of a driver is not supported in VS, but
someone with more experience may correct me.

If you want to build GUI apps, VB and C# are considered the best
environments today. Being a dinosaur, and having had a client base that
prefers native code, I recommend C++/MFC and for simple apps, build what
are called “dialog apps”, which are simpler to learn how to write than
full document/view apps. Writing to the raw WIN32 API is the equivalent
to writing in assembly code: sure, you can do it, but who in their right
mind would WANT to?

I’ve got a ton of articles on my Web site www.flounder.com/mvp_tips.htm,
look for “The Dialog Box Series” of articles

I’m wondering if we can build an user mode application with GUI or only an
console application?
Because when I created a new project in Visual Studio, it cannot recognize
the variables of system driver.
Do I have to include the header files, or the library files to my project?
Can anyone help me?
Thanks a lot.


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Thanks a lot for the reponses, Mr. Carp, Mr. Newcomer.
I’ve already had the minifilter driver. I want to build an user mode application for communicating with that minifilter. The console app for this has done, and now, i want to transform that console app to a GUI app.
I’m using VStudio 10, win7 64x. After googling, I found out that VS10 has the UMDF/KMDF templatesfor building driver of user mode app, but I cannot find it.
Thanks.

You don’t need UMDF just to write UI to communicate with the minifilter. Just build a regular UI app and use the same mechanism you’ve used in the console app (IOCTLs or the filter communication ports library or whatever) and it should work.

Thanks,
Alex.

You are seriously confused about the difference between a user-mode driver
and an application.

If VS10 has UMDF templates, that is for building user-mode drivers, NOT
for building applications.

My own recommendation is to build and MFC-based app using the
“Dialog-based” style. The relevance of UMDF and KMDF templates to
building user-level apps is essentially nonexistent.

Also, assume that virtually no code from your console app is going to be
reusable in the GUI app. I’ve seen any number of failed attempts to hack
console apps into GUI apps, and they are all doomed from the start. About
all that remains is a few calls to open and read the file, and maybe
something to parse the input data. Note that for a GUI app there is no
stdout, so there is no printf (take a look at my “Logging Listbox” article
for getting debug output in a GUI app)

You could write your app in VS6 if you had sunch an ancient, creaky
product. You don’t ever need to see UMDF or KMDF to write a user-level
GUI app. In fact, if you think you need kernel symbols to write your app,
you are already in deep trouble.
joe

Thanks a lot for the reponses, Mr. Carp, Mr. Newcomer.
I’ve already had the minifilter driver. I want to build an user mode
application for communicating with that minifilter. The console app for
this has done, and now, i want to transform that console app to a GUI app.
I’m using VStudio 10, win7 64x. After googling, I found out that VS10 has
the UMDF/KMDF templatesfor building driver of user mode app, but I cannot
find it.
Thanks.


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Sorry for this late response because I were busy last few days.
Thanks a lot, Mr. Carp, Mr. Newcomer.
I’m checking it out.

In the early 1990s I taught courses on Windows GUI programming. There two
courses that essentially had the same structure, sort of. One was called
“Windows Programming with the Windows API” and used C and the Win16 API.
The other was “Introduction to Windows MFC programming” and used C++ but
did not assume C++ expertise, or even knowledge beyond the name; we taught
a useful subset of C++ embeded in the course.

In the first course, by Thursday afternoon the students could produce an
app that was pretty simplistic but vaguely resembled a “Windows app”.
With a lot of painful code, it sort of produced something that wasn’t an
embarrasment. In the MFC course, with a dozen or so mouse clicks and a
few keystrokes (to give the project a name) we had a complete functioning
app with all the bells and whistles of a “real” app: menus, toolbar,
status bar, menu prmpts in the status bar, and file support. We
accomplished this before lunch break on Monday.

In my System Programming course we develop a full dialog-based testbed in
about 20 minutes (if I’m doing one of my own, I can generate the complete
infrastructure in about seven minutes). This lets you spend the rest of
your time doing useful work, like getting the code in to talk to your
device; you don’t have to waste time remembering whether or not you want
to respond to WM_MOUSEACTIVATE with an MA_ACTIVATE or an MA_ACTIVATEANDEAT
response (you don’t even have to know this message exists! But if you are
doing your own programming to the Win32 API, this is one of the many
messages you MUST handle properly! Which is why it took until Thursday
afternoon to get everything taught).

So if you are going to do a GUI app, use MFC, select dialog-based, drop a
few controls on it, and have fun. My Web site has tons of code examples
and articles. Seriously, you should be able to write your first app
within hours of starting “from scratch”. If you don’t know C++, don’t
worry; you can imitate the patterns you see and teach yourself C++ as you
program. Although I was a C++/MFC MVP for 15 years, it took me 2 years to
get my head around C++. During that same two years I delivered several
apps to satisfied customers. I simply did formulaic copying of code
patterns I found in the MFC-generated C++ code.

Sorry for this late response because I were busy last few days.
Thanks a lot, Mr. Carp, Mr. Newcomer.
I’m checking it out.


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer