473,386 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Newbee Visual C++ Question -- GetWindowsDirectory()

Hi!

I've fired up my first Visual C++ .NET (Version 7) project and have made
some nice progress. However, I'm now trying to call the familiar
GetWindowsDirectory() API.

When I'm laying in the code, the editor recognizes the function (it is
prompting me for the proper parameters) but when I compile I get "Error
3861: 'GetWindowsDirectory' : identifier not found, even with argument
dependent lookup".

I'm making the call just after InitializeComponent() in my initial form:

GetWindowsDirectory(WindowsDirectory,sizeof(Window sDirectory));

I've defined the receiving buffer as a char array (perhaps this is one
problem):

char WindowsDirectory[_MAX_PATH]="";

and I've tried locating this declaration at various places through the my
form1.h file.

Removing the API call results in a successful compilation and link.

Can someone see what I'm doing wrong? It could be a real bone-head
mistake -- I'm new to this development environment.

TIA

Harry

Nov 17 '05 #1
3 2285
"Harry Whitehouse" <ha***@envmgr.com> wrote in message
news:O0**************@TK2MSFTNGP15.phx.gbl...
I've fired up my first Visual C++ .NET (Version 7) project and have made
some nice progress. However, I'm now trying to call the familiar
GetWindowsDirectory() API.

When I'm laying in the code, the editor recognizes the function (it is
prompting me for the proper parameters) but when I compile I get "Error
3861: 'GetWindowsDirectory' : identifier not found, even with argument
dependent lookup".
...
Can someone see what I'm doing wrong? It could be a real bone-head
mistake -- I'm new to this development environment.


What kind of project are you building? If you are building a native Windows
application, did you include this line

#include <windows.h>

Regards,
Will


Nov 17 '05 #2
Hello Will!

Thanks for getting back on this. My target platform is indeed Windows and I
guess I was a bit surprised when the application building didn't add
windows.h automatically.

I've tried adding that to stdafx.h and, when I did, some new errors popped
up in strange places. In one case a System::MessageBox() line of code was
in error and in another case an icon reference for a button threw a compiler
error. I gave it a try again, and remarked out the problem lines, and now I
get a good compile and link!

This was the icon line that threw an error:

//this->Icon = (__try_cast<System::Drawing::Icon *
(resources->GetObject(S"$this.Icon")));

So is there another way to start a project in VC++ .NET which defines from
the outset that this will be a Windows application?

Thanks!

Harry

..
What kind of project are you building? If you are building a native
Windows application, did you include this line

#include <windows.h>

Regards,
Will

Nov 17 '05 #3
"Harry Whitehouse" <ha***@envmgr.com> wrote in message
news:OT**************@TK2MSFTNGP10.phx.gbl...
So is there another way to start a project in VC++ .NET which defines from
the outset that this will be a Windows application?


I was wondering whether you were targetting the .Net framework or native
Windows as <windows.h> is not required in the former case and in fact can be
a little problematic in managed applications.

I start new native projects like this, from the menu File->New then then I
click on the Visual C++ Projects "folder" then I choose the Win32 Project
icon in the right pane then the Application Settings link on the next dialog
and finally I check one of the application types.

Regards,
Will
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Richard | last post by:
Just downloaded python for the fun of it. What do I run to begin coding with? Version 2.3.3 When I run the "command line" thing, I get a dos window. Now what? The built in tutor explains...
2
by: Gunter Dubber | last post by:
Hi All just been given a project converting clipper app with Dbase files into Windows using "CA Visual Objects" Now my question: My objective is to keep the selling price of the app as low as...
2
by: Newbee Adam | last post by:
some said that .NET app can run on any program where rutime exists. What is "runtime" in this sense? will I have to install runtime or .net framework or .NET support on an xp machine for a...
2
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! I was testing an application that is writing a mail and sends it to a recieptiens. I then came across a couple of ??? in my head, coul anyone briefly tell me what the difference is between...
1
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Doesn't Visual Studio Enterprise 2003 come with components for file and directory browsing? This simple thing was included in Delphi 2005... Regards Martin Arvidsson
11
by: Harry Whitehouse | last post by:
I'm trying to obtain the load directory for my application, as well as the Windows directory on the machine, but I don't know how this is accomplished in VC++ .NET. In C# there is an Application...
1
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi all! Sorry if this is the wrong NG for this type of Q. On my .aspx page i have a TextControl and a button. When i press the button, i want to insert the changes to my SQL database how do...
1
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi all! Sorry if this is the wrong NG for this type of Q. On my .aspx page i have a TextControl and a button. When i press the button, i want to insert the changes to my SQL database how do...
7
by: Greg P | last post by:
I'm new to VS2005 and want to simply update my data with the dataGridView that was generated when I draged my query from the Data Sources Pane. I think I may need to create a Data Adaptor but I'm...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.