|
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.
|
|
|
|
|
How do you create an expiration date for an application and/or a dll? That is, if you want to create a free trial version of software that stops running after 30 days or whatever, how do you do that?
Thanks!
|
|
|
|
|
the simple way is:
1. choose a place to store a date (registry, a file, etc)
2. when the app starts, check that place for the date
3. if you don't find a date, store the current date there
4. if you do find a date, subtract the current date from the stored date.
5. compare the difference to your time limit.
there's a huge obvious vulnerability in schemes like this (find the date and erase it to reset the trial). but, they do work.
|
|
|
|
|
But... how do you make the app stop working? Just quit every time it's started again?
|
|
|
|
|
Add a thread in your App to check the validity of yourapp or dll,when you find it is overdue then quit you App
|
|
|
|
|
|
Dear all
I download a project which is written in visual C++.net 2003.
Now I want to compile and use it in visual C++.net 2008.
But it could not be compiled because of including following line
#include <iostream.h>
It seems that visual C++.net 2008 does not support above line.
how can I overcome this problem.
Regards
Monhi
|
|
|
|
|
Could you please modify your post?! The < and > are gone ...
Maxwell Chen
|
|
|
|
|
Maybe just remove the ".h" from the relevant header file names
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You meant #include <iostream.h> , am i right ?!
BTW, as it's been stated, and Bjarne Stroustrup tells it himself, the trailing .h is redundant with the < > inclusion symbols.
so the standard C++ is expecting standard headers to be included like that:
#include <iostream>
to finish, when you have a compiler/linker error, please paste it here. we cannot guess what the system tried to tell you, especially when you don't even post a piece of code...
|
|
|
|
|
toxcct wrote: we cannot guess what the system tried to tell you
Umm, you just uh did
Last modified: 31mins after originally posted --
led mike
|
|
|
|
|
sorry mike ? what you say ??
|
|
|
|
|
you just did guess what the system tried to tell him, after telling him we couldn't guess. :->
led mike
|
|
|
|
|
led mike wrote: you just did guess what the system tried to tell him, after telling him we couldn't guess
Haha ...
Maxwell Chen
|
|
|
|
|
Bjarne Shmarne....who does he think he is, anyway.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|