|
Thanks Jun for the suggestion. I already have the 2.0 framework installed on my test system. Still, it doesn't work. When I try to run the application I get a message "This application failed to start because the application configuration is incorrect". It does look as if the needed dll's are in the Global Assembly Cache, so maybe something else is up. I'll keep trying. Thanks again.
Craig
|
|
|
|
|
Solved the problem. The answer is to install the VC redistributable files from following link:
http://www.microsoft.com/downloads/details.aspx?FamilyID=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en
Craig
|
|
|
|
|
an alternative to using the MS installer for the VC runtime libs is to look in your VC install directory for the redist directory. Under there, you'll find the redistributable libraries. You can just include them all in your install dir.
the nice thing about this approach is that you can have an installer which just copies files over and which doesn't risk requiring admin privs which users don't always have.
Either way will work, but I've found the straight copying approach, using the stuff under redist works very well.
Granted, if you're using .NET you are stuck having to run that separate installer or just having that as a requirement, but this at least takes care of the MFC/runtime lib stuff.
|
|
|
|
|
I have a project that was a MFC ccmdtarget app in vs 6 we are moving it to vs 2005 but I get link errors.
utoEngine.obj : error LNK2019: unresolved external symbol "public: static struct CRuntimeClass const CCmdTarget::classCCmdTarget" (?classCCmdTarget@CCmdTarget@@2UCRuntimeClass@@B) referenced in function "protected: static struct CRuntimeClass * __stdcall AutoEngine::_GetBaseClass(void)" (?_GetBaseClass@AutoEngine@@KGPAUCRuntimeClass@@XZ)
AutoEngine.obj : error LNK2019: unresolved external symbol "public: static struct CRuntimeClass * __stdcall AutoEngine::GetThisClass(void)" (?GetThisClass@AutoEngine@@SGPAUCRuntimeClass@@XZ) referenced in function "void __cdecl `dynamic initializer for 'public: static class COleObjectFactory AutoEngine::factory''(void)" (??__E?factory@AutoEngine@@2VCOleObjectFactory@@A@@YAXXZ)
I know this has somthing to do with the way I am linking to MFC, but I have tried to ensure that I am only linking to the mfc 8.0 library only.
a programmer traped in a thugs body
|
|
|
|
|
Just a litlle more info AutoEngine is my class. Also I have both VS 6 and .net on my comp. I have assured that all projects that we are dependant with link to the right mfc library.
a programmer traped in a thugs body
|
|
|
|
|
originally i had:
UCHAR *buff1 = 0, *buff2 = 0,*buff3 = 0;
buff1 = new UCHAR[45000000];
and I used it:
ReadFile(...,...,buff1+offset,...,NULL);
and that was fine.
then I changed it so that it's more flexible:
UCHAR *buff[3];
buff[0] = new UCHAR[45000000];
buff[1] = new UCHAR[45000000];
buff[2] = new UCHAR[45000000];
when I do:
ReadFile(...,...,buff[num],...,NULL);
buff[num]+= 2028;//increment the pointer to the next chunk
I get the error code "998" which is "Invalid access to memory location."
could someone please explain to me what I'm doing wrong?
thanks!
Kitty5
|
|
|
|
|
kitty5 wrote: ReadFile(...,...,buff1+offset,...,NULL);
You are reading into an invalid memory location. You must allocate memory for buff1 , or assign it to a valid memory location, before it can be used in this fashion.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: You are reading into an invalid memory location. You must allocate memory for buff1, or assign it to a valid memory location, before it can be used in this fashion.
I do have: buff1 = new UCHAR[45000000];.
but that works....
it's when I try to use an array of pointers that i run into trouble with....
instead of buff1 i do, buff[0]....
Kitty5
|
|
|
|
|
kitty5 wrote: UCHAR *buff[3];
buff[0] = new UCHAR[45000000];
buff[1] = new UCHAR[45000000];
buff[2] = new UCHAR[45000000];
when I do:
ReadFile(...,...,buff[num],...,NULL);
buff is an array of 'size' 3 and each cell in the array contain a pointer (and each of these pointers point to an array of 45000000 UCHAR). When you do do buff[num] , if num is higher than the size of your array (3 in this case), you write to an invalid address.
By the way, allocating 3 times 45000000 is quite big. Are you sure you want to allocate so much memory ?
|
|
|
|
|
kitty5 wrote: buff[num]+= 2028;
that's a bad idea. since you haven't stored the pointer in buff[num] anywhere else, you won't be able to free buff[num] later. you should make a copy of buff[num] so you'll be able to delete it when you're done.
kitty5 wrote: //increment the pointer to the next chunk
how many 'chunks' do you get before the error happens ?
|
|
|
|
|
kitty5 wrote: buff[num]+= 2028;//increment the pointer to the next chunk
You can't do this and expect to be able to delete the memory. The statement buff[0] = new UCHAR[45000000] assigned a specific memory address to buff[0] . If you advance that address by 2048 bytes, the delete operator will fail. Try:
ReadFile(..., buff[num]+offset, ...);
offset += 2048;
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: You can't do this and expect to be able to delete the memory. The statement buff[0] = new UCHAR[45000000] assigned a specific memory address to buff[0]. If you advance that address by 2048 bytes, the delete operator will fail. Try:
ReadFile(..., buff[num]+offset, ...);offset += 2048;
isn't:
offset = 2028;
ReadFile(..., buff[num]+offset, ...); not the same as:
offset = 2028;
buff[num]+= offset;
ReadFile(..., buff[num], ...);
either way you are advancing the address by 2028?
Kitty5
|
|
|
|
|
One actually advances the pointer, while the other does not. That's the distinction.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
When you allocate a chunk of memory, what you get is a memory chunk at least as big as what you requested, and some extra data. The whole chunk looks like this:
[ Extra Data ][ Your data - X bytes ] The pointer which new returns, is the adress of the first byte of [ Your data ]. The [ Extra Data ] chunk is used later on when you deallocate the memory. When you pass a pointer to delete for deallocation, delete will actually "step back" and take a peek at what's inside [ Extra Data ]. That chunk of data contains book keeping information about the memory allocation - which it really needs to be able to put the allocated memory back into the pool of unallocated memory.
If you increment the pointer value, it will no longer point to the beginning of the data chunk which new returned. So when you pass the modified pointer to delete, it will not find the book keeping information when it "steps back". It will find data from which you put into your data chunk, which delete will interpret as garbage...
--
Torn from tomorrow's headlines
|
|
|
|
|
HI,
Anyone knows if there's any way I can track if the system clock on a Windows OS has been changed, without having to run an application all the time? I mean if there's any history log I can call some function to retrieve?
Thanks!
d8
|
|
|
|
|
dummy808 wrote: Anyone knows if there's any way I can track if the system clock on a Windows OS has been changed...
You mean other than the change that occurs every second?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It's possible there's an entry made in the system event log when someone changes the system clock. I doubt that it's documented, however.
Software Zen: delete this;
|
|
|
|
|
Using VC6
I have a (static, one column, two rows) splitter window in an app I'm working on. I need to make the splitter bar taller and put text in it. I've created a class derived from CSplitterWnd and overridden the OnDrawSplitter function, but nothing I've tried makes the bar any taller.
Can anyone provide assistance?
-----------
Found the answer in the CFlatSplitterWnd article here on CP.
-- modified at 14:08 Friday 8th September, 2006
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Until now I was using Visual Studio 6 to code a program in c++. Recently I downloaded the Visual C++ 2005 Express Edition from microsoft's web site and I'm having trouble using it. I open a project from VS 6 and I can't find the dialogs I had created. But more important is that the project cant be built..!
Anyone to put me out of me misery?
|
|
|
|
|
When VS 2003/2005 loaded a VC 6 project, it will ask if you wanted to convert the project to the new platform. Did you allow the conversion?
Best,
Jun
|
|
|
|
|
|
Visual C++ Express is a free version, thus it doesn't contain all the functionalities. There is no MFC and no resource editor (that's why you cannot find your dialogs). So, if your project was using MFC in VC6 (which probably the case), you won't be able to compile your project.
|
|
|
|
|
Cedric Moonen wrote: ...and no resource editor...
Just out of curiosity, how does one go about editing resources? An external utility?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Yes, there are some free utility, but I cannot find the link anymore . It was called ResEd (resource editor). Of course this is not as good as the one included in visual studio.
|
|
|
|
|
Visual C++ Express sucks
Best,
Jun
|
|
|
|