473,587 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Msvc 2005

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

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

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

switch(m_calend er.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.G etBuffer(0);

MessageBox("U dbl Clicked");
//////MessageBox("u dbl clicked",Origin Char,MB_OK);
//cSelectedDate.R eleaseBuffer();

}

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\Visua l Studio 2005\Projects\c alender\debug\c alender.exe', Symbols loaded.
'calender.exe': Loaded 'C:\WINNT\syste m32\NTDLL.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\mfc80d.dll' , Symbols loaded.
'calender.exe': Loaded 'C:\WINNT\syste m32\msvcr80d.dl l', Symbols loaded.
'calender.exe': Loaded 'C:\WINNT\syste m32\msvcrt.dll' , No symbols loaded.
'calender.exe': Loaded 'C:\WINNT\syste m32\KERNEL32.DL L', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\GDI32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\USER32.DLL' , Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\shlwapi.dll ', No symbols loaded.
'calender.exe': Loaded 'C:\WINNT\syste m32\ADVAPI32.DL L', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\rpcrt4.dll' , Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\comctl32.dl l', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\OLEAUT32.DL L', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\OLE32.DLL', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\mfc80ENU.dl l', Binary was not built with debug information.
'calender.exe': Loaded 'C:\WINNT\syste m32\EntAPI.dll' , No symbols loaded.
'calender.exe': Loaded 'C:\WINNT\syste m32\psapi.dll', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\NETAPI32.DL L', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\secur32.dll ', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\netrap.dll' , Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\samlib.dll' , Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\ws2_32.dll' , Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\ws2help.dll ', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\WLDAP32.DLL ', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\dnsapi.dll' , Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\wsock32.dll ', Cannot find or open a required DBG file.
'calender.exe': Unloaded 'C:\WINNT\syste m32\EntAPI.dll'
'calender.exe': Unloaded 'C:\WINNT\syste m32\NETAPI32.DL L'
'calender.exe': Unloaded 'C:\WINNT\syste m32\dnsapi.dll'
'calender.exe': Unloaded 'C:\WINNT\syste m32\wsock32.dll '
'calender.exe': Unloaded 'C:\WINNT\syste m32\WLDAP32.DLL '
'calender.exe': Unloaded 'C:\WINNT\syste m32\ws2_32.dll'
'calender.exe': Unloaded 'C:\WINNT\syste m32\ws2help.dll '
'calender.exe': Unloaded 'C:\WINNT\syste m32\samlib.dll'
'calender.exe': Unloaded 'C:\WINNT\syste m32\netrap.dll'
'calender.exe': Unloaded 'C:\WINNT\syste m32\secur32.dll '
'calender.exe': Unloaded 'C:\WINNT\syste m32\psapi.dll'
'calender.exe': Loaded 'C:\WINNT\syste m32\clbcatq.dll ', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\msi.dll', No symbols loaded.
'calender.exe': Loaded 'C:\Program Files\Microsoft Office\OFFICE11 \MSCAL.OCX', No symbols loaded.
'calender.exe': Loaded 'C:\WINNT\syste m32\COMDLG32.DL L', Cannot find or open a required DBG file.
'calender.exe': Loaded 'C:\WINNT\syste m32\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 1577
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
4366
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 files containing some templates: adjacency_list.hpp and mem_fn.hpp can not compile. Does anyone have any solutions?
8
1910
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 2003" than with MSVC 6. My coworkers are angry at "MSVC .net 7.1 2003" and they're angry at me for pushing it (due to better C++ compliance). The...
6
3443
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 "C"' so that a cross-compiler-usage must be possible. I created an import library (.lib) for MSVC by using the LIB function and using a .DEF file...
2
1638
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 multiple occurrences of the following linker errors: extern "C" void __clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"...
11
3086
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 there a workaround? template <typename T> class Base { }; template <typename U, template <typename> class TempTemp> class Derived;
29
2061
by: Nindi | last post by:
I cannot get the following code to compile under MSVC 2003 or 2005. ........................................................................................... #include<stdio.h> struct _MyStruct; typedef struct _MyStruct MyStruct; typedef void (*funcType)(MyStruct *);
3
33097
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. example.lib - generated on MSVC2005 All other libs - generated on MSVC2003 I have attached the compiler options as well as the error log along. ...
3
3391
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 no detail on how to achieve this "allusive" solution. Well I spent the better part of a day finally figuring it out the hard way, trial and error. ...
6
2452
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 can I download MSVC 2008 Beta 2?
6
2539
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 boost::lexical_cast to cast a vector of strings to a string. The compiler I'm using is MSVC++ 2005 Express Edition. The gc++
0
7852
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6629
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5395
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2364
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 we have to send another system
1
1455
muto222
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.