visual-c++

Static Runtime Library Linking for Visual C++ Express 2008

How do you tell Visual C++ Express 2008 to statically link runtime libraries instead of dynamically? My exes do not currently run on computers w/o some sort of VS installed and I would love to change that. :) ...

C++ Standard: Unexpected const_iterator in multiset

I recently ran into an odd issue where I'd get a const_iterator instead of the expected iterator when iterating through a multiset. It turned out to be a non-issue for MSVC but g++ gave me an error: error: invalid initialization of reference of type 'myPtr&' from expression of type 'const boost::shared_ptr' Relevant code: ty...

DoModal() asserts at very first line

I have an MFC dialog based application created inside Visual Studio 2008. CCalendarWindowDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); When I run the application, DoModal() asserts at very first line INT_PTR CDialog::DoModal() { // can be constructed with a resource template or InitModalIndirect ASSERT(m_lpsz...

Convert CString to std::wstring

Can any one tell me how to convert CString to std::wstring ...

const <type>& foo() versus <type> foo()

In a non-template class, is there any reason to prefer function return signatures in the form const <type>& foo(); versus <type> foo();? Where <type> is an intrinsic type. What about if <type> is a class/struct object? Also interested in whether or not the function being const makes a difference: const <type>& foo() const; to <type> fo...

html DOM generation and html regeneration out of DOM

Hi I want to get the html content of an html file and modify some areas (actually I want to translate the text in the html page )and then REBUILD the new html file out of my modified DOM tree.Can anybody please show me the way how I can do that ?I have found html DOM parsers,but they dont regenerate the modified html file for me .they ...

Visual Studio 2005 link error

I am getting an linking error in Visual Studio 2005: mfcs80.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj) What could be the reason for this error? " /INCREMENTAL:NO /NOLOGO /LIBPATH:"..\RtpDll\libs\Release" /LIBPATH:" packet.lib winmm.lib ws2_32.lib and other some project-dependent libra...

Create dependency in DLL to other module with a non-".DLL" extension

A bit of an odd question here, but AutoCAD uses extension DLL's with the .ARX extension, which are really exactly like regular DLL's, besides their extension. Now we have built three .ARX files, where the two latter ones have dependencies to the first. Upon loading these two, AutoCAD complains that it can't find a required file, and whe...

Loading an exe from an exe

I am exporting a function [using _declspec(dllexport)] from a C++ exe. The function works fine when invoked by the exe itself. I am loading this exe (lets call this exe1) from another exe [the test project's exe - I'll call this exe2] using static linking i.e I use exe1's .lib file while compiling exe2 and exe2 loads it into memory on st...

Suggestion for Grid for MFC SDI application

Currently we are using Xtreme Toolkit Pro Grid control with virtualization support for our application to show the contents in Grid. Is there any other better software which can be easily used as Grid without much changes in the application. Also can I able to achieve the full use of Grid in CMFCPropertyGridCtrl which is present in MFC...

compilation error in vc++ vs2005

I am getting an error while compiling in vc++ vs2005. error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl MsgBox(char const *,char const *,...)" (?MsgBox@@YAXPBD0ZZ) ...

VC++ 6.0: Why is CASyncSocket::GetLastError() causing an access violation?

I'm using Visual C++ 6.0. I'm not sure of the service pack level of the visual studio installation, but the OS is Win 2K SP4. The failing code is part of a DLL. Here's the code: EIO::OpenConnection() { m_Client = new CSocket(); if(m_Client->Create() == 0) { delete m_Client; m_Client = NULL; return CAs...

MFC: Render string in multiple formats

Using a CDC & CDC::DrawText(Ex), I want to render a string with a sub-string in bold e.g: void renderText(CDC *pDC,CString &str,int boldStart,int boldEnd) { ... } example: renderText(pDC,"Test String",0,3) -> Test String example: renderText(pDC,"Test String",5,-1) -> Test String I assume I'll make 3 CDC::DrawText calls, but how do...

Is it possible to have a custom step run per-solution, not per-project?

I have a Visual C++ solution with several projects. I'd quite like to be able to add a step that is executed after I build the entire solution... e.g "copy *.lib ......\libs. Is this even supported? VS is mainly based around individual projects, but obviously does support solution builds. ...

Release LIB is huge compared to debug

I have a static library project with standard debug/release build options. I was intrigued to spot that while the debug .lib is a fairly large 22Mb, the release one is a whopping 100Mb. And this is not a massive code-base either, about 75 classes and none of them very giant. My questions are whether this is normal, and whether I should ...

error while porting from vc6 to vs2005

hi i am getting the link error, as it worked fine vc6,please do help me on this LINK : fatal error LNK1104: cannot open file 'mfcs42.lib' ...

Need convert VC code to Delphi

Hi all, I need call a DLL file in my delphi code, here is the code snippet of the DLL Head file: #define BookInfoDLL __declspec(dllexport) struct _BookTime { unsigned char day; unsigned char month; unsigned short year; }; struct _stBookData { unsigned char encrypt; _BookTime bkTime; unsigned int PageCount; };...

VC++ replaces defines of different objects, GCC etc. not

Hi, I have a big app using many static libs, which is platform independant and deployed under Windows and Linux. All static libs and the main() itself are compiled with two defines: -DVERSION=1.0.0 -DBUILD_DATE=00.00.0000 These defines are used by macros inside each static lib and inside the main to store the current lib version ins...

Visual Assist X - Class View?

After installing visual assist X for Visual C++ 2008, I turned off the standard intellisense by renaming the DLL. Now my normal Class View control doesn't work, and I can't see a corresponding functionality in VA. I assumed there would be one, so I could do things like rename a class without having to open the .h file, or rename a class ...

Visual Assist X - Jump to implementation (alt+G) doesn't work on overloaded methods

I have a class with two methods like: class MyClass { void method(int x); void method(int x,int y,int z); }; Using Visual-Assist, if I put the cursor on one of these lines and hit ALT+G, which should take me to the implementation, instead I get a little popup asking me which implementation I want to go to. Why? Can't it tell? ...