sorting stl list of pointers
how do i sort a std::list? the workaround posted here: http://support.microsoft.com/kb/265109 doesnt seem to work. error: 'greater' has already been instantiated from the primary template ...
how do i sort a std::list? the workaround posted here: http://support.microsoft.com/kb/265109 doesnt seem to work. error: 'greater' has already been instantiated from the primary template ...
I have a USB to parallel port device that i want to interface with through c++ on a modern windows OS (xp and newer). I've done a little research but the information is a bit patchy when it comes to programming to one of these USB to parallel port devices (most of the information is dated and assumes that you have a parallel port built ...
Assume I have a class implementing two or more COM interfaces (exactly as here): class CMyClass : public IInterface1, public IInterface2 { }; QueryInterface() must return the same pointer for each request of the same interface (it needs an explicit upcast for proper pointer adjustment): if( iid == __uuidof( IUnknown ) ) { *ppv ...
Possible Duplicate: Are there gotchas using varargs with reference parameters Hi, I have a problem with varargs. Look at my code(Microsoft Visual Studio 2005 or 2008). #include <stdarg.h> struct Test { int a; }; void T1(int n, ...) { va_list args; va_start(args, n); char* p = va_arg(args, char*); va_end(args); } void T...
I have a MS C++ project (let's call it project A) that I am currently compiling as a static library (.lib). It defines a global variable foo. I have two other projects which compile separately (call them B and C, respectively) and each links the shared static library A in. Both B and C are dll's that end up loaded in the same process. I ...
I have a c++ plus method that generates a value. i am calling this method from a c# application. The C++ method is like this: extern "C" REGISTRATION_API char * generate(char dIn[],char dOut[]) The generate method returns an array of chars (sOut[]=returnvalue; return sOut;) Now I'm calling this method from my c# app: [DllImport("myd...
Is it possible to modify the order of the intellisense options shown when I hit ctrl-space? Specifically, I'd like to order them in scope, so that if I have a variable in my function that matches what I've typed so far then it goes to the top of the list. If there's a member in the class, that's next, etc. I'm just kind of sick of h...
case WM_LBUTTONDOWN: x1=LOWORD(z); y1=HIWORD(z); d=GetDC (w); TextOut(d,x1,y1,"AMITA",6); ReleaseDC (w,&d); break; Error:: error C2664: 'ReleaseDC' : cannot convert parameter 2 from 'struct HDC__ ** ' to 'struct HDC__ * ...
Hi, I'm struggling to convert a C-program linked with ld, of the gnu tool-chain to make it compile as a visual-studio (2005) project. The program puts .data-symbols in different segments and during an initialization phase it copies data between segments. Pointers to the start and end of the segments are defined in the ld linker scri...
I am trying to copy file into the setup target directory. I am using this: TCHAR destPath[ MAX_PATH ] = &L"[TARGETDIR]"; wcscat_s(destPath, L"[email protected]\\Capture.png"); CopyFile(L"C:\\Users\\waldek\\Desktop\\Capture.png", destPath, 0); if I use this: CopyFile(L"C:\\Users\\waldek\\Desktop\\Capture.png", L"C:\\Program Files (...
Hi, I have a Visual C++ Setup which I created using Visual Studio Setup Wizard. I'm trying to give the user option of selecting to install for himself only or everyone. How do I do this?? Even though I can select a radio button saying Install for All Users at install time, it did not work. I need this to work in Windows 7. I have some f...
Hi All, I have an application which runs on windows. I am facing following issues. AV/AS blocks my application after install and when invoked first time. AV/AS blocks does not allow my application to communicate with the server, it blocks my UDP/TCP connection. AV/AS blocks my application access to windows registry operation. AV/AS bl...
Hi, This seems to be a rather stupid question, but I create a pointer to an array of doubles : double* tab = new double[10]; Then I fill the double array, but when I expand the tab pointer in Debug Mode, I only *tab which gives me the value of first element, which is normal. But how do I see the other elements? thanks ...
I'm after a method of converting a single program to run on multiple computers on a network (think "grid computing"). I'm using MSVC 2007 and C++ (non-.NET). The program I've written is ideally suited for parallel programming (its doing analysis of scientific data), so the more computers the better. ...
I get a heap corruption error when deleting a pointer. For this project, the linking parameter for Randomized Base Address is set to Disable Image Randomization. Not sure why that is set that way. Anyway, I only get that error when a specific header file of a library is included. The strange thing is that even with that header file inclu...
Hi, I used a MFC virtual list control to enhance the performance and I handle GetDispInfo(NMHDR* pNMHDR, LRESULT* pResult) to populate the ListCtrl. The relevant code in that method is as follows: if (pItem->mask && LVIF_TEXT) { switch(pItem->iSubItem) { case 0: lstrcpy(pItem->pszText, rLabel.m_strText); ...
I am writing some C code which is expected to compile on multiple compilers (at least on MSVC and GCC). Since I am beginner in C, I have all warnings turned on and warnings are treated as errors (-Werror in GCC & /WX in MSVC) to prevent me from making silly mistakes. When I compiled some code that uses strcpy on MSVC, I get warning lik...
When linking my dll in release build I get - 1>LINK : warning LNK4098: defaultlib 'mfc80d.lib' conflicts with use of other libs; use /NODEFAULTLIB:library 1>LINK : warning LNK4098: defaultlib 'mfcs80d.lib' conflicts with use of other libs; use /NODEFAULTLIB:library 1>LINK : warning LNK4098: defaultlib 'msvcrtd.lib...
Hi..... everybody, Am doing a calculator programme in vc++/MFC dialog application. Thier, i want to change the foreground and background colour of a push button in dialog. I have no idea, how to change. Please suggests me with relevent code or example if any body have idea. basu_sagar ...
I created a web service using VS 2008 C# that uses VC++ dll, In my development enviroment it works, but when I deploy it to the IIS I get this error: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1) [COMExcept...