C4355 / C2668 | I don't get it, simple as that.

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
jsq-1
Posts: 2
Joined: 2005-01-03 20:10

C4355 / C2668 | I don't get it, simple as that.

Post by jsq-1 » 2005-01-03 20:25

Ok, just trying to compile a fresh and untouched DC++ v0.668 Source.

WTL: 7.5.5002.0
STL: 4.6.2 (from dcplusplus.com)

Using Visual C++ .NET 7.1.3088 on a winXP machine, with stlport and the includes from wtl included in that order. I've also added natupnp.h / natupnp.idl to the includes.

And yes this is probably a problem which has been discussed a million times before, so instead of bitching I hope someone will just paste a link to somewhere this has been resolved, because I couldn't find it.

Thanks, love your work.

Code: Select all

c:\DCPlusPlus\client\NmdcHub.cpp(37): warning C4355: 'this' : used in base member initializer list
c:\DCPlusPlus\windows\WinUtil.cpp(209): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=false
        ]
c:\DCPlusPlus\windows\WinUtil.cpp(213): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=false
        ]
c:\DCPlusPlus\windows\WinUtil.cpp(215): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=false
        ]
c:\DCPlusPlus\windows\WinUtil.cpp(235): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=false
        ]
c:\DCPlusPlus\windows\WinUtil.cpp(250): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=false
        ]
c:\DCPlusPlus\windows\WinUtil.cpp(259): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=false
        ]
c:\DCPlusPlus\windows\WinUtil.cpp(263): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=false
        ]
c:\DCPlusPlus\windows\TransferView.cpp(69): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]
c:\DCPlusPlus\windows\SearchFrm.cpp(867): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]
c:\DCPlusPlus\windows\SearchFrm.cpp(873): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]
c:\DCPlusPlus\windows\SearchFrm.cpp(891): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]
c:\DCPlusPlus\windows\SearchFrm.cpp(906): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]
c:\DCPlusPlus\windows\HubFrame.cpp(637): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]
c:\DCPlusPlus\windows\DirectoryListingFrm.cpp(499): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]
c:\DCPlusPlus\windows\DirectoryListingFrm.cpp(535): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]
c:\DCPlusPlus\windows\DirectoryListingFrm.cpp(541): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]
c:\DCPlusPlus\windows\DirectoryListingFrm.cpp(580): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]
c:\DCPlusPlus\windows\DirectoryListingFrm.cpp(587): error C2668: 'WTL::CMenuT<t_bManaged>::AppendMenuW' : ambiguous call to overloaded function
        with
        [
            t_bManaged=true
        ]

ullner
Forum Moderator
Posts: 333
Joined: 2004-09-10 11:00
Contact:

Post by ullner » 2005-01-04 10:24

I'm using WTL 7.5.4.2.9.1 and I can compile with no trouble(haven't been any changes to the changelog or compile.txt so I haven't upgraded more). Try and find that release. If you can't, PM me your e-mail and I'll send the .zip-file to you.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2005-01-04 12:10

When I compile with 7.5.5002, I also get those errors. The previous release for WTL is here: http://prdownloads.sourceforge.net/wtl/wtl75_4291.zip

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2005-01-04 13:44

Or this patch...

Code: Select all

diff -urd DCPlusPlus-cvs-src.orig/windows/DirectoryListingFrm.cpp DCPlusPlus-cvs-src.patch/windows/DirectoryListingFrm.cpp
--- DCPlusPlus-cvs-src.orig/windows/DirectoryListingFrm.cpp	Tue Jan  4 12:40:32 2005
+++ DCPlusPlus-cvs-src.patch/windows/DirectoryListingFrm.cpp	Tue Jan  4 13:28:54 2005
@@ -498,7 +498,7 @@
 					targetMenu.AppendMenu(MF_STRING, IDC_DOWNLOAD_FAVORITE_DIRS + n, Text::toT(i->second).c_str());
 					n++;
 				}
