Static CMap object #2

Hi all,
Excuse but the other message is wrong

I've declared in my .h file the following CMap type :
typedef CMap<CString, CString&, MyClass*, MyClass*&> Map;
...
...
class AnotherClass
{
...
public:
static Map BuilderMap;
...
...
static void Register(CString name, MyClass* instance);
};

In one of my CPP file call the Register method as following:
AnotherClass::Register(_T("TEST"), this);

The code of Register method is :
void AnotherClass::Register(CString name, MyClass* instance)
{
AnotherClass::BuilderMap.SetAt(name, instance);
}

When linking my project there the following linker error :
LNK2001: unresolved external symbol "private: static class CMap<class 
CString,class CString &,class MyClass *,class MyClass * &> 
AnotherClass::BuilderMap"

Why ?

0
2/21/2006 2:17:30 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1233 Views

Similar Articles

[PageSpeed] 21

Stefano Magni wrote:
> I've declared in my .h file the following CMap type :
> typedef CMap<CString, CString&, MyClass*, MyClass*&> Map;
> ..
> ..
> class AnotherClass
> {
> ..
> public:
> static Map BuilderMap;
> ..
> };
> 
> When linking my project there the following linker error :
> LNK2001: unresolved external symbol "private: static class CMap<class 
> CString,class CString &,class MyClass *,class MyClass * &> 
> AnotherClass::BuilderMap"

Put this in AnotherClass.cpp:

Map AnotherClass::BuilderMap;
0
mac1 (347)
2/21/2006 5:17:04 PM
Thanks, now is correct ..

"Mihajlo Cvetanović" wrote:

> Stefano Magni wrote:
> > I've declared in my .h file the following CMap type :
> > typedef CMap<CString, CString&, MyClass*, MyClass*&> Map;
> > ..
> > ..
> > class AnotherClass
> > {
> > ..
> > public:
> > static Map BuilderMap;
> > ..
> > };
> > 
> > When linking my project there the following linker error :
> > LNK2001: unresolved external symbol "private: static class CMap<class 
> > CString,class CString &,class MyClass *,class MyClass * &> 
> > AnotherClass::BuilderMap"
> 
> Put this in AnotherClass.cpp:
> 
> Map AnotherClass::BuilderMap;
> 
0
2/22/2006 6:56:28 AM
Reply:

Similar Artilces:

Mail won't send #2
I have had no problem with this for a year of using Outlook 2002 then for no reason I can fathom, my mail will not send, it stays in the Outbox and I eventually get an error 'reported error (0x8004210B):The operation timed out waiting for a response from the sending (SMPT)server etc, etc' I have both service packs installed (this problem in MS Knowledge Base) and I can delete the e-mail from the Outbox. I can also send mail using Outlook Express and can send mail from a second networked computer using Outlook 2002 and Internet Connection Sharing, so it can't be at the ISP's en...

outlook distribution lists #2
if i set up and name a distribution list, will each member of the group know who everyone else is? Well "knowing" is quite a lot but they do see eachothers address if you use the To or CC field. Better is to use the BCC field. -- Roady [MVP] www.sparnaaij.net Microsoft Office and Microsoft Office related News Also Outlook FAQ, How To's, Downloads and more... Tip of the month: -Create your own fully customized Toolbar Subscribe to the newsletter to receive news and tips & tricks in your mailbox! www.sparnaaij.net (I changed my reply address; remove all CAPS and _underscore...

Custom forms #2
I have created a form in outlook so I have a PO Book that I record purchases (I use a Journal folder). I would like to create a drop down list on this form as a quick way to choose a vendor without having to type it in everytime. I have added the "Combo Box" field. then I go to it's properties, and I'm not sure what to give it, and how do I add the list of vendors? On the Value tab, you need to pick (or create) the Outlook data property that you want to use the store the information. After you do that, you'll be able to enter the vendors as a semi-colon delimited li...

Getting big amounts of mail between 2 users
Hi all I have a user on the network who receives all the applications for the vacancies advertised. The financial manager now wants to view the applications for her comment. the person responsible for the vacancies but it in different folders under her inbox e.g Secretary applications go to a secreatary folder, etc Question: How do i make the applications available to the Financial Manager who wants to browse through it. I was thinking of creating a additional mailbox e.g username.applications and add it to both users profile so that the first user can just drag the mails in there and...

550 5.7.1 Unable to relay for user@domain.com #2
I'm running Exchange 2003 on server 2003 sp1 and im getting relaying errors from external domains. I can send to internal and external users ok, but if someone from an external domain (gmail.com, yahoo.com, etc) try to send me a message i get this error: Technical details of permanent failure: PERM_FAILURE: SMTP Error (state 9): 550 5.7.1 Unable to relay for user@domain.com I checked my mx record and everything seems to be ok. ive been reading up on relaying, and from what i understand, i shouldnt have to enable relaying unless i want an external user in domain1 to send mail through my e...

