|
Hi George,
reallocation to me means:
1. performing a new allocation (at a new address)
2. copying the existing data to it
3. returning the new address
It is used to change the size of some data structure (e.g. an array) without loosing its
content, typically when you want to add data but can't without all the steps involved,
since the existing allocation isn't large enough. Occasionally it is also used to reduce
size (when the original allocation was way too large, typically because requirements
initially unknown).
You could have a look at the realloc() function in C.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thanks Luc,
Cool! Question answered.
regards,
George
|
|
|
|
|
I used
Font *pFont=::new Font(L"Tahoma",12,FontStyleRegular,UnitPixel);
to create a Font object, when I do Graphics::DrawString using this font, the font is in bold style.
PS: I've Tahoma.ttf in the font directory.
|
|
|
|
|
You shouldn't necessarily be using the global namespace new operator for GDI+ objects.
If you use DEBUG_NEW and that's causing ambiguity with Gdiplus::new, you can get around it as shown below.
I tried this and it wasn't bold
#pragma push_macro("new")
#undef new
CClientDC clidc(this); <font color="Green">
Gdiplus::Font *pFont=new Gdiplus::Font(L"Tahoma", 12, FontStyleRegular, UnitPixel);
Graphics gr(clidc);
PointF origin(0.0f, 0.0f);
SolidBrush blackBrush(Color(255, 0, 0, 0));
gr.DrawString(L"abcdefghijklmnop", 16, pFont, origin, &blackBrush);
delete pFont;
#pragma pop_macro("new")
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I post in VC++ forum becoz I know they are the professionals. I might be having serious problem.
I was on IRC chat, I wanted to chat with a girl in a channel called "sex", she started giving me warnings that she doesn't want to chat with me.. I didn't go but I also didn't say any bad words, I wanted to talk with her. then she said to me that an email was sent to my ISP containing my ID and a copy of this chat, she told me that she is working with the government and she started giving me information like my ISP (I know you can get this from some programs), but she was talking very seriously and she told me that I am now guilty of harassment and soon I might be caught by the police.
do I seem stupid enough? maybe..
She was speaking so professionally about things like trace routing and alike, she did not seem to be joking and she was not a sex-girl searching for fun.
Questions:
1. Can IRC servers along with my ISP know my identity, I am behind a LAN that contains at least 200 computers.
2. How would they prove my identity? will they do it by tracing my MAC or IP address? does changing my ethernet card solve the problem? and what else should I do to hide my identity?
BTW: i have static IP address in my local network.
3. Are there any government agents that really work that way in chat rooms? heard of anything like that?
I am so annoyed now, I was searching for a girl and now she fu**ed me, I need answers from professionals.
|
|
|
|
|
sold_out wrote: I am behind a LAN that contains at least 200 computers
Make sure your attorney knows that
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Only in the extremely unlikely case where it goes that far.
I wouldn't be worried unless you sent improper material or show up at an
underage girl's door.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
No, she told me that she is 25, and she told me that she is interested in sex in our first minute, but then she told me that I should go and I didn't.
Can they identify me by trace routing? this would be a disaster
EDIT: I told her that I want to see her on cam
|
|
|
|
|
Relax
- you're nowhere near being a stalker yet.
Everything you do on the internet is potentially traceable...sometimes easily.
Keep that in mind whenever you type anything and send it out into the public
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I know man, I doubt that anybody will bother opening a serious investigation especially if they see that I didn't speak bad words, threats..
But you know, when you think that there is 0.01% probability that you will be caught sometime, u will be pissed off, especially for such stupid thing..
|
|
|
|
|
Don’t worry, that girl seems to just threatening you.. Long back ago I am using yahoo chat, the guy I am chatting with give back my password, minute I initiated chat with him.
Internet seems to full of idiot and expert .. and might be your encountered expert this time.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
better ask this question in lounge! we are vc++ programmer not professional hacker or cracker!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
ThatsAlok wrote: better ask this question in lounge! we are vc++ programmer not professional hacker or cracker!
Hey - that's just so wrong. If he posts this in the lounge, he is going to get his ass slammed (potentially preparing him for life as a prison bitch). Hackers and crackers get short shrift in the lounge, so don't send him their.
|
|
|
|
|
Don't worry, if you DO go to prison, at least you know you'll be getting some sex there...
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello everyone,
I have made some study on this. Here is something I found confused.
http://womble.decadentplace.org.uk/c++/template-faq.html#dependent
--------------------
What are dependent names?
A: Dependent names are names whose definitions are considered to depend upon the template parameters and for which there is no declaration within the template definition. They are resolved only when the template is instantiated. Those that are intended to refer to types or templates may require disambiguation.
If the resolution of a dependent function name uses argument-dependent lookup, declarations in the arguments' namespaces that are visible at the point of instantiation will be considered as well as declarations visible at the point of definition. (The former is normally a superset of the latter, but may not be.)
--------------------
Two confusions,
1. What means " for which there is no declaration within the template definition"?
2. What means "declarations in the arguments' namespaces that are visible at the point of instantiation will be considered as well as declarations visible at the point of definition."?
Could you show some pseudo code please?
BTW: I feel I lack some knowledge of template programming in-depth even if I use STL template everyday. I tried ti read appendix C for Bjarne's book, and it contains more confusing terms about dependent names (e.g. section C.13.8.1).
regards,
George
|
|
|
|
|
|
Thanks Maxwell!
The link is very helpful. Most of my issues are solved. How do you understand the statement in my original reply -- "declarations in the arguments' namespaces that are visible at the point of instantiation will be considered as well as declarations visible at the point of definition."
I can not understand why both instantiation point and definition point are considered. Any ideas or pseudo codes?
regards,
George
|
|
|
|
|
Hi again,
I need to display a JPG file from a location - ex. c:\img.jpg
using BitBlt but i don't know how to implement.
This will be under OnDraw() or OnPaint() function.
I read that this will use CDC but i don't know how to relate.
If you knew of a thread please inform me.
Hope you can help me.
Thanks.
|
|
|
|
|
Example:
void CMyWnd::OnPaint()
{
CPaintDC dc(this);
CImage JPEGImage;
JPEGImage.Load(_T("c:\\img.jpg"));
JPEGImage.BitBlt(dc, 0, 0, SRCCOPY);
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Is JPEGImage a derived class?
To create? or already exist.
|
|
|
|
|
TooShy2Talk wrote: Is JPEGImage a derived class?
No just a quickly chosen variable name. The class is CImage...
I forgot:
#include <atlimage.h> If you're using VC 6, upgrade! then I'll show a sample the long way. The CImage class makes it easy
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Select an HBITMAP object into a memory dc first.
An easy way to get an HBITMAP from a JPG file is using GDI+.
You might find it in google.
gl
|
|
|
|
|
Anyone know where I can get the debug version of msvc version 8.0.50727.762? VC2005 installs 8.0.50727.42 and depends on 8.0.50727.762!!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|