Search Results

Search found 207 results on 9 pages for 'msvc'.

Page 7/9 | < Previous Page | 3 4 5 6 7 8 9  | Next Page >

  • Considering modified files for rebuild

    - by harik
    I have a C++ project, I am using Bakefile for build process, Makefiles are generated for msvc, mingw, gnu etc for cross-platform support. Now the problem is that if I change any .h files (which are included in other .cpp files) and performing a rebuild does not recompile modified files. But changing any .cpp file gets recompiled. Based on modified time-stamp of any file which is included in the project I expect to consider that file for rebuild. Am I missing something which required to be added as a tag in .bkl files? Please help.

    Read the article

  • How to make an ambiguous call distinct in C++?

    - by jcyang
    void outputString(const string &ss) { cout << "outputString(const string& ) " + ss << endl; } void outputString(const string ss) { cout << "outputString(const string ) " + ss << endl; } int main(void) { //! outputString("ambigiousmethod"); const string constStr = "ambigiousmethod2"; //! outputString(constStr); } ///:~ How to make distinct call? EDIT: This piece of code could be compiled with g++ and msvc. thanks.

    Read the article

  • How do I compile for windows XP under windows 7 / visual studio 2008

    - by Jon Cage
    I'm running Windows 7 and Visual Studio 2008 Pro and trying to get my application to work on Windows XP SP3. It's a really minimal command line program so should have any ridiculous dependencies: // XPBuild.cpp : Defines the entry point for the console application. // #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { printf("Hello world"); getchar(); return 0; } I read somewhere that defining several constants such as WINVER should allow me to compile for other platforms. I've tried the added the following to my /D compiler options: ;WINVER=0x0501;_WIN32_WINNT 0x0501;NTDDI_VERSION=NTDDI_WINXP But that made no difference. When I run it on my Windows XP machine (actually running in a virtualbox) I get the following error: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. So what have I missed? Is there something else required to run MSVC compiled programs or a different compiler option or something else?

    Read the article

  • Is is possible to make a shaped, alpha-blended dialog?

    - by jgaa
    I'm making a non-rectangular dialog, modelled over an image from Photoshop (the image is the background of the dialog, and the user will see trough the transparent part of the image). I'ts like a dashboard-style window for a media-app with a few custom-drawn controls. Most of the background-image is either opaque or 100% transparent - but in between there is a thin area of partially transparent pixels, ment to blend the image smootly into the background. This works great for web-graphics, but I have not found a way to make this work for Windows windows. I'm using the Windows Template Library (WTL), msvc 2008 - and the app must run on Windows XP as well as Vista and Windows 7. Currently, I'm simply using the opaque part of the background-image to create a GDI clipping-region, but this gives pretty rough edges. Does anyone know about any API functions to accomplish this (part of WTL, or reachable from WTL)?

    Read the article

  • Different return value of an overridden class

    - by Samer Afach
    I have a simple but confusing question here. Is it legal to have a different return value type for overridden methods than the abstact ones defined in the base class?? I did that and the compiler didn't complain... could someone please explain? class MyBaseClass { int value; public: virtual int getValue() = 0; }; class MyClass : public MyBaseClass { double value; public: virtual double getValue(); // here!!! return is double, not int }; double MyClass::getValue() { return this->value; } The compiler totally accepted something similar (MSVC und MinGW)... could anyone please exaplain to what extent this is legal?

    Read the article

  • Lifetime of implicitly casted temporaries

    - by Answeror
    I have seen this question. It seems that regardless of the cast, the temporary object(s) will "survive" until the fullexpression evaluated. But in the following scenario: void foo(boost::tuple<const double&> n) { printf("%lf\n", n.get<0>()); } int main() { foo(boost::tuple<const double&>(2));//#1 foo(boost::make_tuple(2));//#2 return 0; } 1 run well, but 2 do not. And MSVC gave me a warning about 2: "reference member is initialized to a temporary that doesn't persist after the constructor exits" Now I am wondering why they both make a temporary "double" object and pass it to boost::tuple<const double&> and only 2 failed.

    Read the article

  • CRT not initialized

    - by jfhs
    I'm trying to compile one project with MSVC 2010, compilation is ok, but when I try to run the app, it gives me CRT not initialized error. It is a console application, so I tried to specify mainCRTStartup as Entry Point, but it didn't help. In the same solution there are other projects, and they don't have such a problem. The difference which I see between them is that one which is not working, uses boost. Boost v1.38.0 if this is important. Runtime Library is Multi-threaded DLL. Linker command line is: /OUT:"D:\temp\ghost\Release\ghost.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"..\zlib\lib" /LIBPATH:"..\mysql\lib\opt" /LIBPATH:"..\boost\lib" "ws2_32.lib" "winmm.lib" "zdll.lib" "StormLibRAS.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "D:\temp\ghost\bncsutil\vc8_build\Release\BNCSutil.lib" /MANIFEST /ManifestFile:"Release\ghost.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\temp\ghost\Release\ghost.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /PGD:"D:\temp\ghost\Release\ghost.pgd" /LTCG /TLBID:1 /ENTRY:"mainCRTStartup" /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE

    Read the article

  • On Memory Allocation and C++

    - by Arpan
    And I quote from MSDN http://msdn.microsoft.com/en-us/library/aa366533(VS.85).aspx: The malloc function has the disadvantage of being run-time dependent. The new operator has the disadvantage of being compiler dependent and language dependent. Now the questions folks: a) What do we mean that malloc is run-time dependent? What kind of dynamic memory allocation functions can be independent of run-time? This statement sounds real strange. b) new is language dependent? Of course it should be right? Are HeapAlloc, LocalAlloc etc language independent? c) From a pure performance perspective are the MSVC provided routines preferable? Arpan

    Read the article

  • C++ MFC add combo box string item from a widget ID

    - by OzBarry
    I've added a combo box in the gui editor in MSVC 2010 pro in my MFC project. I have a list of strings I am grabbing from an external source and want to add them to my combo box. I've searched for a while, and every post seems to suggest I need to use the CComboBox class, however, I have no idea how to get the class variable from the resource ID of the combobox element in the gui editor. In summary, how do I add a string to my combo box, either using a macro (like CB_ADDSTRING(RESOURCE_ID, "my string");) or using CComboBOx (something like CComboBox::GetObject(RESOURCE_ID)->AddString("blah");). I do not do much win32 api/mfc programming, and just started fiddling around with it.

    Read the article

  • Version resource in DLL not visible with right-click

    - by abunetta
    I'm trying to do something which is very easy to do in the regular MSVC, but not supported easily in VC++ Express. There is no resource editor in VC++ Express. So I added a file named version.rc into my DLL project. The file has the below content, which is compiled by the resource compiler and added to the final DLL. This resource is viewable in the DLL using reshacker, though not when right-clicking the DLL in Windows Explorer. What is missing from my RC file to make it appear when right-clicking? VS_VERSION_INFO VERSIONINFO FILEVERSION 1,0,0,1 PRODUCTVERSION 1,0,0,1 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x4L FILETYPE 0x1L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "something Application" VALUE "FileVersion", "1, 0, 0, 1" VALUE "InternalName", "something" VALUE "LegalCopyright", "Copyright (C) 2008 Somebody" VALUE "OriginalFilename", "something.exe" VALUE "ProductName", "something Application" VALUE "ProductVersion", "1, 0, 0, 1" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END

    Read the article

  • C++ WIN32: Short multitasking example

    - by Con Current
    I searched for examples on how to create a simple multithreaded app that does something similar to this: #include <iostream> using namespace std; int myConcurrentFunction( ) { while( 1 ) { cout << "b" << endl; } } int main( ) { // Start a new thread for myConcurrentFunction while( 1 ) { cout << "a" << endl; } } How can I get the above to output a and b "randomly" by starting a new thread instead of just calling myConcurrentFunction normally? I mean: What is the minimal code for it? Is it really only one function I have to call? What files do I need to include? I use MSVC 2010, Win32

    Read the article

  • bitfield mask calculation macro

    - by Aidan Cully
    We have a set of C macros, here, for using the preprocessor to do bitfield operations, and we run into warnings when attempting to use these macros in visual studio. The problem can be demonstrated very easily: #define BITFIELD_WIDTHMASK(Width) \ ((Width) >= 32 ? ~0x0ul : (1ul << (Width)) - 1) unsigned long foo(void) { return BITFIELD_WIDTHMASK(32); } Compiling this with MSVC yields the warning: test.c(12) : warning C4293: '<<' : shift count negative or too big, undefined behavior This isn't a behavior problem - the << operator won't be used in this case, and that should be detected at compile time. But does anyone have any suggestions about how to rewrite the macro to avoid the warning? Or, failing that, how to redesign the macro interface for this? Thanks in advance

    Read the article

  • wxWidgets - Add items to sizer via DLL

    - by intl
    I have a GUI set up with wxWidgets (C++, MSVC) and part of the functionality is to add elements to the GUI via DLL's. Essentially, I would be passing in a sizer to the DLL which will in turn add the elements based on what is in the DLL. Could someone just point me in the right direction on how to get the DLL set up? I have looked, but don't see anything that's similar to what I'm looking for. The programming of the elements is fine with me, I just need to understand how to structure the DLL programming. Help appreciated.

    Read the article

  • Constant template parameter class manages to link externally

    - by the_drow
    I have a class foo with an enum template parameter and for some reason it links to two versions of the ctor in the cpp file. enum Enum { bar, baz }; template <Enum version = bar> class foo { public: foo(); }; // CPP File #include "foo.hpp" foo<bar>::foo() { cout << "bar"; } foo<baz>::foo() { cout << "baz"; } I'm using msvc 2008, is this the standard behavior? Are only type template parameters cannot be linked to cpp files?

    Read the article

  • Managing memory of polymorphic timed events with DLL

    - by Milo
    Here is my issue. My Gui library that I made supports timed events. Basically, I have a class called TimedEvent which users inherit from. They then do: addTimedEvent(new DerivedTimedEvent(...)); However given the nature of timed events, I manage the memory afterwards. So when the timed event has done its thing, my library calls delete on it. Although it runs fine, that is because the exe and the library were both built with msvc 2008. I think I might have trouble if I have 2 versions of the runtime, one for the lib, and one for the exe. What can I do to fix this? I can't create a factory because the derived type is on the exe side of things. I also cannot ask the user to call delete since they might not have a way to keep track of time, or know if the event was delayed for whatever reason. Thanks

    Read the article

  • C++ DLL which can inform a calling program about its progress

    - by Felix Dombek
    My boss wants me to write a DLL in C++ (MSVC++2010) which can perform a Volume Shadow Copy which he can call from VB6 (or at a later point other languages) and which can give status updates back while it is not finished. He calls it "events". I have the feeling that I finally need to learn COM (I'd rather not ...) ... also, a callback function comes to my mind, but it's surely impossible to hand over function pointers from VB6 to C++? Can someone outline what I have to learn and how this can be accomplished, with or without COM?

    Read the article

  • MS VC++ 6 class wizard

    - by Shane MacLaughlin
    Ok, I'm developing an application that has been in pretty much continous development over the last 16 years, from C in DOS, through various flavours of C++ and now is largely based around C++ with MFC and StingRay GUIs and various other SDKs. While I use VS 2005 for the release builds, I still use MSVC 6 for much of the GUI building, simply because ClassWizard is so much quicker in this environment than the weak equivalent tools that followed. Note that I am using ClassWizard to automatically generate code for my own user defined types (see Custom DDXs) and I like to add a lot of member variables and methods in one go. Creating them one at a time as per later versions of Visual Studio for me is a big backward step. At the same time, working with multiple IDEs is also a pain. My question is in two parts; Is there any way of getting ClassWizard to work is VS 2005 or VS 2008? Is there any drop in replacement, or alternative IDE, that provides similar levels of productivty for old C++ hacks such as myself?

    Read the article

  • How to call C++ function from C?

    - by claws
    I know this. Calling C function from C++: If my application was in C++ and I had to call functions from a library written in C. Then I would have used //main.cpp extern "C" void C_library_function(int x, int y);//prototype C_library_function(2,4);// directly using it. This wouldn't mangle the name C_library_function and linker would find the same name in its input *.lib files and problem is solved. Calling C++ function from C??? But here I'm extending a large application which is written in C and I need to use a library which is written in C++. Name mangling of C++ is causing trouble here. Linker is complaining about the unresolved symbols. Well I cannot use C++ compiler over my C project because thats breaking lot of other stuff. What is the way out? By the way I'm using MSVC

    Read the article

  • why is this legal, c++ typedef func

    - by acidzombie24
    i did this in msvc 2005. typedef void (*cleanup_t)(); void func(cleanup_t clean) { cleanup_t(); } Why does this compile? and not give me a warning? ok, it gave me a unreferenced formal parameter warning but originally i did this when clean was in a class no there was no unreferenced formal parameter when this code gave me problems. What is cleanup_t(); really doing and what is the point? now for laughs i tried int() and that worked also.

    Read the article

  • Calling C++ function from C.

    - by claws
    I know this. Calling C function from C++: If my application was in C++ and I had to call functions from a library written in C. Then I would have used //main.cpp extern "C" void C_library_function(int x, int y);//prototype C_library_function(2,4);// directly using it. This wouldn't mangle the name C_library_function and linker would find the same name in its input *.lib files and problem is solved. Calling C++ function from C??? But here I'm extending a large application which is written in C and I need to use a library which is written in C++. Name mangling of C++ is causing trouble here. Well I cannot use C++ compiler over my C project because thats breaking lot of other stuff. What is the way out? By the way I'm using MSVC

    Read the article

  • C++ circular dependency - namespace vs struct

    - by Dead or Alive
    Please educate me. Why does this compile: struct compiles { struct A; struct B { B(const A &a) : member(a.member) { } int member; }; struct A { A(const B &b) : member(b.member) { } int member; }; }; while this does not: namespace doesnt { struct A; struct B { B(const A &a) : member(a.member) { } int member; }; struct A { A(const B &b) : member(b.member) { } int member; }; } (in MSVC 9.0)

    Read the article

  • using wget against protected site with NTLM

    - by Joey V.
    Trying to mirror a local intranet site and have found previous questions using 'wget'. It works great with sites that are anonymous, but I have not been able to use it against a site that is expecting username\password (IIS with Integrated Windows Authentication). Here is what I pass in: wget -c --http-user='domain\user' --http-password=pwd http://local/site -dv Here is the debug output (note I replaced some with dummy values obviously): Setting --verbose (verbose) to 1 DEBUG output created by Wget 1.11.4 on Windows-MSVC. --2009-07-14 09:39:04-- http://local/site Host `local' has not issued a general basic challenge. Resolving local... seconds 0.00, x.x.x.x Caching local = x.x.x.x Connecting to local|x.x.x.x|:80... seconds 0.00, connected. Created socket 1896. Releasing 0x003e32b0 (new refcount 1). ---request begin--- GET /site/ HTTP/1.0 User-Agent: Wget/1.11.4 Accept: */* Host: local Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 401 Access Denied Server: Microsoft-IIS/5.1 Date: Tue, 14 Jul 2009 13:39:04 GMT WWW-Authenticate: Negotiate WWW-Authenticate: NTLM Content-Length: 4431 Content-Type: text/html ---response end--- 401 Access Denied Closed fd 1896 Unknown authentication scheme. Authorization failed.

    Read the article

  • Is there more to HTML forms than http://www.w3schools.com/html/html_forms.asp ?

    - by mawg
    I am creating a form designer. It will generate PHP code which will produce an HTML form. Users will fill in fields and the PHP will store user input in a MySql database (and, of course, they can use the designer to generate forms which query the database). I am using Borland C++ Builder (very similar to Delphi & and you can get the same idea from VB, MSVC, Qt ... any IDE with a RAD GUI designer). Looking at the W3C page http://www.w3schools.com/html/html_forms.asp it seems that the components I can use for my form and retrieve data from are - edit box / TEdit / <input type="text" - memo / TMemo / <input type="textarea" - check box / TCheckBox / <input type="CheckBox" - Combo box / TComboBox / <select ... <option... - Radio group / TRadioGroup / <input type="radio" - Group box / TGroupBox / <fieldset ... <legend ... - Panel / TPanel / <fieldset ... I am unsure whether to allow button / TButton/ input type="button" - other than a single submit button which my form designer program automatically adds to the end of the generated form. But my real question is - did I miss any? It might be nice to have masked edit which only accepts numbers, or maybe some form of "spin control" (TUpDown, or slider + linked read only TEdit), so that the user can click & hold to increment/decrement an integer value. And a calendar component would be nice. Very important: I want to implement it all server-side in PHP, so no client-side JS or Ajax or the likes. If there anything else that I can add to make my generated forms look more impressive in the browser?

    Read the article

  • What is the best way to send structs containing enum values via sockets in C.

    - by Axel
    I've lots of different structs containing enum members that I have to transmit via TCP/IP. While the communication endpoints are on different operating systems (Windows XP and Linux) meaning different compilers (gcc 4.x.x and MSVC 2008) both program parts share the same header files with type declarations. For performance reasons, the structures should be transmitted directly (see code sample below) without expensively serializing or streaming the members inside. So the question is how to ensure that both compilers use the same internal memory representation for the enumeration members (i.e. both use 32-bit unsigned integers). Or if there is a better way to solve this problem... //type and enum declaration typedef enum { A = 1, B = 2, C = 3 } eParameter; typedef enum { READY = 400, RUNNING = 401, BLOCKED = 402 FINISHED = 403 } eState; #pragma pack(push,1) typedef struct { eParameter mParameter; eState mState; int32_t miSomeValue; uint8_t miAnotherValue; ... } tStateMessage; #pragma pack(pop) //... send via socket tStateMessage msg; send(iSocketFD,(void*)(&msg),sizeof(tStateMessage)); //... receive message on the other side tStateMessage msg_received; recv(iSocketFD,(void*)(&msg_received),sizeof(tStateMessage)); Additionally... Since both endpoints are little endian maschines, endianess is not a problem here. And the pack #pragma solves alignment issues satisfactorily. Thx for your answers, Axel

    Read the article

  • Why `A & a = a` is valid?

    - by psaghelyi
    #include <iostream> #include <assert.h> using namespace std; struct Base { Base() : m_member1(1) {} Base(const Base & other) { assert(this != &other); // this should trigger m_member1 = other.m_member1; } int m_member1; }; struct Derived { Derived(Base & base) : m_base(m_base) {} // m_base(base) Base & m_base; }; void main() { Base base; Derived derived(base); cout << derived.m_base.m_member1 << endl; // crashes here } The above example is a synthesized version of a mistyped constructor. I used reference at the class member Derived::m_base because I wanted to make sure that the member will be initialized as the constructor had called. One problem is that nor GCC nor MSVC gives me a warning at m_base(m_base). But the more serious for me is that the assert finds everything fine and the application crashes later (sometimes far away from the mistake). Question: Is there any way to indicate such mistakes?

    Read the article

< Previous Page | 3 4 5 6 7 8 9  | Next Page >