Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
F

fefe wyx

@fefe wyx
About
Posts
30
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • XP Screensaver and VS2008
    F fefe wyx

    "method" is a function pointer. You should cast it to a function pointer type that is the same as ChangeWindowMessageFilter. Then, instead of calling ChangeWindowMessageFilter(...), call method(...).

    C / C++ / MFC c++ html com security help

  • XP Screensaver and VS2008
    F fefe wyx

    I think you need to use LoadLibrary to load "user32.dll" and user GetProcAddress to get the function ChangeWindowMessageFilter.

    C / C++ / MFC c++ html com security help

  • Virtual Constructor
    F fefe wyx

    Well ... What do you think you can do with a virtual constructor?

    C / C++ / MFC question

  • Better error checking using sscanf
    F fefe wyx

    You can set a property of the TextBox, allowing only the input of float numbers. Then users can't input letters into the TextBox. Sorry I can't provide the details right now. Or if you are only dealing with float numbers, maybe atof() will help. It will reject any input that is not a valid float.

    C / C++ / MFC help question tutorial

  • Redirection in command line "<"
    F fefe wyx

    Note that stdin and stdout are also file handles. When no redirection occurs, stdin is the keyboard and stdout is the monitor. In the form of program1.exe > out.txt, stdout is assigned with a file handle to the file out.txt, instead of the monitor. So all the output goes into out.txt instead of the monitor. In the form of program1.exe < in.txt, stdin is assigned with a file handle to the file in.txt, instead of the keyboard. So whenever you read from stdin, e.g. when you call the scanf() function, the data come form in.txt, not the keyboard. Redirecting is handled by the OS, not by the program, so the program itself will know nothing about the redirection, and redirection directives would be passed to program as parameters. Thus argc in main is 1, not 3.

    C / C++ / MFC c++ question

  • Call constructor
    F fefe wyx

    No, you can't do that. It will just create a temporary object, but not calling the other constructor on the same object. You can write your initialization code in a separate function, and call the initialization function from each constructor.

    C / C++ / MFC question

  • Convert char string to UTF-8
    F fefe wyx

    First use MultiByteToWideChar() to convert the char string from your local code page to wide char, then use WideCharToMultiByte() to convert the wide char string to UTF8. You may use CP_ACP for your local code page, and code page for utf-8 is 1200. But I've never tried the conversion between wide char and utf-8, so I'm not sure whether it would succeed.

    C / C++ / MFC question

  • String of integers
    F fefe wyx

    The last element of aArray if aArray[3], but not aArray[4]. And what do you mean by:

    Herboren wrote:

    for ( n=0; n<0; n++ )

    C / C++ / MFC data-structures c++ help

  • Library file redefinition error
    F fefe wyx

    Well, in that case you may have to recompile the libraries. You may either change the structure names, or put the libraries in different namespaces.

    C / C++ / MFC help question

  • Upper limit of rand() function
    F fefe wyx

    There's not such a function.

    C / C++ / MFC tutorial question lounge

  • Small question
    F fefe wyx

    If you can access the Internet, you can go to http://msdn.microsoft.com

    C / C++ / MFC question help tutorial

  • Setting multile line text in a document
    F fefe wyx

    You can use SetWindowText. Also you can use ReplaceSel to insert text in the current cursor position if nothing is selected.

    C / C++ / MFC question

  • !declared to have 'C' linkage
    F fefe wyx

    Do you by any chance introduced such code in you project: extern "C" { //... #include "SOMEHEADER.h" //... } where SOMEHEADER may be wspiapi.h or any header file that may use wspiapi.h.

    C / C++ / MFC help csharp visual-studio wpf

  • Copy Constuctor
    F fefe wyx

    The parent constructor is called at the beginning of the initialization, but not necessarily the copy constructor. For a default copy constructor, of course the copy constructor of the base would be called. But if the copy constructor is provided in the derived class explicitly, it can be chosen that which one of the base class's constructor is to be called.

    C / C++ / MFC java question

  • Implicit constructors
    F fefe wyx

    Constant members must be initialized, and reference members bound, *explicitly* in the member initializing list of the constructor. And the behavior of the default copy constructor is to perform a memberwise copy to its sub-objects, which would become impossible is any of the sub-objects have an inaccessible copy constructor.

    C / C++ / MFC question

  • Text file got encoded in UTF16. (VC2005)
    F fefe wyx

    I'm using Visual Studio Express. I tried to output some data into a text file, I found that the file is encoded in UTF16. The wired part is that non-ASCII characters are in MultiByte encoding (all of them takes two bytes), but the ASCII ones got in UTF16 (which also takes two bytes), and the whole file has a UTF16 BOM. The file is opened with fopen, and written with fprintf. My strings in my program all all unicode strings, so I had to write like this: fprintf(" "); fprintf("%ls", L"UNICODE STRING"); There is some non-ASCII characters in my unicode strings. I used wide-char version functions in my program explictly, except for file operations (I didn't use wfprintf or wfopen). The charset for the project is set to "No set", and neither UNICODE nor MBCS is defined. I have set the locale at the begin of main. And I want to get a MultiByte file, how can get it? Thanks in advance.

    C / C++ / MFC csharp visual-studio question announcement

  • get txt file size
    F fefe wyx

    You may use fseek() to go the end of the file, and use ftell() to get file current position, which is now also the file size.

    C / C++ / MFC question

  • FindFirstFile returning wildcards?
    F fefe wyx

    skullfire wrote:

    I have to prefix this "\\?\" to the path right?

    No. You do not have to add the prefix. Just go to your project settings and change your project to using UNICODE. And you have to change all string constants in your program to wide char strings, i.e., "*.*" should be replaced with L"*.*", unless you are using the TEXT macro like:

    skullfire wrote:

    if (strPattern.Right(1) != TEXT("\\") )

    C / C++ / MFC question help

  • How to set the backcolor of MS Excel cells
    F fefe wyx

    Here's a code segment written in VB

        With Selection.Interior
            .ColorIndex = 3  ' this is red ...
            .Pattern = xlSolid
        End With
    

    I think it it easy to know how to do it in VC from that. By the way, there is a way to know how to get some work accomplished in your codes: just open Excel, and record a macro doing just the same thing, then you can check the code in Excel's Macro editor. I got that piece of code in this way.

    C / C++ / MFC tutorial question

  • standard Include Directories in Vc++ VS2005
    F fefe wyx

    The Include path can be check or set in Tools->Options , Projects and Solutions->VC++ Directories

    C / C++ / MFC c++ visual-studio
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups