|
Can anyone tell me what's the different between
CList<CTime,CTime> m_listTime
and
CList<CTime,CTime&> m_listTime
i used either one of these in my program, can't see the different.
*12Code
|
|
|
|
|
12Code wrote: CList<ctime,ctime> m_listTime
This version will copy CTime items when you pass them as parameters to list methods like SetAt[^].
12Code wrote: CList<ctime,ctime&> m_listTime
This version will pass a reference to CTime items when you pass them as parameters to list methods like SetAt[^].
I'm not surprised you don't see a difference - there's not much of one in this case. A slight performance issue, but not much else - except that you really want the default value for the second template parameter.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
you see no difference because the differences are underground.
the second parameter is meant to tell to CList how it's gonna handle your list elements like.
a CTime template parameter tells to use so as methods parameter, that means each time you pass an element to a CList method (such as Add()), it will pass a CTime. that means the parameter will be passed by copy.
a CTime& (or even better a const CTime&) template parameter will have you make no changes in your code, but it will handle references, so no copies anymore.
the difference between the 2 is in the memory consumption and in the performances of the program.
|
|
|
|
|
As a side note, try to pass a temporary object to the second form and see what happens to your application...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
Can someone help me to write c++ code in the task of converting pdf to any image format(like .tif,.jpg,.bmp etc)....i googled but didnt get any useful code in c++ ....any help would be appreciable.
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
modified on Thursday, May 14, 2009 6:29 AM
|
|
|
|
|
download pdftoimage.exe that converts PDF file to an image file.
Download from here
But it is chargeable.
regard
Imrankhan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Sorry for the wrong question...actually i have to write my own application in vc++
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
I am a Korean college student that is using File Encryption and Encrypted text embedding in an image in a project.
I would like to know the difference between the Online Encryption and Offline Encryption when the exe file is executed.
I think Online Encryption is to encrypt and Decryption? the actual recorded content, and offline encryption is to bring/open/call the wav file when the brouwse button is clicked and encrypt and Decryption.
later when the saving, online and offline seem to be saved with the same name.
would that suggest that the difference in the two is only the way the wav file is being opened (called on/ brought)?
File Encryption and Encrypted text embedding in an image.
I ask as there isn't much explaination to the subject of File Encryption and Encrypted text embedding in an image.
|
|
|
|
|
|
Hi,
I have the only entry in the text file
[Info]
AppID=12c5cad4-3f6c-46f9-8ba7-61253cb23bec
How to retrieve "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" entry
|
|
|
|
|
You can do the following :
1. Extract the entire row and then extract text starting from '=' or
2. i do not remember the functionality of the following functions exactly but i think you can use GetPrivateProfileSectionNames () or GetPrivateProfileString ()
|
|
|
|
|
Or use a regex package.
Which language by the way.
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
|
VKupunaram wrote: How to retrieve "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" entry
As said by kapardhi
Just try these two lines
TCHAR szOut[MAX_PATH];
DWORD dwReturn = ::GetPrivateProfileString(_T("Info"),_T("AppID"),_T("FAILED"),szOut,MAX_PATH,_T("C:\\yourfile.txt"))
You will get "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" in szOut
|
|
|
|
|
|
so, you voted every answer you got as Bad because you couldn't figure how to read the documentation by yourself ?
The "said working" solution is what someone else suggested without providing code...
Dude, help yourself, and learn reading the MSDN
And if you're about to vote for this post, take time at least to explain why you do so
|
|
|
|
|
toxcct wrote: so, you voted every answer you got as Bad...
Are you sure it was the OP?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
not that much, but at least, he could defend himself ?! lol
|
|
|
|
|
Stopped voting ! I missed a 5
just kidding.
|
|
|
|
|
Hai!
I am developing a dialog based application for a WINCE device in eVC++.
I cannot use GDI, ImagingFactory, IPicture API's
I need solution/suggestion to any of the following:
1. I have .jp2 image, how can i convert and save it as .jpg file.
or
2. I have the byte array of .jp2 image, how can i convert to .jpg byte array
or
3. How can i get the HBITMAP handle from .jp2 image's byte array.
I am having one more doubt:
Using picture Control i am not able to display a bitmap image
mcsMyImage - is the control variable of the Picture control of my dialog,
MyImage.bmp - is the bitmap file
now i do the following:
CString strError;
DWORD dwError;
HBITMAP hBitmap = (HBITMAP) LoadImageBitmap (NULL, _T("MyImage.bmp"), IMAGE_BITMAP, 0, 0, 0);
// Tring to get last occured error
dwError = GetLastError ();
strError.Format (_T("%x"), dwError);
AfxMessageBox (strError);
// Set the bitmap on the dialog
mcsMyImage.SetBitmap (hBitmap);
Bitmap doesnot get loaded, i get 0x6 as the last error, which says "Invalid handle" How to solve this?
Thanks!
modified on Thursday, May 14, 2009 5:25 AM
|
|
|
|
|
Hi, you may be able to find an implementation of jp2 in the source code for celestia.
Haven't seen the LoadImageBitmap function before. I wonder if it works like LoadImage, if so, you'll need to throw it a copy of the hInstance, you'll also need to throw it the LR_LOADFROMFILE for the load flags.
i.e - using plain GDI:
HBITMAP hBitmap = (HBITMAP) LoadImage(
GetModuleHandle(0),
"MyImage.bmp",
IMAGE_BITMAP,
0,0,
LR_LOADFROMFILE
);
I apologise in advance if my ignorance about mfc has made this a wasted post.
|
|
|
|
|
Sorry i have wrongly typed it,
it's LoadImage () only, when i am using LR_LOADFROMFILE, it gives an error error C2065: 'LR_LOADFROMFILE' : undeclared identifier
Thanks!
|
|
|
|
|
Uh-huh. Okay, have you included "winuser.h" - it defines LR_LOADFROMFILE (as 0x10)
I don't need to include it explicitly using gcc 3.4.??
Taken from winuser.h
#define LR_DEFAULTCOLOR 0
#define LR_MONOCHROME 1
#define LR_COLOR 2
#define LR_COPYRETURNORG 4
#define LR_COPYDELETEORG 8
#define LR_LOADFROMFILE 16
#define LR_LOADTRANSPARENT 32
#define LR_LOADREALSIZE 128
#define LR_DEFAULTSIZE 0x0040
#define LR_VGACOLOR 0x0080
#define LR_LOADMAP3DCOLORS 4096
#define LR_CREATEDIBSECTION 8192
#define LR_COPYFROMRESOURCE 0x4000
#define LR_SHARED 32768
Remember, the first param of LoadImage can be NULL only when loading a bitmap from a resource within the module. If loading from a file, you must (a) pass the hInstance, (b) give a valid filename (c) pass the LR_LOADFROMFILE loading flag.
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">kapardhi wrote:</div>
1. I have .jp2 image, how can i convert and save it as .jpg file.</blockquote>
JasPer
|
|
|
|
|
kapardhi wrote: I am developing a dialog based application for a WINCE device in eVC++.
Chris Losinger wrote: JasPer
Unfortunately Jasper should first be ported to WinCE
Seriously, if you want to get a result in reasonable time, convert your jp2 file to a Imaging supported format(as jpg or png) on a server and use the Imaging API [^]on your device.
cheers,
AR
|
|
|
|