The Interactive Animation - my first released C program

This is a discussion on The Interactive Animation - my first released C program within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I see two files that have a ".manifest" extension in this location: C:\My Documents\My programs\Interactive Animation\Interactive Animation\Debug\ These files are: ...

  1. #16
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    I see two files that have a ".manifest" extension in this location:

    C:\My Documents\My programs\Interactive Animation\Interactive Animation\Debug\

    These files are:
    Interactive Animation.exe.embed.manifest
    Interactive Animation.exe.intermediate.manifest

    There is no msvcr80.dll.manifest anywhere. I did a search for "*msvcr80.dll*" in Windows' file search feature and there's no msvcr80.dll anywhere. There's now 19 of those msvcr80.dll files, 13 of which duplicates of the previous 6. What now?

  2. #17
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    Ok. Here's a proper guide, based on instructions I found here. I'm rewriting it for convenience, and because there's a minor difference I found between doing this on XP and Vista, and because there's a crucial bit of info missing from the guide on the MS forums.

    NOTE: This assumes you're using VC 2005 Express.

    In \windows\winsxs\, look for the folders starting with x86_microsoft.vc80.crt. The above guide for XP says \windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e 18e3b_8.0.50727.42_x-ww_0de06acd, but no such directory exists on my Vista system. I found it in C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a 1e18e3b_8.0.50727.163_none_10b3ea459bfee365, but the DLLs where in another directory or two as well. To be sure, make sure the file sizes are as follows:
    msvcm80.dll - 468kb
    msvcp80.dll - 536kb
    msvcr80.dll - 612kb

    Copy those files to a folder called "Microsoft.VC80.CRT". Perhaps in the VC\redist\x86 folder like the above guide says. I don't think it really matters.

    In the same folder, create a file called "Microsoft.VC80.CRT.manifest", and copy the following into it:
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Copyright &#169; 1981-2001 Microsoft Corporation -->
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <noInheritable/>
        <assemblyIdentity 
            type="win32" 
            name="Microsoft.VC80.CRT" 
            version="8.0.50608.0" 
            processorArchitecture="x86" 
            publicKeyToken="1fc8b3b9a1e18e3b"
        />
        <file name="msvcr80.dll"/>
        <file name="msvcp80.dll"/>
        <file name="msvcm80.dll"/>
    </assembly>
    Here's the missing bit from the other guide: note the version number in red. You'll have to change this to match your DLL version. Just right click any of the DLLs, go to the "details" tab, and get the product version.

    Then copy this folder containing the manifest and the DLLs to your app directory.

    I have no idea if it works with the DLLs and manifest outside of "Microsoft.VC80.CRT", in the same directory as the app. You'll have to try it and see.
    Last edited by psychopath; 04-30-2007 at 02:13 PM.
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  3. #18
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    I followed your procedure that you've given (hopefully anyway), and I've rezipped the file and reuploaded it as well. Can you test it on a computer that doesn't have Visual C++ installed to see if it works or not?

    Edit: Here's the link again, for convenience.

    Edit #2: I noticed that I forgot to save the file where I changed the version to match the file and uploaded the wrong one. I've fixed this and reuploaded and if you have downloaded the new version (with the manifest stuff in it) before 4:00 PM, you should redownload it so you have the fixed version.
    Last edited by ulillillia; 04-30-2007 at 03:04 PM. Reason: Link for convenience and mistake made in upload

  4. #19
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    Still doesn't work. I changed the version number in the CRT manifest to match the DLLs, but still nothing. Can you upload "Interactive Animation.exe.intermediate.manifest"? I think that may need to be present to. I'm not sure. When I did this it was with a .NET app, which embeds the manifest in the exe, so I didn't need do bother with the app manifest myself.

    EDIT: if you can, post up "Interactive Animation.exe.embed.manifest" too. I created a manifest for the app, but i'm still getting a missing DLL error.
    EDIT2: is the debug or release version of "Interactive Animation.exe"?
    Last edited by psychopath; 05-01-2007 at 05:29 AM.
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  5. #20
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    It works fine for me. What the hell is it?
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  6. #21
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    It works fine for me
    Does your computer already have MSVC installed?
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  7. #22
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    Quote Originally Posted by psychopath View Post
    Still doesn't work. I changed the version number in the CRT manifest to match the DLLs, but still nothing. Can you upload "Interactive Animation.exe.intermediate.manifest"? I think that may need to be present to. I'm not sure. When I did this it was with a .NET app, which embeds the manifest in the exe, so I didn't need do bother with the app manifest myself.

    EDIT: if you can, post up "Interactive Animation.exe.embed.manifest" too. I created a manifest for the app, but i'm still getting a missing DLL error.
    EDIT2: is the debug or release version of "Interactive Animation.exe"?
    This is from the embed manifest:

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <dependency>
        <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
        </dependentAssembly>
      </dependency>
    </assembly>
    This is from the intermediate manifest:

    Code:
    <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
    <assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
      <dependency>
        <dependentAssembly>
          <assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
        </dependentAssembly>
      </dependency>
    </assembly>
    As to the debug/release, that I have no idea on. How can I find out?

    What the program is is remake of the first program I made back in January of 2005, but in C rather than what Gamestudio uses. This version has much better graphics than the original.

  8. #23
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    It should be set in your IDE (generally in a drop-down in the toolbar). But I can tell you that it's debug anyway, because your app manifest is looking for Microsoft.VC80.DebugCRT, which is the debug version of the CRT, which you aren't allowed to redistribute anyway (as of VS8). You'll need to recompile in release mode.
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  9. #24
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    The only one of those VC80 things I am redistributing is the one without the debug. There is a drop down at the top right next to the "play" button that has the options "debug", "release", and "Configuration Manager". I take it that I'm supposed to choose "release" from this drop down menu, then recompile the program. Is that correct? I'm still not familiar with what some things are in Visual C++ 2005 Express. There's a lot of advanced things in there. I was wondering what that drop down menu was for. I'll try this and see what happens and reupload the new version.

  10. #25
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    I've just tried to compile it in release mode, but I'm getting an error related to the precompiled header (of which, in my project configuration settings, I've chosen that I'm not using), and that it won't compile. This is the error:

    stdafx.cpp
    Compiling...
    Interactive Animation.c
    .\Interactive Animation.c(13) : fatal error C1853: 'Release\Interactive Animation.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)
    The IDE seems to use C++ rather than C and it's this conflict that's causing it. Is it possible that this precompiled header be ignored during compiling? If it's required, then how do I recompile it as C-only? If it's not required, how can I bypass it? Is stdafx.cpp required? It only has a include toward stdafx.h and that file only has this:

    Code:
    #pragma once
    #define _CRT_SECURE_NO_DEPRECATE
    // Modify the following defines if you have to target a platform prior to the ones specified below.
    // Refer to MSDN for the latest info on corresponding values for different platforms.
    #ifndef WINVER				// Allow use of features specific to Windows XP or later.
    #define WINVER 0x0501		// Change this to the appropriate value to target other versions of Windows.
    #endif
    
    #ifndef _WIN32_WINNT		// Allow use of features specific to Windows XP or later.                   
    #define _WIN32_WINNT 0x0501	// Change this to the appropriate value to target other versions of Windows.
    #endif						
    
    #ifndef _WIN32_WINDOWS		// Allow use of features specific to Windows 98 or later.
    #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
    #endif
    
    #ifndef _WIN32_IE			// Allow use of features specific to IE 6.0 or later.
    #define _WIN32_IE 0x0600	// Change this to the appropriate value to target other versions of IE.
    #endif
    
    #define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
    // Windows Header Files:
    #include <windows.h>
    
    // C RunTime Header Files
    #include <stdlib.h>
    #include <malloc.h>
    #include <memory.h>
    #include <tchar.h>
    All my includes are on the main C file. The stuff with the #ifndef and the defines within them I don't know about (and probably don't use).

    Edit: I figured I'd post the includes at the top of the main file:

    Code:
    #define WIN32_LEAN_AND_MEAN	
    #pragma comment(linker, "/subsystem:windows")
    #pragma comment(lib, "Winmm.lib") // Needed for timeGetTime()
    #pragma comment(lib, "Vfw32.lib") // Needed for DrawDibDraw and the related
    #pragma comment(lib, "Msimg32.lib") // Needed for using alpha channel
    /*	Pre-processor directives*/
    #include "stdafx.h"
    #include "Vfw.h"
    #include "KeyIncludes.h" // used for easier-to-remember keys
    #include "FontDefines.h" // used for font-related defines for easier use
    #include <stdio.h> // common includes
    #include <string.h>
    #include <stdlib.h>
    #include <time.h>
    #include <windows.h>
    Notice many duplicate things that are already in the stdafx.h file. Should I just remove that stdafx.h include from my area (but then, what about the ifndef stuff)?
    Last edited by ulillillia; 05-01-2007 at 09:36 AM. Reason: Includes on main header added

  11. #26
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    Quote Originally Posted by psychopath View Post
    Does your computer already have MSVC installed?
    Yes, yes it does. Sorry.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  12. #27
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    There should be something in the project options to disable using a precompiled header. I can't remember exactly where. But removing stdafx.h won't work on its own.

    EDIT: actually, you can also try using "rebuild project" instead of just "build project" while in release mode. this will force a rebuild of the PCH in release mode, and should get rid of the error. if not, continue to disable the PCH.
    Last edited by psychopath; 05-01-2007 at 11:06 AM.
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  13. #28
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    It appears as if there are different options for the debug version and the release version. When I do compile, however, I get a lot of warnings that I never got with the debug version and when I run it, I get very strange looks and the files aren't loading likely as a result. I see a lot of rectangles for text when working with strings. These are the warnings I'm getting:

    Code:
    .\Interactive Animation.c(308) : warning C4133: 'function' : incompatible types - from 'char [512]' to 'LPCWSTR'
    .\Interactive Animation.c(308) : warning C4133: 'function' : incompatible types - from 'char [27]' to 'LPCWSTR'
    .\Interactive Animation.c(329) : warning C4133: 'function' : incompatible types - from 'char [192]' to 'LPWSTR'
    .\Interactive Animation.c(339) : warning C4133: 'function' : incompatible types - from 'char [512]' to 'LPCWSTR'
    .\Interactive Animation.c(339) : warning C4133: 'function' : incompatible types - from 'char [15]' to 'LPCWSTR'
    .\Interactive Animation.c(374) : warning C4133: 'function' : incompatible types - from 'char [512]' to 'LPCWSTR'
    .\Interactive Animation.c(374) : warning C4133: 'function' : incompatible types - from 'char [16]' to 'LPCWSTR'
    .\Interactive Animation.c(391) : warning C4133: 'function' : incompatible types - from 'char [512]' to 'LPCWSTR'
    .\Interactive Animation.c(391) : warning C4133: 'function' : incompatible types - from 'char [16]' to 'LPCWSTR'
    .\Interactive Animation.c(428) : warning C4133: 'function' : incompatible types - from 'char [512]' to 'LPCWSTR'
    .\Interactive Animation.c(428) : warning C4133: 'function' : incompatible types - from 'char [16]' to 'LPCWSTR'
    .\Interactive Animation.c(447) : warning C4133: 'function' : incompatible types - from 'char [512]' to 'LPCWSTR'
    .\Interactive Animation.c(447) : warning C4133: 'function' : incompatible types - from 'char [16]' to 'LPCWSTR'
    .\Interactive Animation.c(1157) : warning C4133: 'function' : incompatible types - from 'char [512]' to 'LPCWSTR'
    .\Interactive Animation.c(1157) : warning C4133: 'function' : incompatible types - from 'char [27]' to 'LPCWSTR'
    .\Interactive Animation.c(1237) : warning C4133: 'function' : incompatible types - from 'char [512]' to 'LPCWSTR'
    .\Interactive Animation.c(1237) : warning C4133: 'function' : incompatible types - from 'char [27]' to 'LPCWSTR'
    .\Interactive Animation.c(1259) : warning C4133: 'function' : incompatible types - from 'char [512]' to 'LPCWSTR'
    .\Interactive Animation.c(1259) : warning C4133: 'function' : incompatible types - from 'char [27]' to 'LPCWSTR'
    .\Interactive Animation.c(1771) : warning C4133: 'function' : incompatible types - from 'char [512]' to 'LPCWSTR'
    .\Interactive Animation.c(1771) : warning C4133: 'function' : incompatible types - from 'char [27]' to 'LPCWSTR'
    .\Interactive Animation.c(1819) : warning C4133: 'function' : incompatible types - from 'char [16]' to 'LPCWSTR'
    .\Interactive Animation.c(1845) : warning C4133: '=' : incompatible types - from 'char [8]' to 'LPCWSTR'
    .\Interactive Animation.c(1890) : warning C4133: 'function' : incompatible types - from 'char [8]' to 'LPCWSTR'
    .\Interactive Animation.c(1890) : warning C4133: 'function' : incompatible types - from 'char [32]' to 'LPCWSTR'
    .\Interactive Animation.c(1980) : warning C4133: 'function' : incompatible types - from 'char [8]' to 'LPCWSTR'
    I took a screenshot of the boxes and other gibberish to help explain, if necessary. The area this applies to is with the file loading (since I haven't copied the program yet to the correct area).

    Code:
    char LoadFile(const char FileName[64], char FileType, BITMAPINFOHEADER *BMPInfo, unsigned char *BMPData, char FogUsed, double ObjectScaling, char LoadType, unsigned int ArrayLength)
    {
    	char BasePath[192]; // the base path, that of which started from
    	char FullFileName[256]; // the full path combining the base path and the parameter
    	unsigned int ArrayIndex = 0;
    	float NewColor = 0;
    	unsigned char ValuesBase[4]; // for fixing endianness
    	float FogIntensity = (float)ObjectScaling;
    	float FogRange = (float)visibility;
    	
    	GetCurrentDirectory(MAX_PATH, BasePath);
    	// strcpy(BasePath, "C:\\My Documents\\My programs\\Interactive Animation\\"); // get the obvious base path first
    	sprintf(FullFileName, "&#37;s\\images\\%s", BasePath, FileName); // combine the base path and file name
    	FileHandle = fopen(FullFileName, "rb"); // read the source file to display, binary mode
    	
    	// FileHandle = fopen(FileName, "rb"); // read the source file to display, binary mode
    	
    	if (FileHandle == 0) // if the file can't be found
    	{
    		sprintf(WarningString, "Error:  This file cannot be found:\n%s\n\nIf this file isn't there, redownload the program and/or contact me.\nIf it is there or in a different directory, then you've found a bug.  Please report it.", FullFileName); // an error since the file can't be found
    		MessageBox(hwnd, WarningString, "File not found", MB_OK | MB_ICONHAND);
    		return 1; // indicates an error occurred
    	}
    Any ideas on what this may be? Why does it work fine with debug?
    Last edited by ulillillia; 05-01-2007 at 11:45 AM. Reason: UBBCode mistake

  14. #29
    Mad OnionKnight's Avatar
    Join Date
    Jan 2005
    Location
    Umeň, Sweden
    Posts
    555
    You seem to be compiling it in Unicode-mode so your ASCII-strings are being interpreted as UTF-16 by the Windows API. This is caused by having UNICODE and _UNICODE defined in the preprocessor, probably through compiler options so check those.
    Last edited by OnionKnight; 05-01-2007 at 11:55 AM.

  15. #30
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    According to this thread, it looks like your compiling release mode in unicode.

    In your project properties, make sure the configuration drop-down is set to "release" or "all configurations", select "general", and set the character set propery to either "not set" or "use multi-byte characer set".

    EDIT: sorry, just saw OnionKnight's post.
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

Page 2 of 4 FirstFirst 1234 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Totally confused on assigment using linked lists
    By Uchihanokonoha in forum C++ Programming
    Replies: 8
    Last Post: 01-05-2008, 03:49 PM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. Call a program & still capture cmds
    By Zuconta in forum C Programming
    Replies: 3
    Last Post: 07-23-2003, 03:54 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21