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
P

Peak

@Peak
About
Posts
16
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Which is the simplest way to close an application?
    P Peak

    if you know the title of that window, use this: LPSTR name="the_window_title"; HWND hWnd = ::FindWindow(NULL,name); ::SendMessage(hWnd, WM_CLOSE, 0, 0);

    C / C++ / MFC question

  • Keep console from disappearing
    P Peak

    ::WinExec ("cmd.exe /c tracert X.X.X.X & pause", SW_SHOWNORMAL/* not SHOW_NORMAL ;) */); on win95/98/me I think you need to use command.com instead of cmd.exe

    C / C++ / MFC question

  • How to send data to ethernet if Mac Address is known
    P Peak

    you mean you have the MAC address of destination machine? or you have multiple ethernet cards on your machine and want to use the one that maches that MAC address? if your answer is the destination machine: you have to use WinPcap(http://winpcap.polito.it/) also take a look at here: http://www.csee.usf.edu/~christen/tools/rawstuff.zip but be carefull. you are going too low-level... ;)

    C / C++ / MFC tutorial

  • atoi and cstring
    P Peak

    atoi starts translation first by removing seperator characters(like space) from the string, looking for the first character. if it is a digit, it starts translating it into an integer, but if not, it returns zero. you can use it like this: LPSTR ss="4 cars"; int x=atoi(ss); if(x==0 && strcmp(ss,"0")){ // the input is probably not a real zero, // it's an error }

    C / C++ / MFC help tutorial question

  • How to call interrupt function
    P Peak

    if you are using windows 98 or 95 you can call interrupts, but on xp & 2k no way there from user mode applications! that function IoConnectInterrupt is for device drivers, and does not do what you need. anyway, you can use some device drivers like ntport to have direct access to ports, then you can use direct port access and so you can read CMOS. ( so no need to use the interrupt, but you have to know how to read CMOS using in/out OPs) anyway it's a long way. if you have any other alternatives, I recommend you to review them, maybe you are going the hard way...

    C / C++ / MFC tutorial question

  • How to get the full path-name of 'My documents' in different OS?
    P Peak

    use SHGetSpecialFolderPath

    C / C++ / MFC tutorial c++ json question

  • How to set the original size of a window?
    P Peak

    you can enumerate resources of the executable containing that dialog box if the window is a dialog which is created from resources. take a look at this API documentation : EnumResourceNames() but to identify which resource corresponds to that window you need to compare window names, or if the name is modified, you need to compare its contents. but about a simple API that does the job, at least I haven't heard of.

    C / C++ / MFC tutorial question learning

  • argv argc and buffer over-run HACK
    P Peak

    any Windows application uses GetCommandLine() API to receive a pointer to its command line arguments, or uses a parameter which is passed to its WinMain function that points to the program command line. After that,if you have a main function, C Run-Time Libraries (CRT) formats the arguments, seperates them, and counts them and then sends them to your main function using argv and argc. if you use MFC, it has some wrappers around this command line(but you can use __argc & __argv which are globally defined),anyway the WinApp::m_lpCmdLine contains the raw command line. Up to here no stack overflow or other flaws exist. now it depends on your code to how to deal with these arguments. if you do something like: char myparams[100]; strcpy(myparams, AfxGetApp()->m_lpCmdLine); or even: printf(AfxGetApp()->m_lpCmdLine); then you have to review your old codes. ;)

    C / C++ / MFC data-structures help tutorial question learning

  • Systray
    P Peak

    you need to start your MFC modal dialog program with a hidden dialog, and the only way I found for this problem was to call ShowWindow(m_hWnd, SW_HIDE) in one of WM_NCPAINT or WM_PAINT message handlers. There is another way for this problem, but needs a little more modification of your program. The normal way would be to uncheck WS_VISIBLE style in resource editor, and start you dialog using CreateDialog , then make a message loop there by calling AfxPumpMessage in a loop like this: CMyDlg mydlg; mydlg.Create(IDD_MYDIALOG);// that IDD_MYDIALOG is // the dialog resource id, // you can find it in your // dialog class definition // (TrayIco.h as you said) // in a line like this: // enum { IDD = IDD_MYDIALOG }; // if you wanted to show dialog window // ShowWindow(m_hWnd, SW_SHOW); while(AfxPumpMessage()); // loop till the QUIT // message comes.

    C / C++ / MFC question c++ learning

  • How to call interrupt function
    P Peak

    the programs you run are in User Mode( ring-3 applications, you can read more about this in intel processors specifications). They cannot run INT commands( and many others, they are called priviledged op codes, see the reference above). And if anyway you could do it (I mean if you write a device driver and call the above INT command), many INTs don't have the functionality you have seen before in old days of real-mode OSs like DOS.

    C / C++ / MFC tutorial question

  • About socket input queue.
    P Peak

    hi you can use ioctlsocket function to find out how much data is available to read.

    C / C++ / MFC data-structures tutorial question

  • regsvr32 failed
    P Peak

    hi have you traced the program execution? does it get to the pFunc() calling? does it come out of that call back to your program?

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

  • Dialog Windows Hidden Problem :: MFC
    P Peak

    Hi maybe you just have to overried OnOK() and OnCancel() of that dialog box classes. cause when you press ENTER OnOK() will be called and the window destroys itself. the same thing happens for ESC and OnCancel()

    C / C++ / MFC c++ hardware help question learning

  • "DestroyWindow" ---- Error!!!!
    P Peak

    hi are you trying to destroy a window in that window's class deconstructor? I think when deconstructor is called, the window is already destroyed, so no message can be sent to it,like WM_DESTROY( which invokes OnDestroy).

    C / C++ / MFC help question

  • regsvr32 failed
    P Peak

    hi have you tried this? nRetCode = WinExec("RegSvr32 /u \"C:\\Program Files\\RealTime7\\QueryGenAlpha\\QueryGenAlpha.dll\"", SW_SHOW);

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

  • entry question, thanks
    P Peak

    hi maybe you havn't called TranslateMessage in your message loop. you know what's message loop, yes? any way this is a simple message loop: while(GetMessage(...)) { TranslateMessage(...); DispatchMessage(...); } hope it helps:)

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

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