• Microsoft Visual C & C++'s Today Newest Questions & Articles Featured

    • Question about type conversion & casting
    • hello Here is a part of code to read a whole binary file into memory #include <fstream> . . BYTE *pData; long lDataLen; pms->GetPointer(&pData); lDataLen = pms->GetSize(); // Read one line at a time till end of file.. if (m_inFile.getline(pData, lDataLen))pms->SetActualDataLength(
    • mouse scroll event in J#
    • How to realize processing mouse scroll event in J#
    • inserting data to a file
    • hi,how can i insert data to the beginning of the file without overwriting. i am using the file management functions(createfile() etc..) for my applcation. Is there any direct function to do that?thanks shemna
    • Win Socket
    • Hey,In my program(server program), i open a file and send it over to a client program. In the server program, I read the file in multiples of 1028 bytes and call the send() function until the whole file is read. In the client program i recv() the data until the transfer is complete. ie, i send the f
    • WM_CLOSE problem
    • HiI have document/view application. I use CFormView. Now there i have CTabCtrl.Them in constructor of view i create 4 CDialog* linked with CTabCtrl. Now i want to cath the moment when user click cross icon in the up right corner. I do like this:afx_msg void OnClose(); ON_WM_CLOSE() void CMyView::OnC
    • about slider
    • Hi, In a window there is a slider. The slider can beoperated by -> and <-. Now i want to operate the slider only by number keys in the keyboard. For example, if i input the key '1', the slider will located in the first tip, '2' for second tip...How to do this? Would you pl
    • Getting the value of a dialog member var
    • Hi,I have a Bool member variable in a dialog (A). I need to access that var from another dialog (B). I made dialog A modeless, so i dont close it. Then i declared a pointer to A in B. I used GetDlgItem(IDD_A). With that pointer i can access the member var in A, but im getting an exception. It compil
    • how to change the pen in cstatic frame?
    • Hi, I have a CStatic frame created with flag SS_BLACKFRAME. I want to change the width of the line in that frame. I suppose I have to create a CPen object and use SelectObject on device context. I tried with code pen.CreatePen (0, 2, RGB (0, 0, 0)); CDC *dc = this->GetDC (); dc->SelectObje
    • Adding existing C file to C++/MFC project
    • Anyone ever try to add an existing C file to an existing C++/MFC project? When I do it, I getfatal error C1010: unexpected end of file while looking for precompiled header directiveOk, so I #include "stdafx.h" at the top. But then I get:fatal error C1853: 'Debug/GTest.pch' is not a precomp
    • List Boxes
    • Hi all. Can someone tell me how to get a text box's contents to be added to a list-box at the click of a button? And, how can the list box's contents be saved so that it is there when the user re-starts the program? Thankx
    • Help on this Question.
    • Lately I've found this question and I still didn't have any code for it.. anyone?Question 1: (List)Write a function called reverse that takes a null-terminated string s and returns null-terminated string that consists of s written backwards. For example, if s is ``foo'' then rev
    • Exception Handling for unknown types
    • Hi,I need to catch an exception. If I use the catch{...} I can't get any info/description about it. How do I get a description about an exception whose type is unknown?Do I have to catch all types one by one?
    • CString to WCHAR ?
    • Hi folks!Anyone's got an idea, how to get a WCHAR* (unsigned short I guess) out of a CString?TIASeb
    • I need help with my homework!
    • Hi all,Could somebody please help me with my home work?here is the questionhttp://www2.filehost.to/files/2006-10-16_03/214316_cplus.jpgThanks in advance :)
    • IStorage vs. IStream
    • Sorry for cross posting it, but more people could see it in this way.I have this code:IStorage * pStorage = NULL;hr = StgCreateDocfile(L"tmp.html",STGM_CREATE | STGM_READWRITE | STGM_DIRECT| STGM_SHARE_EXCLUSIVE,0,&pStorage);if (FAILED(hr)) return S_FALSE;IStream * pStream = NULL;hr = pStorage-&
    • For some reason when I am in developers studio it ...
    • For some reason when I am in developers studio it no longer prints the tool tips on its buttons. I don't know how they got turned off. I have gone to Tools/Options/Toolbars and tried clicking the 'Show tooltips' checkbox on and off but it doesn't do anything. Any suggestions?Than
    • ActiveX-Control
    • Hi, I develop a control that has an editbox who loads and save the users input as textfile. Thats all Ok but, when I use it in an html-site I can't use the cursor-keys to scroll in the editbox. I hope someone can help me!Thanks - Anton from Austria!
    • Who could recommend me an article about class CListView?
    • Hello all: I want to know well the class CListView in detail, such as style,extended style,and message,and so on, Who could recommend me an article about class CListView? Thank you very much.
    • Is there a way to make another dlg return OK
    • I need to make the dlg of another app return OK.. is there a way to programatically do this??Thanks in advance for any help...-Cube
    • sdi - changing text in the title bar
    • Hi allI work on an SDI application (new to me)At some point I need to change the text of the title by using SetWindowTextBut...it writes the new text to the document itself.. not the title.. any help would be highly appreciated !
    • I know this is not really about programming..but..
    • Well, i know this not really about program, it is maths..pls take a look at : http://www.cairo.utm.my/ksyap/puzzle.htmlcan anyone take a look and try to give some reasonable why?Hello World!!!
    • ISAPI samples
    • Good day;I'm looking for good examples of ISAPI extension working with asynchronousread/write and/or examples of multithreaded ISAPI extension.Link in MSDN is saying:"These projects are available in the ...\isapi\extensions\io subdirectory of the IIS samples directory" But it's no such a d
    • Problem in COM object calling, it stucks the WINWORD object.
    • Hi, I am expressing a strange problem when I call Close method of WordEditor. It closes the open email and MS Word blank window stays there and sudden windows error message appear that says "Send Error" button and has checkbox to reopen the word. I tried to diagnose this problem and this scenari
    • Invoke VBA functions
    • I would like to invoke VBA functions hosted in MS Access (MDE) from a VC++ 6MFC application. Is it possible? If so, how should I go about it? If not,what are my alternatives?
    • Sleep(0) ?
    • Hello there. I was wondering if my app has some count of threads, and every one of them can consume many CPU usage, how to leave the system responsive. I thought this happens via "SwitchToThread();" but some people told me that "Sleep(0);" is used in such a cases... Which is more precise? Sleep(
    • Handling unicode
    • Hi, everybodyA while ago I was preparing myself to work with UNICODE string andwrote some dialog based test program. It work fine, I'm reading intoedit control UNICODE strings from the files, can key in foreigncharacters into the edit controls properly. Now I'm trying to addthis UNICOD
    • Automating IE
    • Hi,I wonder if anyone can help me understand how some tollbars from IE are able to fill some fields in a wab page and submit data automatically. I want my application to be able to keep some info from a page and login automatically when I press a "Go" button. It's ok with a new instance of IE o
    • Helphow to get the bitmap pixel value & make change of the value n save.
    • i need help for u all!i need to load a bitmap file (i have done this) and get the pixel value of the bitmap file so i can make some changes on the pixel value, i need to change the value by some equation. after all i need to save the bitmap file to a new bitmap file!my problem is :1)how to get the p
    • User Interface Thread
    • Hi,How do I stop a user interface thread correctly?Thanks
    • debugger exception
    • TIA for any help with this problem...About 3-4 months ago, I began having trouble debugging an applicationto which I was adding new functionality. For no *apparent* reason, myapp kept crashing (in debug mode only) with the message "userbreakpoint" in ntdll.dll and I remember some message regardi
    • »» Read More about "Microsoft Visual C & C++"...