Quantcast
Channel: Visual C forum
Viewing all 15302 articles
Browse latest View live

Is Edit and continue support available for X64 application in VS2010

$
0
0

Hi All,

I am using VS 2010 (SP1). When I am trying to use Edit and continue for debugging X64 bit application, I am getting the following error,

  "the source file has changed it no longer matches the version of the file used to build the application being  debugged"

Is there anyway to get rid of this?

OS: Win2008server (64 bit)

Thanks,

SMA


self learner

$
0
0
Using this information "Walkthrough:Creating and Using a Static Library (C++)" I created and compiled a static library, added a Class to utilize the library. After creating a program to refer to this library, during the build I was to referrence the library. In attempting to do this I was unable to find the library I created to be referrenced. Can anyone advise me in what I may be missing?

Rich Text Edit Newbie - Why No WM_NOTIFY?

$
0
0

Hi Again Folks:

   Developing on Win 8.1 Pro, VS 2010 Pro, using the Resource Editor to layout dialog with rich text edit control.

   I'm doing my first rich text edit control, and the edit controller's parent dialog procedure isn't receiving any WM_NOTIFY messages at all. 

   I've done lots of simple text edit controls before, but my code hasn't really interacted with them.  When the user clicks "OK" to close the dialog I extract the text from the control and we're good. 

   I'm thinking the dialog that has a rich text edit control needs to be more interactive, for example reacting to the user selecting a piece of text and hitting a button to make it bold or change its font. 

   I've been referring to:

      http://msdn.microsoft.com/en-us/library/windows/desktop/bb787877%28v=vs.85%29.aspx

 among other resources, and I don't see what I'm doing wrong. 

    The docs for EN_CHANGE and EN_SELCHANGE state the the notification code comes in the form of a WM_NOTIFY message. 

   I've used the Resource Editor to lay out the dialog, selected "Rich Edit 2.0 Control" to create the control.  I can't see any item in the control's properties where a notification to the parent could be suppressed, even if I wanted that to happen. 

   I have "LoadLibrary(TEXT("Riched20.dll"));" in my main C++ module's WM_NCCREATE clause. 

   I know some kind soul in this forum will help me. 

      Thanks
      Larry


Where is CFileDialog resource for "All files (*.*)" required for internationalization?

$
0
0

We have an application which ships in multiple languages, and where there is a customized CFileDialog.  In it, the lpszFilter needs to be set to our custom file extension while at the same time allowing for 'All Files (*.*)' to be displayed.

http://msdn.microsoft.com/en-us/library/wh5hz49d.aspx

Where can the 'All Files (*.*)' string be obtained so that it is localized?


neill2001

$
0
0
I have a Zune 30GB, in which it can connect to PC ok, I can add new playlists etc., but when unplugged, I can scroll up and down, but the ok button does not work so I an unable to listen to any music or anything - I have tried a reboot but to no avail, can anyone help  

Cannot succeed usng Debug Information Format = None in VS 2012

$
0
0

I am trying to disable debugging information in Release mode. Has anyone done that with VS2012?

I have set the Debug Information Format = None for the compiler and the Linker option Generate Debug Info to No.

The projects compiles but doesn't remember its build state. Every time I run it says it needs to compile again. Every time on build it builds all files.

When I looked in the build log I noticed: 'Forcing recompile of all source files due to missing PDB "release\vc110.pdb'

Why does it look for the PDB? Didn't I disable it altogether? Is there another option I need to disable or it's a bug and I should just forget about disabling the debug info?


AT Commands sent to USB Modem

$
0
0

Hi,

I am trying to send AT commands to a USB modem using VC++. I found the code below online and have tried using it. I do not get any errors but it doesn't appear to be working.

I used Putty to set AT+CMGF= 0. However after I run this code, when I check the value of AT+CMGF it is still 0, so although no error is being thrown up, it doesn't seem to be sending correctly.

Any help would be great thanks.

#include <iostream>
#include <Windows.h>
#include <string.h>

using std::string;


int main() {

std::string data = "AT+CMGF=1";


 DCB dcb; 
 DWORD byteswritten; 
 HANDLE hPort = CreateFile( 
 
 "COM3", //"\\\\.\\COM10"
 GENERIC_WRITE | GENERIC_READ, 
 FILE_SHARE_READ| FILE_SHARE_WRITE, 
 NULL, 
 OPEN_EXISTING, 
 0, 
 NULL 
 ); 
 DWORD dwerror = GetLastError();
 if (GetCommState(hPort,&dcb) == 0) {
 
return false; }
 dcb.BaudRate = CBR_9600; //9600 Baud 
 dcb.ByteSize = 8; //8 data bits 
 dcb.Parity = NOPARITY; //no parity 
 dcb.StopBits = ONESTOPBIT; //1 stop 
 if (!SetCommState(hPort,&dcb)) 
 return false; 


 bool retVal = WriteFile(hPort,&data,200,&byteswritten,NULL);

 dwerror = GetLastError();

  
 CloseHandle(hPort); //close the handle 
 return retVal; 




}


System cannot find the file specified/debugging error

$
0
0
Hi, I installed Visual C++ 2010 Express months ago, but recently I've been having a problem. My program builds fine, but when I try to debug I get an error message: 'Unable to start program C:\...thisProject.exe, The system cannot find the file specified.' I manually searched into the folders and sure enough there are no executables. Not sure if this may be related, but I did recently download Visual Basic, and uninstalled it after I recognized the problem, reinstalled VC++, turned my antiviruses off, but nothing is working. Help? TIA

Getting error -- "Unable to start program 'C:\.......\debug\sample.exe'. The system cannot find the file specified"

$
0
0

I have re-installed it and YES I have tried to check the path to see if the file is there (the .exe file is there). 

I cannot, for the life of me, seem to get this thing to work. 

I tried everything of the following:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/e60f9f37-69ad-47f3-b1d3-132aabe68f86/unable-to-start-program-the-system-cannot-find-the-file-specified?forum=vsdebug

http://social.msdn.microsoft.com/Forums/vstudio/en-US/4253e88a-7a32-48fd-b2fa-093bf41fcb38/unable-to-start-program-cexe-the-system-cannot-find-the-file-specified?forum=visualstudiogeneral

http://social.msdn.microsoft.com/Forums/vstudio/en-US/9816c136-e07b-4540-b63b-a3ed36e24ed8/unable-to-start-program-the-system-cannot-find-specified-path?forum=vsdebug

http://social.msdn.microsoft.com/Forums/vstudio/en-US/3b8ffe5b-7b71-4218-a8fd-b8e8cb5e6168/unable-to-start-debugging-unable-to-start-programthe-system-cannot-find-the-file-specified?forum=vsdebug

VS C++ 2010 seems to have an issue with me ! Please tell me how to fix! I tried doing this on TWO different computers and TWO diffeent versions of the VS (2005 and 2010) and they both showed me same issues. I reinstalled it and installed in (newly) to my other desktop but they are both giving me the same message. I checked if my code was wrong but honestly it was THIS:

#include <stdio.h>

int main(void){

printf("Hello\n");

return 0;

}

 

IT WAS NOTHING AND IT SHOULDN'T HAVE GIVEN ME TROUBLE. I'm actually pretty sure something is conspiring against me, but in the meanwhile, please help me! I'm desperate...

Thanks in advance,

Lil

THIS is the picture btw: 

http://imgur.com/X5TvFZw

http://imgur.com/GQcyiHX

Working with servers

$
0
0

Today with so many cloud offerings out there, the idea of a path for a given project has become a tab harder to grip

UNC paths, such as //SERVER93//BACKUP, or //SERVER31//PUBLIC are some examples I was 

I usually use <fstream> and I was wondering about dealing with various ways to work with data from one server and dump results to another server


Corsair Carbide 300R with TX850V2
Asus M5A99FX PRO R2.0 CFX/SLI
AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
G.SKILL RipjawsX DDR3-2133 8 GB
EVGA GTX 660 Ti FTW Signature 2 (GK104 Kepler)
Asus PA238QR IPS LED HDMI DP 1080p
ST2000DM001 & Windows 8.1 Professional x64
Microsoft Wireless Desktop 2000 & Wacom Bamboo CHT470M

Place your rig specifics into your signature like I have, makes it 100x easier to understand!

Hardcore Games Legendary is the Only Way to Play!

QueryPerformanceFrequency( ) vs QueryPerformanceCounter()

$
0
0

Windows 7, Visual Studio 2008, C++

The code queried for performance frequency and for the counter two times.  The results look very suspicious because the counter has much greater resolution than the frequency should allow.

Here is the code fragment:

    LARGE_INTEGER d1, d2, d3, dx;
    QueryPerformanceCounter( &d1 );
    QueryPerformanceFrequency(&dx ); 
    QueryPerformanceCounter( &d2 );
    d3.QuadPart = d2.QuadPart - d1.QuadPart;

The value contains in dx :  14 318 180

d2 = 245 653 744 153

d1 = 245 653 744 104

d3 =                     49

Seems to me the counter is counting much faster than the 14 Mhz frequency discovered.

What is going on here?


~jag77 We need to know what a dragon is before we study its anatomy. (Bryan Kelly, 2010)


C++/Cx arrays

$
0
0

Can one of you with experience with C++/Cx tell me why the second case here doesn’t compile:

 

#include <msclr/marshal.h>
#include
 <msclr/marshal_cppstd.h>

System
::String^ path = gcnew System::String(root);array<System::String^>^ dirs = System::IO::Directory::GetDirectories(path);
for
 (int i = 0; i < dirs->Length; i++)
{
        // this works
        System::String^ mStr = dirs[i];
        auto nativeString0(msclr::interop::marshal_as<std::string>(mStr));
        

        //this doesn't
        auto nativeString1(msclr::interop::marshal_as<std::string>(dirs[i]));
}


The error is:

1>ManagedConsole.cpp(23): error C2665: 'msclr::interop::marshal_as' : none of the 3 overloads could convert all the argument types
1>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\msclr/marshal_cppstd.h(33): could be 'std::string msclr::interop::marshal_as<std::string,System::String^>(System::String ^const&)'


1>          while trying to match the argument list '(System::String ^)'
 

 

 



How do I determine if my C++ program built in VS 2013 is CLR or CLI

$
0
0

Hello,

I am trying to learn about C++ by reading whatever is necessary.

I find a lot of references to "CLR" and "CLI".

How do I determine if my Visual Studio 2013 C++ program is "CLR" or "CLI".

Also, how do I tell if my code is "managed" or "unmanaged"?

Thanks,
Tony


Stop The World, I want To Get Off! ........... Life Isn't About Waiting For The Storm To Pass ... It's About Learning To Dance In The Rain.


Same resolution on different screen size does not give same result

$
0
0

Hi,

I am developing a dialog base application using MFC. This dialog should be display properly in all resolution. In 17" screen, resolution is 800x600, the dialog displayed properly. But in 8" screen, the same 800x600 resolution not able to display that dialog, and some portion of that dialog goes out of screen. 

Isn't it work for both screen size if resolution is same in both the screens. What could be the reason for that, and settings I have to do in smaller screen size? 

Building Compilers

$
0
0

Greetings,
So I was thinking about making my own basic programming language. I read a little bit about it, and I understand the part of parsing, semantics and all that stuff. My question is about the very last step. After knowing the logic the of the file I am compiling, how can I write an executable file that can run?

Since I guess that answer will differ from platform to another, I would like to know how it is done for one specific platform (i.e. assuming my compiler can compile for only 1 platform), as well as how modern compilers deal with that issue.

Thanks.

P.S.: I am not sure where should I post this, but since I am going to write the solution in C++ plus plus so I posted it here.


Can separate Child Processes each load and invoke a different instance of a COM Server?

$
0
0
I need to create an web based application that is executed from a COM server. I am aware of multi-threading. It might be better if the COM server objects are totally isolated from each other each in their own separate Child Process. Can separate Child Processes load in-process (DispInterface) COM Servers and invoke their functions?

100% Accurate Display Screen OCR http://www.OCR4Screen.com

A copy of MyFile.cpp was found in C:\MyDir\MyFile.cpp

$
0
0

I'm developing an application using Visual C++ Express 2012 and I'm seeing the following mysterious message pop up as the debugger starts running the program:

A copy of MyFile.cpp was found in C:\MyDir\MyFile.cpp, but the current source code is different from the version built into C:\MyDir\MyFile.cpp.

Note: MyFile is not the name of the project or the EXE file that it builds.

I've looked and I have only one copy of MyFile.cpp in MyDir and its subdirectories.

The debugger steps through this module without any problems; I'm pretty sure the code compiled into the EXE file does match the source code in MyFile.cpp.

Does anyone have any idea what this is trying to say?

Thanks, Norm


Norm

error C2062: type 'float' unexpected

$
0
0

Am trying to compile a displacement map from some dx9 samples but when i goto rebuild i get the following errors and can`t work out how to resolve/fix the errors.

1>------ Rebuild All started: Project: DisplacementMap, Configuration: Release Win32 ------

1>  Camera.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  d3dApp.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  d3dUtil.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  DirectInput.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  DisplacementMapDemo.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  DrawableTex2D.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  GfxStats.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  Heightmap.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  Sky.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  Terrain.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  Vertex.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
1>  WaterDmap.cpp
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(90): error C2062: type 'float' unexpected
1>d:\dx\dx9\chapter 22\displacementmap\d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

This bit of code seems to be causing all those errors and warnings . I`m pretty sure the warnings can be ignored.

const float INFINITY = FLT_MAX;

when i goto peek definition

#define const EMIT WARNING C4005 

is shown.

Ok so how do i fix those errors as i`ve had a brief search of the net and found nothing to fix it.

Thanks.


msvcp120.dll missing

$
0
0

I gave a copy of a small VC++ (none managed) program I am writing to test to a friend who is missing this dll(s)
msvcp120.dll
msvcr120.dll
vccorlib120.dll
vcamp120.dll
vcomp120.dll

My friend does not have VSExpress 2013 installed, how can she get a copy of this files? and where should this files be installed?

Thanks


In the absence of clearly-defined goals, we become strangely loyal to performing daily trivia until ultimately we become enslaved by it.

Class member size

$
0
0
 

Hello friends. I am working on a program which will print the total memory required to allocate in RAM. And have 6 data-member in the class. Turbo C++ compiler is giving the correct result but in Dev C++ compiler, it is not giving correct one. Here is my code :->

#include<iostream>
class A
{
int a;
short int b;
char c;
float d;
double e;
long double f;
public :
void size1();
void size2();
void size3();
void size4();
void size5();
void size6();
void display(void);
};
void A :: size1()
{
std::cout<<"int->"<<sizeof(a)<<std::endl;
}
void A :: size2()
{
std::cout<<"short int->"<<sizeof(b)<<std::endl;
}
void A :: size3()
{
std::cout<<"char->"<<sizeof(c)<<std::endl;
}
void A :: size4()
{
std::cout<<"float->"<<sizeof(d)<<std::endl;
}
void A :: size5()
{
std::cout<<"double->"<<sizeof(e)<<std::endl;
}
void A :: size6()
{
std::cout<<"long double->"<<sizeof(f)<<std::endl;
}
void A :: display(void)
{
std::cout<<sizeof(a)+sizeof(b)+sizeof(c)+sizeof(d)+sizeof(e)+sizeof(f)<<std::endl;
}
int main()
{
A a;

std::cout<<sizeof(a)<<std::endl;
a.size1();
a.size2();
a.size3();
a.size4();
a.size5();
a.size6();
a.display();
return 0;
}
The correct result is size = 31
But it is giving size = 40
Please somebody help me out.

Viewing all 15302 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>