|
int nInt = 54321;
int *pInt = &nInt;
char buf [11];
sprintf (buf, "0x%08x", (unsigned int)(pInt));
cout << buf;
I must be in a good mood. Normally I'm not this helpful!
Iain.
|
|
|
|
|
DaFrawg wrote:
I want to output the memory location of nInt.
This printed out the address for me:
int nNumber,
*pAddr;
pAddr = &nNumber;
cout << pAddr << endl;
If you want that address in a char* variable, use:
char addr[32];
sprintf(addr, "%#x", pAddr);
cout << addr << endl;
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
How about this:
#include <iostream>
void main()
{
int iVar;
void *pVar = &iVar;
std::cout << pVar << std::endl;
}
--------
There are 10 types of people in this world. Those who know binary and those who don't.
|
|
|
|
|
I found that some controls in CDialog are always not need,
so it is better to hide them,
They are in a some GroupBox.
and let for user to do it..
I did nor found such a article.
http://www.codeproject.com/miscctrl...target=groupbox
- no hiding
Is there such a control?
May be stack CDialog is useful for it?
- hiding groupbox?
(Big reconstruction is need?)
thanks you.
|
|
|
|
|
Try here[^]
And change it to alter the inner windows, rather than disable them.
Also look in the www.codeproject.com/dialog(s?) section as well as www.codeproject.com/miscctrl.
Or you could even write the code!!!!! [*]
Iain.
[*] if you do, think about turning it into an article.
|
|
|
|
|
I Need hide content ability.
|
|
|
|
|
Hi,
does somebody know a function which retrieves the HWND handle of the titlebar ?
Thanks in advance!
|
|
|
|
|
|
There isn't a direct command to do this. The title bar is part of the non-client area of a regular window which has a caption. If you need a custom caption or something similar, do a quick search for the author "lorde" on CP, David Lorde (do his second name only), as he has published a really good article on custom captions.
Sorry, don;t have time to look the link up myself.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I'm happily using ShellExecute to open DOC files and URLs.
I can append "#bookmark" to a URL for IE to open at the specific section of a page, but if I try the same with DOC files then it doesn't work - I don't even get the DOC file open.
Am I expecting too much of ShellExecute?
Is there some other technique for opening such files?
Many thanks
|
|
|
|
|
Hi again....
People...
Is there a way to convert my vcpp project
from "win32 app" to "ocx or somthing"...
so I can use it as a control... in other projects ???
=-=-=-=-=
The Server
|
|
|
|
|
Every now and again when I try to run a macro in VS6 I get the following message:
"One or more macro files have been updated. Would you like to reload all macros now?"
Even though I haven't touched any macro file.
Anyone know what can be causing this?
It seemed to only start occurring when I started using Windows XP.
Thanks,
Ed
|
|
|
|
|
Hi,
I'm having problems accessing a struct in a dll file using C++.
I have successfully loaded the DLL, and loaded and called some of the functions using LoadLibrary and GetProcAddress. However, there is an insert function that I am having difficulties with that requires a struct to be passed into it. This struct is defined within a file in DLL and must be populated before passed to the insert function.
I've looked for a similar function to GetProcAddress to use. I've also tried including the file within the DLL that defines the struct.
This one's got me completely banjaxed.
I'd appreciate any help at all.
Thanks,
Adam
|
|
|
|
|
You don't need to import anything in order to use a struct. Just #include in your main app the header where the struct is defined and use it like always. Is this what you were asking?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Ahhh, of course. Thank you very much. Now I'm receiving a new error.
Cannot open include file: 'winsds.h': No such file or directory
This must be specific to the dll I'm loading.
Thanks for your help. I was looking for a tough solution.
Adam
|
|
|
|
|
Cannot open include file: 'winsds.h': No such file or directory
Check the additional include directories in your project settings.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I have a questionr regarding the useage of a virtual list control.
I keep all my data in my own array.
From time to time, the data in my array changes.
How could I make these changes reflected on the vlist control?
Jeremy.
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
partially custom drawing the control. At CP there a some samples.
Try this @ home. (B&B)
|
|
|
|
|
Hello, i've just started C++ and currently looking into MFC. Is there a way that i could convert my existing console app to a MFC app?....because i wanted a GUI as well as a console window.....i tried adding the stdafx.cpp and the header file , the preprocessor def: _WINDOWS,_AFXDLL to my existing project. when compiled....i get......"c:\program files\microsoft visual studio\vc98\mfc\include\afxver_.h(130) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds". Please Help!!! thanx
|
|
|
|
|
|
|
i mean that i draw something on a DC(CDC).
then i need to save this to a .bmp file.
that is to say, how to find the BITMAPINFO structure?
|
|
|
|
|
You must compute the bitmapinfo structure in your program. This is a "To Do". Read the MSDN and don´t ferget the 'DWORD' Alignment!!!
Try this @ home. (B&B)
|
|
|
|
|
Thanks.
Can you tell me where I can find the details about this in MSDN?
And how can i compute the bitmapinfo structure about a DC?
Best Regards...
|
|
|
|
|
If you use the visual studio press F1 else try the online docs from MSFT.
If you 'maybe' find the bitmapinfo you will read that this info contain the measures about the bitmap. A nice function is also "GetDIBits".
Try this @ home. (B&B)
|
|
|
|