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
N

norish

@norish
About
Posts
93
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Reusing an Incremented Variable within a Single Statement
    N norish

    This would be;

    int i = 1;
    i = i + 1;
    int j = i + i;

    :)

    C / C++ / MFC c++ tutorial question lounge

  • Trouble with VirtualAlloc
    N norish

    VirtualAlloc never allocate over 2GB in 32bit windows without /3GB option. In some ordinary OS settings situation, VirtualAlloc usually returns under 1.5GB space for user land memory. And AWE is for use of physical memory over physical 2GB boundary with /pae boot option. If you want continuous virtual memory space over 2GB, you must use 64bit windows. With /pae boot option, msdn document says VirtualAlloc can use over 4GB physical memory, but it would not so ordinary 32bit windows especially xp. Because microsoft dose not support over 4GB physical memory on 32bit xp.

    C / C++ / MFC c++ question visual-studio com debugging

  • onlick event of command button is not called
    N norish

    Assign unique value for duplicated id, simply. You should assign all unique (different) id for different controls. Only one handler will be called for one id value on MFC message mapping. Because MFC's message mapping is very simple implement which using array of struct, and decide handler by sequential searching. When message map is as below;

    BEGIN_MESSAGE_MAP(CSampleDlg, CDialog)
    //{{AFX_MSG_MAP(CSampleDlg)
    ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
    ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
    //}}AFX_MSG_MAP
    END_MESSAGE_MAP()

    Compiler recognize as below; (rewriting simply)

    struct MessageEntry messageEntries[] = {
    { IDC_BUTTON1, OnButton1 },
    { IDC_BUTTON2, OnButton2 }
    };

    If IDC_BUTTON1 and IDC_BUTTON2 are equal, the sequential searching algorithm always find OnButton1 for IDC_BUTTON{1,2}.

    C / C++ / MFC help question learning

  • Problem with doublebyte chars in Japanese
    N norish

    I dont understand your problem point yet. Will you explain the point for short again? :confused:

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

  • How to get physical memory size available to a process?
    N norish

    Default implementation of new of vc is malloc and malloc calls VirtualAlloc. I checked how much memory's can be allocated on my pc with XP SP3. Available Phys. Memory: 1.7GB (from task manager) Available Virtual Memory: 2.0GB (from GlobalMemoryStatusEx) My program allocated: 1.5GB (by VirtualAlloc or malloc) My program's Total Virtual Size: 1.5GB (from task manager) In general, total virtual memory space 2GB is sum of program own code size, some resources and other crt dll space size. So in this case, my program's size without heap should be around 500MB. (I think this strange.) I guess some other programs (like a anti virus program or so) or some Windows settings affected to this situation.

    C / C++ / MFC help visual-studio com sales performance

  • How to get physical memory size available to a process?
    N norish

    Which API did you call to allocate memory?

    C / C++ / MFC help visual-studio com sales performance

  • How to declare a three dimensional array
    N norish

    A sample;

    int array[3][4][5] = {
    { //[0][][]
    { 1, 2, 3, 4, 5 },//[0][1][]
    { 1, 2, 3, 4, 5 },//[0][2][]
    { 1, 2, 3, 4, 5 },//[0][3][]
    { 1, 2, 3, 4, 5 } //[0][4][]
    },
    { //[1][][]
    { 1, 2, 3, 4, 5 },//[1][1][]
    { 1, 2, 3, 4, 5 },//[1][2][]
    { 1, 2, 3, 4, 5 },//[1][3][]
    { 1, 2, 3, 4, 5 } //[1][4][]
    },
    { //[2][][]
    { 1, 2, 3, 4, 5 },//[2][1][]
    { 1, 2, 3, 4, 5 },//[2][2][]
    { 1, 2, 3, 4, 5 },//[2][3][]
    { 1, 2, 3, 4, 5 } //[2][4][]
    }
    };

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

  • C - DLL Export
    N norish

    This is just the solution for original question, I think. :)

    C / C++ / MFC csharp help

  • C - DLL Export
    N norish

    What compiler do you use in your IDE environment? I think __declspec(dllexport) is only for MS compiler, not for gcc.

    C / C++ / MFC csharp help

  • How to create Multiple instance of Simple Windows Services? [modified]
    N norish

    You can make the manager service which spawn multiple instance of some program. If you mean multiple processes by multiple, the manger service is like below;

    // define some structure for managing status.
    struct MyProcInfo {
    BOOL m_spawnSucceeded;
    PROCESS_INFORMATION m_processInfo;
    } m_myProcInfo[N];

    ...
    // execute and hold handles
    for (int j = 0; j < N; j++) {
    m_myProcInfo[j].m_spawnSucceeded = CreateProcess(SOME_PROGRAM, argsForIt, ...., &m_myProcInfo[j].m_processInfo);
    }

    Or if you do not mean multiple processes but multiple COM instances, you can easily write like that service with ATL COM AppWizard wizard in visual studio.

    C / C++ / MFC tutorial question

  • Find file is copying? [modified]
    N norish

    Why do you want to know that? What for?

    C / C++ / MFC question

  • Elliminate the e symbol from doubles
    N norish

    One solution is using Multiple Precision Number library like http://gmplib.org/[^]

    C / C++ / MFC

  • Getting addresses...setjmp/longjmp
    N norish

    Thanks your pointing out. That was a Java style coding. In c++, ordinarily;

    throw TException("func1");

    catch(TException& e) {
    }

    And I know void main is not compatible in c++. That was only concept codes, but may not be so good example.

    C / C++ / MFC question json help

  • Getting addresses...setjmp/longjmp
    N norish

    Why don't you use c++ exception semantics? It might be as below.

    struct TException;

    void func1()
    {
    cout<<"abc";
    throw new TException("func1");
    }
    void func2()
    {
    cout<<"def";
    }
    void main()
    {
    try {
    func1();
    }
    catch (TException* e) {
    e->printSomthing();
    delete e;
    }
    catch(...) {
    cerr<<"general exception which I dont know"<

    C / C++ / MFC question json help

  • get the process' path by its pid
    N norish

    One question.

    DWORD dwPIDLst[1024];

    nPIDNum = dwBytesWritten / sizeof( DWORD );

    Was it ok? In other words, nPIDNum is under 1024?

    C / C++ / MFC algorithms data-structures help question workspace

  • Change Event of excel
    N norish

    You must watch every time its file changing if you want know. I don't know the general watching process for the reason. So, you can write some code which reads the file and sense difference of it by yourself.

    C / C++ / MFC

  • Release IGraphBuilder interface in directshow problem
    N norish

    > why it is happened . Os is very different. It is just a reason. Generally, many program which can run on xp will not be able to run on vista because of incompatibility between xp and vista. The most incompatibility of os is around security. Check the API's document you used, and you might find some clue of them; incompatibilities.

    C / C++ / MFC c++ com help announcement

  • open txt file form web or ftp ?
    N norish

    I can say one of old style of coding (not a .net style, I'm saying) with WinInet. The primary usage is thus; <pre> HINTERNET hInet = InternetOpen("MyLocalAgent", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); HINTERNET hFile = InternetOpenUrl(hInet, "http://king.ath.cx/server.txt", NULL, 0, 0); BYTE buffer[BUFSIZE]; DWORD dwRead; while (InternetReadFile(hFile, buffer, BUFSIZE, &dwRead)) { if (0 == dwRead) break; fwrite(buffer, 1, dwRead, stdout); } InternetCloseHandle(hFile); InternetCloseHandle(hInet); </pre>

    C / C++ / MFC question sysadmin help

  • About loadlibrary problem. [modified]
    N norish

    Check the calling convention of those exported functions. The default calling convention is __cdecl but some API function requires __stdcall.

    C / C++ / MFC help debugging

  • WritePrivateProfileString to write Ini file problem
    N norish

    Try WritePrivateProfileString(NULL, NULL, NULL, L"inifile.ini")

    C / C++ / MFC help question announcement
  • Login

  • Don't have an account? Register

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