This is from something I wrote 15 years ago.
Haven't use c since then
Wanted to use it now so I cut and pasted into VS2005 on WinXP
Now I can't seem to get the types OK
GetModuleFileNa me requires LPWCH for szModulePath
What are the compatible types??
Thanks
char szModulePath[SIZE_OF_PATH];
GetModuleFileNa me(happThisInst ance, szModulePath, sizeof(szModule Path));
//Remove the FileName from the full pathname
PSTR pstr = szModulePath + lstrlen(szModul ePath) - 1;
//note: '\\' is the character \ The first \ is a c language escape character
while ((*pstr != '\\') && (*pstr != ':') && (pstr >= szModulePath)) pstr--;
pstr++;
*pstr=(char)0; 2 3566
>GetModuleFileN ame requires LPWCH for szModulePath What are the compatible types??
You could use TCHAR - which is a wide (16-bit) character in a Unicode
build, or a char in a non-Unicode build.
Your existing code should work relatively easily if you change the
(default) setting of your new VS2005 project from Unicode.
Dave
> This is from something I wrote 15 years ago. Haven't use c since then
Wanted to use it now so I cut and pasted into VS2005 on WinXP
Now I can't seem to get the types OK
GetModuleFileNa me requires LPWCH for szModulePath
What are the compatible types??
VS2005 has the unicode character set as its default, which is not compatible
with your usage of CHAR*
To solve your problem you have to revert the character set to ASCII.
you do that by setting the 'character set' property in your general project
properties to 'not set'.
Note: if you use precompiled headers, you have to make sure that it is
recompiled after your change, otherwise the compiler will still see the
unicode definition of GetModuleFileNa me.
--
Kind regards,
Bruno. br************* *********@hotma il.com
Remove only "_nos_pam" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: cppaddict |
last post by:
I thought that:
char x;
made x into a pointer-to-char.
But how come the following code won't compile:
int main() {
char pbuf;
|
by: FroxX |
last post by:
Hi all,
i have a question.
What does those ** mean???
For example:
void function(Something **pSomething);
I hope someone can help me about it.
Thanks,
|
by: Matt |
last post by:
Hi,
I have a probelm here:
If I declare:
char *p="Hello";
|
by: damian birchler |
last post by:
Hi
I'm wondering of what type a structure is. Of course, it is a
_structure_, but an array isn't an _array_ either. So of what type is
a structure? I'd say a pointer, am I right?
|
by: chellappa |
last post by:
hi ,
please explain me , char pointer , char Array, char ,string...
i have some many confussion about this...
please clarify to me..
i need some example about this program
by
chellappa.ns
| |
by: sherifffruitfly |
last post by:
Hi,
I'm just learning cpp, and the exercise I'm working on is basically as
follows:
1) Create a struct type with 4 members (char, char, char, int).
2) Create an array of, say 3 instances of the struct, and populate them
with data.
3) cin 1, 2, 3, or 4 from the user
4) If the user selected, say, 2, display the contents of the 2nd data
|
by: Omats.Z |
last post by:
what is meaning os "char **option meet"?
I get a function like this:
__________________________________
int getchoice(char *greet, char *choices)
{
int chosen = 0;
int selected;
char **option; // what is this line mean?
do {
printf("Choice: %s\n", greet);
|
by: Bobrick |
last post by:
Hi.
I'm in the process of making a GUI for a function someone else wrote,
and i've come across a type i'm unfamiliar with, namely
"std::vector<unsigned char>". I need to get the contents of this
variable into a form I can display in a text box, but i'm not sure what
to expect inside of the variable, whether I can just treat it like an
array e.t.c. Any help would be appreciated.
Thanks,
|
by: chutsu |
last post by:
I got errors:
qu2-1.c:66: warning: format '%s' expects type 'char *', but argument 2
has type 'char (*)'
qu2-1.c:72: warning: format '%s' expects type 'char *', but argument 2
has type 'char (*)'
but I don't quite know what it means...
<code/>
#include <stdio.h>
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |