473,471 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Msvc 2005

2 New Member
i have created a dialog based application for calender.

coding is
void CcalenderDlg::DblClickCalendar1()
{
CString cSelectedDate;
char* cDay="";
char* cYear="";

itoa(m_calender.get_Day (),cDay,10);
cSelectedDate=cDay;

switch(m_calender.get_Month ())
{
case 1: cSelectedDate+="Jan";
break;
case 2: cSelectedDate+="Feb";
break;
case 3: cSelectedDate+="Mar";
break;
case 4: cSelectedDate+="Apr";
break;
case 5: cSelectedDate+="May";
break;
case 6: cSelectedDate+="Jun";
break;
case 7: cSelectedDate+="Jul";
break;
case 8: cSelectedDate+="Aug";
break;
case 9: cSelectedDate+="Sep";
break;
case 10: cSelectedDate+="Oct";
break;

}
itoa(m_calender.get_Year (),cYear,10);
cSelectedDate+=cYear;
LPSTR OriginChar= cSelectedDate.GetBuffer(0);

MessageBox("U dbl Clicked");
//////MessageBox("u dbl clicked",OriginChar,MB_OK);
//cSelectedDate.ReleaseBuffer();

}

initially it was giving errors with messagebox
now when i click on some date in calender it is giving exception

errors-

calender.exe': Loaded 'C:\Documents and Settings\Reetu\My Documents\Visual Studio 2005\Projects\calender\debug\calender.exe', Symbols loaded.
'calender.exe': Loaded 'C:\WINNT\system32\NTDLL.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\mfc80d.dll', Symbols loaded.
'calender.exe': Loaded 'C:\WINNT\system32\msvcr80d.dll', Symbols loaded.
'calender.exe': Loaded 'C:\WINNT\system32\msvcrt.dll', No symbols loaded.
'calender.exe': Loaded 'C:\WINNT\system32\KERNEL32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\GDI32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\USER32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\shlwapi.dll', No symbols loaded.
'calender.exe': Loaded 'C:\WINNT\system32\ADVAPI32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\rpcrt4.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\comctl32.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\OLEAUT32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\OLE32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\mfc80ENU.dll', Binary was not built with debug information.
'calender.exe': Loaded 'C:\WINNT\system32\EntAPI.dll', No symbols loaded.
'calender.exe': Loaded 'C:\WINNT\system32\psapi.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\NETAPI32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\secur32.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\netrap.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\samlib.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\ws2_32.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\ws2help.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\WLDAP32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\dnsapi.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\wsock32.dll', Cannot find or open a required DBG file.
'calender.exe': Unloaded 'C:\WINNT\system32\EntAPI.dll'
'calender.exe': Unloaded 'C:\WINNT\system32\NETAPI32.DLL'
'calender.exe': Unloaded 'C:\WINNT\system32\dnsapi.dll'
'calender.exe': Unloaded 'C:\WINNT\system32\wsock32.dll'
'calender.exe': Unloaded 'C:\WINNT\system32\WLDAP32.DLL'
'calender.exe': Unloaded 'C:\WINNT\system32\ws2_32.dll'
'calender.exe': Unloaded 'C:\WINNT\system32\ws2help.dll'
'calender.exe': Unloaded 'C:\WINNT\system32\samlib.dll'
'calender.exe': Unloaded 'C:\WINNT\system32\netrap.dll'
'calender.exe': Unloaded 'C:\WINNT\system32\secur32.dll'
'calender.exe': Unloaded 'C:\WINNT\system32\psapi.dll'
'calender.exe': Loaded 'C:\WINNT\system32\clbcatq.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\msi.dll', No symbols loaded.
'calender.exe': Loaded 'C:\Program Files\Microsoft Office\OFFICE11\MSCAL.OCX', No symbols loaded.
'calender.exe': Loaded 'C:\WINNT\system32\COMDLG32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\system32\SHELL32.DLL', Cannot find or open a required DBG file.
First-chance exception at 0x1025714a (msvcr80d.dll) in calender.exe: 0xC0000005: Access violation writing location 0x00425d78.
Unhandled exception at 0x1025714a (msvcr80d.dll) in calender.exe: 0xC0000005: Access violation writing location 0x00425d78.
The program '[1628] calender.exe: Native' has exited with code 0 (0x0).
Jul 27 '07 #1
1 1568
weaknessforcats
9,208 Recognized Expert Moderator Expert
You access violation is here:
char* cDay="";
char* cYear="";

itoa(m_calender.get_Day (),cDay,10);
cDay is not a buffer. It is a pointer to a literal. That makes it const. When
itoa() tries to write to cDay is when you get your access violation.

cDay needs to be a char array:
Expand|Select|Wrap|Line Numbers
  1. char cDay[10] = "";           //I'm just guessing the 10
  2.  
Jul 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
8
by: Chris Stankevitz | last post by:
I can't tell you how frusterated I and my coworkers are with "MSVC 7.1 .net 2003" (what am I supposed to call this thing anyway?). Compiling and linking take twice as long with "MSVC 7.1 .net...
6
by: Uli | last post by:
Hello, I'm trying to use a DLL (by static linking) which was compiled with Borland C++Builder (BCB) in Visual C++ (Visual-Studio 2003). All functions are declared with the directive 'extern...
2
by: brckcc | last post by:
I've got a managed extension library that I'm attempting to convert from MSVC 2003 to MSVC 2005. I've converted the project file and am now attempting to compile the application. I get...
11
by: Niels Dekker - no reply address | last post by:
The following attempt to pass my template "Base" as a template template argument was rejected by Microsoft VC++ 8.0 (2005), while it still works on VC++ 7.1 (2003). Is it correct C++? And is...
29
by: Nindi | last post by:
I cannot get the following code to compile under MSVC 2003 or 2005. ........................................................................................... #include<stdio.h> struct...
3
by: salunkerahul | last post by:
Hello All, I have some static libraries generated on MSVC 2005 express edition and I have to use them along with static libraries created with MSVC 2003 and create an application on MSVC2003. ...
3
by: hsmit.home | last post by:
I spent way too much time on this and I must say, I was a little disgruntled with what has been posted on all the various Xalan C mailing lists. Everyone says there's a solution, but give next to...
6
by: ma | last post by:
Hello, Some questions about upgrading to MSVC 2008. 1- I am using MSVC2005, Do you recommend that I upgrade to MSVC 2008 Beta 2? 2- When the MSVC2008 will be officially release? 3- Where...
6
by: hsmit.home | last post by:
Hello, I came across a strange error and it's really been bugging me. Maybe someone else has come across this and any insight would be appreciated. What I'm trying to accomplish is using...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.