SSL for OWA #2
We use a front End/ Back End configuration. If we want to use SSL: I need to enable it on all servers? or just the front end? Just the Front-end. -- Ben Winzenz Exchange MVP MessageOne "FD" <Anon@> wrote in message news:%233zo50EaFHA.3280@TK2MSFTNGP09.phx.gbl... > We use a front End/ Back End configuration. If we want to use SSL: I need > to enable it on all servers? or just the front end? > Hi, You need to enable it on the front end only... If you want to secure traffic between FE et BE servers, you have to use IPSec. Stefan "FD" <Anon...

Outlook 2007 Calendar #2
Hi guys, my outlook 2007 runs fine, until I open the calendar. Once I do Outlook freezes! My set-up: - WinXP Prof SP2 - Outlook 2007 (now with the SP 1 MSO) - Mail with IMAP - Calendar in local pst - My Outlook today works fine (including the calendar) - I am syncing through iTunes with my iPhone - still works fine - editing and creating new appointments works fine, too! - reminders for appointment works. ONLY opening the calendar view leads to a freeze! Steps I did to resolve (at least trying): - Office Diagnose - all fine - Outlook Repair - scanpst - no errors in the applicable pst. H...

CRM 1.2 Manual
Hi I am planning to take the MS-CRM1.2 customisation and Professional Exam, Could anyone let me know as to where I could find the MS-CRM 1.2 Manual and other course work. Regards Neena Look on http://www.microsoft.com/BusinessSolutions/MSCRM/Highlights/mscrmtraining_ecom.mspx For training information. There is also product documentation on the CD that shipped with Microsoft CRM 1.2. In addition, here is a list of documentation for Microsoft CRM 1.2 and its related products: • Microsoft Business Solutions CRM Implementation Guide The Implementation Guide provides the information requ...

Re: Can Outlook Be Uninstalled -- With All Its Baggage? #2
Can Outlook 2003 Be Uninstalled -- With All Its Baggage and Updates? Many don't need it now they have WLM, with forthcoming updates. How much disk space does it take? Thanks. -- DSH Lux et Veritas et Libertas Vires et Honor ...

Find difference between 2 cells if critera in a 3rd cell is met
How would I find the difference between two cells depending on what is in a third cell? For example, in column G1 I want to show the difference E1 and whichever cell in column F contains the number 1. I was thinking something along the lines of using SUMPRODUCT to find the row with the #1 and then somehow subtracting G1 from the number column E that match the row where the number 1 was found. This is VERY confusing! At least, to me it is. There's probably a simple solution but I don't understand. You want the formula in cell G1? This is the really confusing part: ...

Corrupted pst files #2
Hi, My outlook 2003 file is corrupted, it says when i try to open it "unable to open because it's not a personal file folders" I ran scanpst.exe, it detected an error and said that the file is repaired. but still i cannot open it. i downloaded a tool Outlook Recovery, it works but it's a demo version. Does anyone knows a free tool that allow me to recover my Emails, Please it's urgent... WaJo <wajoum@gmail.com> wrote in message news:1140273099.291551.97380@g14g2000cwa.googlegroups.com... > Hi, > > My outlook 2003 file is corrupted, it says wh...

De-serializing polymorphic objects
Hi, Have you any ideas about de-serializing a collection of polymorphic pointers? Please check the code below: Class A : public CObject { ... }; Class B : public A { ... }; Class C : public A { ... }; // Serializing and de-serializing a collection: #include "A.h" #include "B.h" #include "C.h" #include <map> map<unsigned int, A*> poly_map; void AddVariousPolymorphicObjects() { B* pB = new B; C* pC = new C; poly_map[1] = pB; // Implicitly converts from B* to A* (like static_cast<A*>(pB)) poly_map[2] = pC; // Implicitly conver...

How do I put drawing objects behind text/cells in a spreadsheet?
Using a background will not work because I am dealing with mutliple objects which need regular moving and changing. since objects sit on top of the sheet, i am not sure you can do that unless the object has a transparent setting. >-----Original Message----- >Using a background will not work because I am dealing with mutliple objects >which need regular moving and changing. >. > ...

More than one profile in Outlook. #2
Hi I have a e-mail user that needs to open more than one e- mail account at a time, using Outlook 2002. If I click, File, Open, Others User's Folder, it works and he can get the mail for that e-mail account. When I try to put all the mailboxes in the folder list by clicking Tools, Email Accounts, View or change existing e-mail account, next, Change, More Settings, Advanced and then Add it gives me this message: The name could not be resolved. The action could not be completed. Can anyone help? ...

statically link a DLL
Hi, Is it possible to statically link any dll to my application? I'm talking about 3rd party dll's in particular that I can dynamically link now. What are the requirements to be able to statically link a dll? Lisa >Is it possible to statically link any dll to my application? No, it's not possible at all. The VC++ run-times are supplied in multiple forms, both static library and DLL, so that may be affecting your viewpoint. Dave you can statically link to static library only. You always implicity or explicitly link to a dll OR in other words, load time linking or runtime...

