Answer Questions
DreamState converting address to string
How can I veiw the address of a location, that is to say how can I convert an adress to a string or some other type Given: int i(99), *pi=&i; You can output the address directly using: std::cout << i << ' ' << pi << '\n'; Or you can convert to a string using ostringstream as in: std::ostringstream ss; ss << pi; std::cout << ss.str() << '\n'; Another way to convert to a string is _ultoa or _ultoa_s, but this does not provide leading zeros: char Buffer[16]; _ultoa(reinterpret_cast(pi), Buffer, 16); std::cout << Buffer << '\n'; thank you for taking the time to anwer my question, but when I try to make a ostringstream ...Show All
cmazur Keep Visual studio 2003 from crashing when trying to load symbols from vista.
Ok, i recently came accross the following issue. My work has not switched to vs2k5 yet, but i needed to do some debugging on vista. Except that every time i forgot to remove the symbols server path from my symbols directory(same thing would happen if you had vista symbols installed locally too) my ide would crash when it attempted to load up the symbols. The cause There was an operation being done something to the effect of this. foo(int iIndex) { if( iIndex < 16 ) g_ErrorTable[iIndex]; } .. why is this bad well because the ide was accessing invalid memory when the iIndex was a large negative number. The fix this one is pretty easy. goto your vs program files directory, common7\packages\debugger, and copy ...Show All
Tilfried Weissenberger Creating a DLL - Translation between 2 DLL's
Hi, I'm not particularly experienced with C/C++ but I have a problem: I currently have an application, which uses lame_enc.dll to encode audio into MP3 files. There is another encoder available as gogo.dll which uses ASM hand-optimised routines, and is therefore much faster. Without modifying my application, I want to create a new lame_enc.dll file which will simply pass data onto gogo.dll, and translate any settings required. Therefore giving the option to add a much faster encoding engine into my application. The manual for gogo.dll is here http://homepage1.nifty.com/herumi/soft/gogo2/man/ (no source code is provided) lame_enc.dll manual is available here: http://www.fi.muni.cz/~qruzicka/Smid/man.htm Source for lame ...Show All
pst_grant modal dialog box not closing quickly enough
Hi. I have a single threaded MDI application with several windows that are concurrently open and displayed during normal operation. I need to print the contents of a user-selected window. Per end-user request I display a CDialog based modal dialog box that allows the user to select the window he wants to print and then click on the OK button. I have code that then takes a bitmap snapshot of the requested window and prints it to the printer(from KB article q186736). So far so good, but if the dialog box overlaps the window that the user wants to print, the overlapping part of the dialog box is also printed. This doesn't make sense to me - the dialog should completely go away as I understand it. FWIW here's a code snippet: ...Show All
herbfl strange error :-S
BITMAP HdcToBitmap(HDC hdcNeedle, int needleWidth, int needleHeight) { HDC memDC_Needle = CreateCompatibleDC(hdcNeedle); HBITMAP memBM_Needle = CreateCompatibleBitmap(hdcNeedle, needleWidth, needleHeight); SelectObject(memDC_Needle, memBM_Needle); BitBlt(memDC_Needle, 0, 0, needleWidth, needleHeight, hdcNeedle, 0, 0, SRCCOPY); BITMAP bmpNeedle; GetObject(memBM_Needle, sizeof(BITMAP), &bmpNeedle); return bmpNeedle; } i have a windows form application woops it's a HBITMAP i want to return HBITMAP HdcToBitmap(HDC hdcNeedle, int needleWidth, int needleHeight) { HDC memDC_Needle = CreateCompatibleDC(hdcNeedle); HBITMAP memBM_Needle = CreateCompatibleBitmap(hdcNeedle, needleWidth, needleHeight); SelectObject(memDC_Needle, m ...Show All
Miguel Carvajal not add an .obj file to my project
Ih, i got this error " LINK : fatal error LNK1104: cannot open file "odbccp32.obj" compiling a code. As you can see in google, there is no solution aparently. In the same way that i delete lib files, how can i not add this file to my project Anyone who uses VS 6.0 I think it's in projects -> add to project -> files It doesnt work. bump! this problem has no answer, and its the only related article on google so i guess its worth the bump. You go to project/settings menu (you can also use alt+f7 hotkey) click in the link tab Make sure everything is spelt correctly on "object/library modules& ...Show All
Volksman How to pass xml file as input???
Hi, I want to pass Xml file input to FlashPlayer 7 and after getting the file input it should be passed to the Xml parser file(xmlparser.cpp and .h) in the Player.I cannot use CFiledialog because it will create another dialog. Help me by giving your suggestions. Thanks in advance. Siddharth Hello Re: How to pass xml file as input Such questions are outside the scope of this forum - for the scope of the Visual C++ Language forum please look at: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=789657&SiteID=1 I suggest you to find a free discuss group available online to handle such questions. OTP ...Show All
bvanderw Run time error in very simple matrix code
Hi, this gives a run time error, so it doesnt print anything.. why #include "stdafx.h" #include "stdio.h" void prueba (int a[]) { a[0]=1; a[1]=2; a[2]=3; a[3]=4; } void main(int argc, char* argv[]) { int i=0; int b[4]; prueba(b); printf("%f\n", b ); } when i execute it, it shows a window with this message: Microsoft Visual C++ Debug Library Debug error! Program: ...what ever.exe run time error (Press Retry to debug the application) I press Retry and it shows: what ever.exe has detected a problem and must close. a few more Error in Code. First thing in your Function your Should Send The no of Element of your array also.because array bound checking didn ...Show All
grumsterUK 'type cast' : cannot convert from 'System::IntPtr' to 'PDEV_BROADCAST_HDR'
Statement void ProcMsg::getMessage(Message *m, Boolean Inserted) { PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR)m->LParam; } above statement was came out with error 'type cast' : cannot convert from 'System::IntPtr' to 'PDEV_BROADCAST_HDR' Question: May i know how to cast the structure PDEV_BROADCAST_HDR to System::IntPtr. Information provided is not enough to answer this question. Could you tells us if this application is a mixed mode (being compiled with /Clr). How have you defined Message class\struct. In Message have you deined LParam as IntPtr or LPARAM If you are using mix mode application i.e (compiling with /Clr) and LParam is defined as IntPtr you should use System::Runtime::InteropSe ...Show All
criquety list of default libraries being pulled in
Is there a way to get a list of the .lib files that will be searched for when you have "Ignore All Default Libraries" set to No in the Linker/Input properties grid /VERBOSE is... well... a little too verbose. There is way too much output. All the searched libraries are listed multiple times. For example, kernel32.lib is listed 6 times. To obtain a list of individual libs I would need to go through the entire linker output and try to keep a list of each library name and whether I have seen it before. Is there something a little simpler /VERBOSE ...Show All
Samoyed Dll linking error: 2019
Hi, All I have a .dll file which exports a function called GetData(). The header file RegSys.h contains: __declspec ( dllexport ) int GetData(); The source file RegSys.cpp contains: int CRegSysApp::GetData() { return 100; // sample code to simply the question } The client application imports this function: The header file TestBench.h contains: __declspec ( dllimport ) int GetData(); The source file TestBench.cpp contains: BOOL CTestBenchApp::InitInstance(void) { int nData = GetData(); if (nData ==100) return TRUE; } I did include RegSys.lib, RegSys.dll and RegSys.h in the corresponding TestBench folders. It gave me the errors: TestBench error LNK2019: unresolved exter ...Show All
jvnb.kiran Resource Editor: Add/Remove operation is impossible '(null)' is read only
MESSAGE: Resource Editor: Add/Remove operation is impossible, because the code element '(null)' is read only So, I moved files from /ProjectA/ProjectA to just be /ProjectA fixed the project settings deleted and added files to go with the changes. My 'ClassView' contains duplicate classes CMyClass and CMyClass with two different paths one in /ProjectA/ProjectA and the new one /ProjectA; I can't delete the old /ProjectA/ProjectA one and now I get this message 'Resource Editor: Add/Remove operation is impossible, because the code element '(null)' is read only' when I try and add a button to CMyClass. I just double click the button, message. So, I go through and find the 'Events' panel and find the ID and ...Show All
Saania doubt with Winexec
Hi All, i want to open another application in my application for that im using winexec. the problem is i want the another application opened like a domodal(), what i mean is the myapplication should wait till the opened application get completed. -Amjath WinExec is obsolete function. This article shows how to run application using CreateProcess and wait until it exits: http://msdn2.microsoft.com/en-us/library/ms682512.aspx ...Show All
Quentin Mayberry STL Thread Safety
So, I looked for STL thread safety, and there are only two hits: One in Visual C++ Express Edition , and the other in Visual C# Language . Where's the best place to discuss MSVC 2005's STL thread safety -MM Two things have to happen here: 1) The C++ Committee has to decide on what the best threading model for C++ is - this is by far the largest single work-item that is currently under-discussion for the next revision of the C++ Standard. 2) Once the overall threading model has been decided then it needs to be integrated into the rest of the C++ Standard - and by this I largely mean the Standard C++ Library. For the containers what I suspect will happen is that there will be a sepa ...Show All
Pockey How do I generate an assembly file from my C++ code?
Hi! As I am an Electronics Engineer, I have worked on some embedded systems, and feel very comfortable with assembly code when I have to make a certain part of my project more efficient. I understand the way we can use inline assembly code in C++ too. But, to learn the way Microsoft C++ compiles the code, I would like to have a look at the assembly code. So, is the assembly code generated automatically every time (if it is, I haven't spotted the file), or is there some way I can create the file PS: I know that while debugging, I can view the assembly, but that's not what I want. Thank you, Anup. Use the /FA compiler option . ...Show All