-				targetMenu.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+				targetMenu.AppendMenu(MF_SEPARATOR);
 			}
 
 			n = 0;
@@ -536,13 +536,13 @@
 					targetMenu.AppendMenu(MF_STRING, IDC_DOWNLOAD_FAVORITE_DIRS + n, Text::toT(i->second).c_str());
 					n++;
 				}
-				targetMenu.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+				targetMenu.AppendMenu(MF_SEPARATOR);
 			}
 
 			n = 0;
 			targetMenu.AppendMenu(MF_STRING, IDC_DOWNLOADTO, CTSTRING(BROWSE));
 			if(WinUtil::lastDirs.size() > 0) {
-				targetMenu.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+				targetMenu.AppendMenu(MF_SEPARATOR);
 				for(TStringIter i = WinUtil::lastDirs.begin(); i != WinUtil::lastDirs.end(); ++i) {
 					targetMenu.AppendMenu(MF_STRING, IDC_DOWNLOAD_TARGET + (++n), i->c_str());
 				}
@@ -583,14 +583,14 @@
 					targetDirMenu.AppendMenu(MF_STRING, IDC_DOWNLOAD_WHOLE_FAVORITE_DIRS + n, Text::toT(i->second).c_str());
 					n++;
 				}
-				targetDirMenu.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+				targetDirMenu.AppendMenu(MF_SEPARATOR);
 			}
 
 			n = 0;
 			targetDirMenu.AppendMenu(MF_STRING, IDC_DOWNLOADDIRTO, CTSTRING(BROWSE));
 
 			if(WinUtil::lastDirs.size() > 0) {
-				targetDirMenu.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+				targetDirMenu.AppendMenu(MF_SEPARATOR);
 				for(TStringIter i = WinUtil::lastDirs.begin(); i != WinUtil::lastDirs.end(); ++i) {
 					targetDirMenu.AppendMenu(MF_STRING, IDC_DOWNLOAD_TARGET_DIR + (++n), i->c_str());
 				}
diff -urd DCPlusPlus-cvs-src.orig/windows/HubFrame.cpp DCPlusPlus-cvs-src.patch/windows/HubFrame.cpp
--- DCPlusPlus-cvs-src.orig/windows/HubFrame.cpp	Mon Jan  3 15:27:17 2005
+++ DCPlusPlus-cvs-src.patch/windows/HubFrame.cpp	Tue Jan  4 13:31:04 2005
@@ -641,7 +641,7 @@
 	POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };        // location of mouse click 
 	tabMenuShown = true;
 	prepareMenu(tabMenu, ::UserCommand::CONTEXT_HUB, Text::toT(client->getAddressPort()), client->getOp());
-	tabMenu.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+	tabMenu.AppendMenu(MF_SEPARATOR);
 	tabMenu.AppendMenu(MF_STRING, IDC_CLOSE_WINDOW, CTSTRING(CLOSE));
 	tabMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_BOTTOMALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, m_hWnd);
 	tabMenu.DeleteMenu(tabMenu.GetMenuItemCount()-1, MF_BYPOSITION);
diff -urd DCPlusPlus-cvs-src.orig/windows/SearchFrm.cpp DCPlusPlus-cvs-src.patch/windows/SearchFrm.cpp
--- DCPlusPlus-cvs-src.orig/windows/SearchFrm.cpp	Mon Jan  3 15:27:20 2005
+++ DCPlusPlus-cvs-src.patch/windows/SearchFrm.cpp	Tue Jan  4 13:31:04 2005
@@ -920,13 +920,13 @@
 				targetMenu.AppendMenu(MF_STRING, IDC_DOWNLOAD_FAVORITE_DIRS + n, Text::toT(i->second).c_str());
 				n++;
 			}
-			targetMenu.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+			targetMenu.AppendMenu(MF_SEPARATOR);
 		}
 
 		n = 0;
 		targetMenu.AppendMenu(MF_STRING, IDC_DOWNLOADTO, CTSTRING(BROWSE));
 		if(WinUtil::lastDirs.size() > 0) {
-			targetMenu.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+			targetMenu.AppendMenu(MF_SEPARATOR);
 			for(TStringIter i = WinUtil::lastDirs.begin(); i != WinUtil::lastDirs.end(); ++i) {
 				targetMenu.AppendMenu(MF_STRING, IDC_DOWNLOAD_TARGET + n, i->c_str());
 				n++;
@@ -944,7 +944,7 @@
 			}
 
 			if(targets.size() > 0) {
-				targetMenu.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+				targetMenu.AppendMenu(MF_SEPARATOR);
 				for(StringIter i = targets.begin(); i != targets.end(); ++i) {
 					targetMenu.AppendMenu(MF_STRING, IDC_DOWNLOAD_TARGET + n, Text::toT(*i).c_str());
 					n++;
@@ -959,7 +959,7 @@
 				targetDirMenu.AppendMenu(MF_STRING, IDC_DOWNLOAD_WHOLE_FAVORITE_DIRS + n, Text::toT(i->second).c_str());
 				n++;
 			}
-			targetDirMenu.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+			targetDirMenu.AppendMenu(MF_SEPARATOR);
 		}
 
 		n = 0;
diff -urd DCPlusPlus-cvs-src.orig/windows/TransferView.cpp DCPlusPlus-cvs-src.patch/windows/TransferView.cpp
--- DCPlusPlus-cvs-src.orig/windows/TransferView.cpp	Mon Jan  3 15:27:20 2005
+++ DCPlusPlus-cvs-src.patch/windows/TransferView.cpp	Tue Jan  4 13:31:04 2005
@@ -66,7 +66,7 @@
 	appendUserItems(transferMenu);
 	transferMenu.AppendMenu(MF_STRING, IDC_FORCE, CTSTRING(FORCE_ATTEMPT));
 	transferMenu.AppendMenu(MF_STRING, IDC_COPY_NICK, CTSTRING(COPY_NICK));
-	transferMenu.AppendMenu(MF_SEPARATOR, 0, (LPTSTR)NULL);
+	transferMenu.AppendMenu(MF_SEPARATOR);
 	transferMenu.AppendMenu(MF_STRING, IDC_REMOVE, CTSTRING(CLOSE_CONNECTION));
 	transferMenu.SetMenuDefaultItem(IDC_PRIVATEMESSAGE);
 
diff -urd DCPlusPlus-cvs-src.orig/windows/WinUtil.cpp DCPlusPlus-cvs-src.patch/windows/WinUtil.cpp
--- DCPlusPlus-cvs-src.orig/windows/WinUtil.cpp	Mon Jan  3 15:27:22 2005
+++ DCPlusPlus-cvs-src.patch/windows/WinUtil.cpp	Tue Jan  4 13:31:04 2005
@@ -206,13 +206,13 @@
 	file.AppendMenu(MF_STRING, IDC_OPEN_OWN_LIST, CTSTRING(MENU_OPEN_OWN_LIST));
 	file.AppendMenu(MF_STRING, IDC_REFRESH_FILE_LIST, CTSTRING(MENU_REFRESH_FILE_LIST));
 	file.AppendMenu(MF_STRING, IDC_OPEN_DOWNLOADS, CTSTRING(MENU_OPEN_DOWNLOADS_DIR));
-	file.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+	file.AppendMenu(MF_SEPARATOR);
 	file.AppendMenu(MF_STRING, ID_FILE_QUICK_CONNECT, CTSTRING(MENU_QUICK_CONNECT));
 	file.AppendMenu(MF_STRING, IDC_FOLLOW, CTSTRING(MENU_FOLLOW_REDIRECT));
 	file.AppendMenu(MF_STRING, ID_FILE_RECONNECT, CTSTRING(MENU_RECONNECT));
-	file.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+	file.AppendMenu(MF_SEPARATOR);
 	file.AppendMenu(MF_STRING, ID_FILE_SETTINGS, CTSTRING(MENU_SETTINGS));
-	file.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+	file.AppendMenu(MF_SEPARATOR);
 	file.AppendMenu(MF_STRING, ID_APP_EXIT, CTSTRING(MENU_EXIT));
 
 	mainMenu.AppendMenu(MF_POPUP, (UINT_PTR)(HMENU)file, CTSTRING(MENU_FILE));
@@ -232,7 +232,7 @@
 	view.AppendMenu(MF_STRING, IDC_NET_STATS, CTSTRING(MENU_NETWORK_STATISTICS));
 	view.AppendMenu(MF_STRING, IDC_NOTEPAD, CTSTRING(MENU_NOTEPAD));
 	view.AppendMenu(MF_STRING, IDC_HASH_PROGRESS, CTSTRING(MENU_HASH_PROGRESS));
-	view.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+	view.AppendMenu(MF_SEPARATOR);
 	view.AppendMenu(MF_STRING, ID_VIEW_TOOLBAR, CTSTRING(MENU_TOOLBAR));
 	view.AppendMenu(MF_STRING, ID_VIEW_STATUS_BAR, CTSTRING(MENU_STATUS_BAR));
 	view.AppendMenu(MF_STRING, ID_VIEW_TRANSFER_VIEW, CTSTRING(MENU_TRANSFER_VIEW));
@@ -248,7 +248,7 @@
 	window.AppendMenu(MF_STRING, ID_WINDOW_ARRANGE, CTSTRING(MENU_ARRANGE));
 	window.AppendMenu(MF_STRING, ID_WINDOW_MINIMIZE_ALL, CTSTRING(MENU_MINIMIZE_ALL));
 	window.AppendMenu(MF_STRING, ID_WINDOW_RESTORE_ALL, CTSTRING(MENU_RESTORE_ALL));
-	window.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+	window.AppendMenu(MF_SEPARATOR);
 	window.AppendMenu(MF_STRING, IDC_CLOSE_DISCONNECTED, CTSTRING(MENU_CLOSE_DISCONNECTED));
 
 	mainMenu.AppendMenu(MF_POPUP, (UINT_PTR)(HMENU)window, CTSTRING(MENU_WINDOW));
@@ -257,11 +257,11 @@
 	help.CreatePopupMenu();
 
 	help.AppendMenu(MF_STRING, IDC_HELP_CONTENTS, CTSTRING(MENU_CONTENTS));
-	help.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+	help.AppendMenu(MF_SEPARATOR);
 	help.AppendMenu(MF_STRING, IDC_HELP_README, CTSTRING(MENU_README));
 	help.AppendMenu(MF_STRING, IDC_HELP_CHANGELOG, CTSTRING(MENU_CHANGELOG));
 	help.AppendMenu(MF_STRING, ID_APP_ABOUT, CTSTRING(MENU_ABOUT));
-	help.AppendMenu(MF_SEPARATOR, 0, (LPCTSTR)NULL);
+	help.AppendMenu(MF_SEPARATOR);
 	help.AppendMenu(MF_STRING, IDC_HELP_HOMEPAGE, CTSTRING(MENU_HOMEPAGE));
 	help.AppendMenu(MF_STRING, IDC_HELP_DOWNLOADS, CTSTRING(MENU_HELP_DOWNLOADS));
 	help.AppendMenu(MF_STRING, IDC_HELP_TRANSLATIONS, CTSTRING(MENU_HELP_TRANSLATIONS));
It'll probably be in CVS soon, so if you're intrepid...

Guitarm
Forum Moderator
Posts: 385
Joined: 2004-01-18 15:38

Post by Guitarm » 2005-01-04 13:52

Aha, well, to see the actual diff is nice anyway

Thanks!
"Nothing really happens fast. Everything happens at such a rate that by the time it happens, it all seems normal."

jsq-1
Posts: 2
Joined: 2005-01-03 20:10

Post by jsq-1 » 2005-01-04 17:56

Thanks :)

Locked