Tab in a cell #2
Hey all! You know how in excel if you tab, you go to the next cell to the right? How can I tab in a cell, to make an indent? I also have a weird problem with this particular cell (maybe it is due to me spacing instead of tabbing...) In a cell, I have 3 paragraphs of written information. The last three lines however just keep going to the right, instead of wrapping, like I have this cell formatted to do. Any thoughts on how to resolve either of these problems? -- Roz ------------------------------------------------------------------------ Roz's Profile: http://www.excelforum.com/me...

carriage returns #2
I know that you can press Alt-Enter to manually put a carriage return into a cell, but I'm trying to import data into excel from a webpage that should all be in one cell, with carriage returns for each line (it's an address block). No matter what I do, the data will either show up in separate cells, or as one continuous line without breaks. Does anybody know a way to code an excel carriage return? Hi Ryan, Answer to second part is CHAR(10) when concatenating strings within a formula, or as you already mentioned Alt+Enter. In VBA it is CHR(10). This is a line feed (LF) c...

Sql server #2
I need to buy new version of SQL server beacsue my data over7 gb. If any microsoft partner can sell me sql Please contact me. -- Thank You Harjit SherGill /DBA Altaville Market 324 South Main st po box 370 Altaville CA 95221 Tel : 209-736-1677 vendaliajat@yahoo.com Gill, The current database size limitation are 2GB for MSDE (free version of SQL 2000) and 4GB for SQL Server 2005 Express. If you are already over the 4GB limit, using SQL Server 2000, 2005 or 2008, then there should be no further need to update. But, if you would like to look into the options, please feel free to get in...

drawing objects in a graph
I when I add a straight line (from the drawing tool) to a chart, it only appears when I click off the chart. When I select the chart, then it appears. This is a problem because sometimes I need to select the chart to copy it to a word document. What can I do so that my drawing object appears when I have the chart selected? Thanks. Hi Maybe you should add the line as a 'dummy series'. See the following sites: http://andypope.info/charts/averageline.htm http://www.tushar-mehta.com/excel/charts/straight_lines/index.html http://peltiertech.com/Excel/Charts/DummySeries.html#AddLin...

static variable
I have static class member: class MyClass { public: .... private: static bool initialized; }; but during linking process I got "unresolved external error" for "initialized" var. Why? Also, since my "class" have only static functions, how can I initialize this bool var (outside static functions)? Petar Popara wrote: > I have static class member: > > class MyClass > { > public: > ... > private: > static bool initialized; > }; > > but during linking process I got "unresolved external > error" for "initi...

Moving Data #2
I have a workbook with 9 worksheets in it. The first worksheet is where I need all information that is entered below 0 zero (Column E) to be pulled to the front worksheet. How can I do this? My worksheets are all set up like this.. 1 A B C D 2 Item # Description Qty on hand Qty needed Orde 3 4 Teletype Paper 0 25 -2 4 5 8.5X11 COPY 2 10 - What I need is everything in co...

Timesheet Formula Problem #2
I am trying to set up a timesheet to cover staff working 24 hrs. Day an night hours are paid at a different rate (and staff members all hav different rate of pay). The day hours start at 7.00 and end at 19.00 Night hours are in between. It is the calculation of the hours I a having trouble with. The spreadsheet is laid out as follows: Cell R4 is Start Time S4 is Finish Time T4 is Day Hours U4 is Nigh Hours. I have entered hours for the first two staff in the followin cells: R5 contains 20.00 and S5 contains 9.00 R6 contains 6.00 and S6 contains 18.00. I have tried numerous formula but none of...

Warning message: "Fixed Objects will move" What is its meaning?
I get the warning message Fixed Objects will move in an Office 2000 Excel spreadsheet. This occurs when filtering. To proceed with the filter operation I have to answer OK to the dialog box many many times. I cannot find any references to this warning on the web or in Excel help. Does anyone have an explanation? Specifically - What are these fixed objects? How can I identify them and to where they have been moved? How can I avoid the warning and the need to press <return> 100's of times? Regards -- John The following MSKB article may help: XL: "Cannot Shift Objects Off Shee...

xlstart #2
hi jim, turned out to be so simple a solution :-)... thank you very much. mac -- icestationzbr ----------------------------------------------------------------------- icestationzbra's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=458 View this thread: http://www.excelforum.com/showthread.php?threadid=26637 ...

saving worksheets #2
Hi, I'm trying to save a worksheet in Excel 2000. It's giving me an error message that says the disc is full and document can't be saved. My hard drive is not full and I can save other worksheets but not this one. Anyone have any suggestions? Thanks, Barb It could be a memory problem. I have solved this in the past by increasing my Windows Page File siz via Control Panel -- Brian ----------------------------------------------------------------------- BrianB's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=5 View this thread: http://www.excelfo...