CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
  1. #16
    Join Date
    Aug 2003
    Posts
    30
    Originally posted by Sam Hobbs
    This does sound strange. I am not aware of any problems and since you say you compiled the generated application as it existed when generated, it sure should work.

    If the files you are working with are small and do not have anything you can't share then try attaching a sample of the files to a reply so we can see what the data looks like.
    Sure. Here is the little text file I was using to test my code. It was created with notepad.

    For what it's worth, I tried on another Windows XP computer to see if that wasn't due to my computer being hosed, and it exhibits the very same symptoms. Also, I tried using the MDI framework instead of the SDI framework and it's still the same.

    Thanks,
    Maxime
    Attached Files Attached Files

  2. #17
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    You are correct, that is a plain (non-Unicode) text file. So the next thing you can do if you want is to post the project.

    The best way to do that is to zip the project. If you want to include the exe file then that would be good but we don't need anything else from the Debug and/or Release directories. It would help to have the contents of the Res directory but that is not important. You can also omit the following file extensions: aps, ncb, opt and plg, although their sizes are relatively small.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  3. #18
    Join Date
    Aug 2003
    Posts
    30
    Originally posted by Sam Hobbs
    You are correct, that is a plain (non-Unicode) text file. So the next thing you can do if you want is to post the project.

    The best way to do that is to zip the project. If you want to include the exe file then that would be good but we don't need anything else from the Debug and/or Release directories. It would help to have the contents of the Res directory but that is not important. You can also omit the following file extensions: aps, ncb, opt and plg, although their sizes are relatively small.
    Ok, I think everything you asked for is in this zip file. I hope I didn't omit anything important nor put unneeded files :-).

    Thanks,
    Maxime
    Attached Files Attached Files

  4. #19
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    I had to do some things to get it to compile using VC 6 but when I did compile it the program works; that is, it can open the test.txt file and it looks normal. I was unable to execute the exe though since it is a debug version of a program compiled using VC 7. It it were a release version I would be able to execute it.

    Also you did good in creating the zip file except the res directory was not included. I was able to create one easy enough and I know you are just beginning with this stuff so I just wanted to let you know that what you did is good except if you do this in the future you can try to include the res file also.

    So I don't know what to say. Perhaps there is a problem with VC 7. Probably the good news is that it is not likely to be a problem with what you are doing.

    What happens when you open other text files? Is there a problem if you open a cpp file or a h file? What happens when you create a file using your simpleedit; can you later open it? Can you open the saved file using notepad?
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  5. #20
    Join Date
    Aug 2003
    Posts
    30
    Originally posted by Sam Hobbs
    I had to do some things to get it to compile using VC 6 but when I did compile it the program works; that is, it can open the test.txt file and it looks normal. I was unable to execute the exe though since it is a debug version of a program compiled using VC 7. It it were a release version I would be able to execute it.

    Also you did good in creating the zip file except the res directory was not included. I was able to create one easy enough and I know you are just beginning with this stuff so I just wanted to let you know that what you did is good except if you do this in the future you can try to include the res file also.

    So I don't know what to say. Perhaps there is a problem with VC 7. Probably the good news is that it is not likely to be a problem with what you are doing.

    What happens when you open other text files? Is there a problem if you open a cpp file or a h file? What happens when you create a file using your simpleedit; can you later open it? Can you open the saved file using notepad?
    Thanks for taking a look at this code! I'll be sure to include the res directory next time :-).

    SimpleEdit exhibits the exact same symptoms when I open other text files, header files, cpp files, etc.... When I create and save a file with SimpleEdit and open it with the notepad afterwards, I can only see the first character of the file.

    I'm going to search the web to see if I find any reports of such problems with VC++ 7. Do you need me to attach a release version of the executable here?

    Thanks,
    Maxime

  6. #21
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    You can provide a release version if you want me to try executing it using my system but I can only tell you whether it works the same as it does on your system(s).
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  7. #22
    Join Date
    Aug 2003
    Posts
    30
    [QUOTE]Originally posted by Sam Hobbs
    You can provide a release version if you want me to try executing it using my system but I can only tell you whether it works the same as it does on your system(s). [/QUOTE

    I guess that's still a valuable information. Here is a release version of the executable.

    Thanks,
    Maxime
    Attached Files Attached Files

  8. #23
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556
    Since the same code works correctly with Sam's VC++ version 6, but fails with mux's version 7, I'll hazard a guess: mux might be compiling with UNICODE defined.

    I don't know how to check this in version 7 since I also use version 6. Typically you would look under project settings, or maybe at the top of your stdafx.h file.

    Sorry that this is a guess, and that I'm hazy on where to check if UNIDODE is defined. Maybe Sam will tell us that he compiled with UNICODE defined and that it works fine, in which case you can all justifiably deride me for being a silly speculator

    Mike

  9. #24
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    I don't have mfc70.dll but I was going to see if I could get it from somewhere. Probably I can.

    I considered the possibility that Unicode is defined so I searched the files for the VC 7 project and did not find "Unicode" so I assume that is not the problem. When I execute Maxime's compiled exe I shoudl be able to easily determine if it is using Unicode.

    If anyone has mfc70.dll and was able to execute the program then you can let us know what happens.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  10. #25
    Join Date
    Aug 2003
    Posts
    30
    Originally posted by Sam Hobbs
    I don't have mfc70.dll but I was going to see if I could get it from somewhere. Probably I can.

    I considered the possibility that Unicode is defined so I searched the files for the VC 7 project and did not find "Unicode" so I assume that is not the problem. When I execute Maxime's compiled exe I shoudl be able to easily determine if it is using Unicode.

    If anyone has mfc70.dll and was able to execute the program then you can let us know what happens.
    What I know for sure is that I didn't define UNICODE myself, so if it is defined, it has been done by the project wizard. I don't see UNICODE defined in stdafx.h either, but maybe it lies elsewhere?

    I tried to attach my mfc70.dll file after zipping it, but it exceeds the maximum size allowed by the forum.

    Thanks,
    Maxime

  11. #26
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    If Unicode is specified for a VC 7 project the same way as for a VC 6 project then it is done in the project settings.

    If you want to try something you could try creating a static release build instead of a dynamic release build. Then MFC70.dll would not be needed. The problem is that then the exe might be too big to fit as an attachment here but probably not.

    To do a static release build change the project settings to specify use of MFC in a static library instead of a shared DLL.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  12. #27
    Join Date
    Aug 2003
    Posts
    30
    Originally posted by Sam Hobbs
    If Unicode is specified for a VC 7 project the same way as for a VC 6 project then it is done in the project settings.

    If you want to try something you could try creating a static release build instead of a dynamic release build. Then MFC70.dll would not be needed. The problem is that then the exe might be too big to fit as an attachment here but probably not.

    To do a static release build change the project settings to specify use of MFC in a static library instead of a shared DLL.
    I found a setting for the character set in the project properties. It was set to multi-byte character strings. Setting it to unicode produces different garbage when opening a file, but it's still garbage :-). Setting it to "Not set" doesn't change anything.

    I wanted to attach a static release build to this post, but the file is too big for the forum.

    Thanks,
    Maxime

  13. #28
    Join Date
    Apr 2004
    Posts
    4
    The problem you are seeing is to do with visual styles.

    A quick google search found this explanation:

    http://tinyurl.com/ywnvz

    I am still looking for a solution...

    Anthony Wieser
    Wieser Software Ltd

  14. #29
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    I think you misunderstood what I meant by specifying Unicode in the project settings. I might have forgotten what it is I meant, but I am nearly certain I meant that your application (project) should be built for Unicode. Note that I said project settings.

    I think you are setting the Options, not the project settings, when you set the character set. Unless VC 7 is different, there is not a setting for a font (character set) for a project. Are you sure it is a project setting you changed? If not, then it sure won't have any affect on your program, except possibly enabling you to see the data correctly using the editor (Visual Studio).
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  15. #30
    Join Date
    Apr 2004
    Posts
    4
    The problem I see occurs in an ANSI build. It works if you don't have a manifest attached to the program, and doesn't if you do.

    I am building with VC6.

    Anthony Wieser
    Wieser Software Ltd

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured