Click here to Skip to main content
15,897,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNT Service - problem with re-registering Pin
Anonymous7-May-04 11:08
Anonymous7-May-04 11:08 
GeneralRe: NT Service - problem with re-registering Pin
2249177-May-04 19:19
2249177-May-04 19:19 
GeneralRe: NT Service - problem with re-registering Pin
Anonymous9-May-04 5:55
Anonymous9-May-04 5:55 
GeneralFile organization with larger projects Pin
Steve Messer7-May-04 10:07
Steve Messer7-May-04 10:07 
GeneralRe: File organization with larger projects Pin
Maarten Kools7-May-04 10:22
professionalMaarten Kools7-May-04 10:22 
GeneralRe: File organization with larger projects Pin
Steve Messer7-May-04 11:07
Steve Messer7-May-04 11:07 
GeneralRe: File organization with larger projects Pin
John M. Drescher7-May-04 10:24
John M. Drescher7-May-04 10:24 
GeneralRe: File organization with larger projects Pin
Steve Messer7-May-04 11:25
Steve Messer7-May-04 11:25 
That's what I would of thought as well.

I am not using any threads. Well, I am using MSXML4 using smart pointers so I don't know what's going on in the background nevertheless the project was working just fine. I recently had a working project and decided that I wanted to clean up the code and reorganize the file structure. I added nothing new during this cleaning up process so it can't be anything I added.

I did things like:

Changed this from:

int A,R,G,B;

to this:

struct _Color
{
int A,R,G,B;
};

and

CString Fontname;
CString Fontstyle;
float Fontsize;
int A,R,G,B;

to

struct _Font
{
float Size;
CString Name, Style;
_Color Color;
};

I changed the way I included some of my file around and now the very first CString I get to I get the following error.

First-chance exception in HTPCCORE.exe (MFC42D.DLL): 0xC0000005: Access Violation.

crashing in the = operator

const CString& CString::operator=(const CString& stringSrc)
{
if (m_pchData != stringSrc.m_pchData)
{
crashs here-> if ((GetData()->nRefs < 0 && GetData() != _afxDataNil) ||

stringSrc.GetData()->nRefs < 0)
{
// actual copy necessary since one of the strings is locked
AssignCopy(stringSrc.GetData()->nDataLength, stringSrc.m_pchData);
}
else
{
// can just copy references around
Release();
ASSERT(stringSrc.GetData() != _afxDataNil);
m_pchData = stringSrc.m_pchData;
InterlockedIncrement(&GetData()->nRefs);
}
}
return *this;
}

Makes no sense.

If I were using threads what would the solution be. Oh, I am using VC++6 and I recently installed the latest service pack. Things were still working then as well.
GeneralRe: File organization with larger projects Pin
John M. Drescher8-May-04 16:07
John M. Drescher8-May-04 16:07 
GeneralRe: File organization with larger projects Pin
Steve Messer8-May-04 18:02
Steve Messer8-May-04 18:02 
GeneralRe: File organization with larger projects Pin
John M. Drescher7-May-04 10:29
John M. Drescher7-May-04 10:29 
GeneralRe: File organization with larger projects Pin
Steve Messer7-May-04 11:27
Steve Messer7-May-04 11:27 
GeneralContext-sensitive modular HTML Help Pin
Banister7-May-04 8:38
Banister7-May-04 8:38 
GeneralC++ callback __cdecl to __thiscall Pin
greg897-May-04 7:52
greg897-May-04 7:52 
GeneralRe: C++ callback __cdecl to __thiscall Pin
Maarten Kools7-May-04 8:00
professionalMaarten Kools7-May-04 8:00 
GeneralRe: C++ callback __cdecl to __thiscall Pin
greg897-May-04 10:03
greg897-May-04 10:03 
GeneralRe: C++ callback __cdecl to __thiscall Pin
Maarten Kools7-May-04 10:12
professionalMaarten Kools7-May-04 10:12 
GeneralRe: C++ callback __cdecl to __thiscall Pin
John M. Drescher7-May-04 10:31
John M. Drescher7-May-04 10:31 
GeneralRe: C++ callback __cdecl to __thiscall Pin
valikac7-May-04 18:51
valikac7-May-04 18:51 
GeneralNM_CUSTOMDRAW (ListView) Pin
Maarten Kools7-May-04 7:22
professionalMaarten Kools7-May-04 7:22 
GeneralRe: NM_CUSTOMDRAW (ListView) Pin
Gary R. Wheeler8-May-04 14:06
Gary R. Wheeler8-May-04 14:06 
GeneralCBitmapButton Pin
dart137-May-04 5:20
dart137-May-04 5:20 
GeneralRe: CBitmapButton Pin
Iain Clarke, Warrior Programmer7-May-04 5:35
Iain Clarke, Warrior Programmer7-May-04 5:35 
GeneralRe: CBitmapButton Pin
Rick York7-May-04 8:05
mveRick York7-May-04 8:05 
GeneralRe: CBitmapButton Pin
dart137-May-04 9:43
dart137-May-04 9:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.