I'm trying to use this calss to create a sort of data lookup program, where you type in some text, and the program returns the appropriate description.
I searched all over the net and there isn't a lot of documentation about this. I tried implementing the stuff written on the Microsoft website, but I can't seem to get the very first part to work:
The above gives me this error: - fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
Honestly, this is the very first time I work with MFC and this function. I understand the theory behind the CMapStringToStr ing function, but I have never implemented it. Also, I've been working with Visual Studio 2005 for a very short time (I switched from Visual Studio 6 last week).
Also if it is possible to show me an example of how to use CMapStringToStr ing...I can probably figure it out on my own, but not before I get this #include problem out of the way.
Thank you very much.
8 6985
Be sure WIN32 is defined in your project properties for the preprocessor.
When I defined the project, I selected the Win32 Console Application, if that's what you're referring to.
No.
You should create a Win32 Project.
When the wizard appears, DO NOT CLICK FINISH. Instead, click Application Settings. Select Console Application and MFC.
Now click finish.
Add your files and try a build.
Okay, I tried what you said and now the program compiles...than ks!
The other thing is using that class. Like I said earlier, I've never worked with it before. In any case, here is what I did: - CMapStringToString database();
This compiles fine as well. I still don't know how to use it properly though.
What I have so far: - database.SetAt(code, command)
Which is wrong, because code and command are arrays of strings, but the function SetAt takes in LPCTSTR, which, to be honest, I've never heard of. How do I go about doing this?
Sorry about the double post, but for some reason I can't edit my post anymore :/
Anyway, with regards to the previous post, I forgot to mention that when I try to change code and command from type string to type CString, The other part of my code, the one that reads in values from a file, stops working and starts reading in garbage numbers/letters: - Please enter the filename: test.cpf
-
00359900=00359960
-
0035AE18=0035AE98
-
00359900=0035E048
-
00359900=0035E048
-
00359900=0035E048
-
0035E188=0035E048
-
0035E188=0035E048
-
0035E188=0035E048
-
Data parsing has been completed
-
Press any key to continue . . .
I should be getting this instead: - Please enter the filename: test.cpf
-
<testcode1> = test command 1
-
<testcode2> = test command 2
-
<testcode3> = test command 3
-
<testcode4> = test command 4
-
<testcode5> = test command 5
-
<testcode6> = test command 6
-
<testcode7> = test command 7
-
<testcode8> = test command 8
-
Data parsing has been completed
-
Press any key to continue . . .
Thanks in advance
I believe a LPCTSTR is a long-pointer-to-a-constant-TCHAR-string. Better to just call it a LPCTSTR.
From here on you need info on how to use MFC classes. I would start with Programming Windows with MFC by Jeff Prosise and go from there. You might find something by Googling CMapStringToStr ing.
I don't have time to write a tutorial oin this class.
I believe a LPCTSTR is a long-pointer-to-a-constant-TCHAR-string. Better to just call it a LPCTSTR.
From here on you need info on how to use MFC classes. I would start with Programming Windows with MFC by Jeff Prosise and go from there. You might find something by Googling CMapStringToStr ing.
I don't have time to write a tutorial oin this class.
Thanks for the title of the book. I was looking for one yesterday but didn't find much. I'll go to the library later today and maybe I can find it.
Thanks again for your help, I appreciate it :)
I checked and it's available on Amazon.com.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Murat Tasan |
last post by:
hi, i am having a small problem with constructing an inner class.
i am using an inner class (and not a static nested class) because the
methods of the inner class need access to the enclosing object's members.
now, i have an enclosing class, which has a static factory method (loads
an instance of the enclosing class from a serialized file,...
|
by: Fernando Rodriguez |
last post by:
Hi,
I need to traverse the methods defined in a class and its superclasses. This
is the code I'm using:
# An instance of class B should be able to check all the methods defined in B
#and A, while an instance of class C should be able to check all methods
#defined in C, B and A.
#------------------------------------------------
|
by: Gabriel Genellina |
last post by:
Hi
In the following code sample, I have:
- a Worker class, which could have a lot of methods and attributes. In
particular, it has a 'bar' attribute. This class can be modified as needed.
- a Base class (old-style) which defines a default class attribute 'bar'
too. I can't modify the source code of this class. Note that Workes does
not...
|
by: Robert |
last post by:
Python doesn't know the class of a method when container not direct
class attribute:
>>> class X:
.... def f():pass
.... g=f
.... l=
....
>>> X.g
<unbound method X.f>
|
by: Oplec |
last post by:
Hi,
I'm learning C++ as a hobby using The C++ Programming Language : Special
Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises that
deal with templates. Exercise 13.9 asks for me to turn a previously
made String class that deals with char's into a templated String class
that uses the template parameter C instead of char. I...
| |
by: Banaticus Bart |
last post by:
I wrote an abstract base class from which I've derived a few other
classes. I'd like to create a base class array where each element is
an instance of a derived object. I can create a base class pointer
which points to an instance of a derived class, but when I pass that
base class pointer into a function, it can't access the derived...
|
by: Andy |
last post by:
Hi all,
I have a site with the following architecture:
Common.Web.dll - Contains a CommonPageBase class which inherits
System.Web.UI.Page
myadd.dll - Contains PageBase which inherits CommonPageBase
- Contains myPage which inherits PageBase
Each of these classes overrides OnInit and ties an event handler
|
by: Hamilton Woods |
last post by:
Diehards,
I developed a template matrix class back around 1992 using Borland C++ 4.5
(ancestor of C++ Builder) and haven't touched it until a few days ago. I
pulled it from the freezer and thawed it out. I built a console app using
Microsoft Visual C++ 6 (VC++) and it worked great. Only one line in the
header file had to be commented out....
|
by: emin.shopper |
last post by:
I had a need recently to check if my subclasses properly implemented
the desired interface and wished that I could use something like an
abstract base class in python. After reading up on metaclass magic, I
wrote the following module. It is mainly useful as a light weight tool
to help programmers catch mistakes at definition time (e.g.,...
|
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...
|
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...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |