|
Michael Schubert wrote: There should be a forum for really cool code snippets like this! Nicely done Carlo!
Quote Selected Text
No worries!! We have the magic site of carlo..
Regards,
Sandip.
|
|
|
|
|
|
On a serious note, I completely agree with you. We need a "Cool Code" forum.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Yes I agree with you
May be you can add a suggestion in the suggestion forum..
Regards,
Sandip.
|
|
|
|
|
|
Michael Schubert wrote: There should be a forum for really cool code snippets like this!
There is an entire website for this. Haven't you seen:
http://www.cpallini.freeproductz.com[^]
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
URLz iz givez me errorz. plz helpzz.. urgentzzzz!! wherez da codez???
|
|
|
|
|
How to scan or identify a physical damage (like scratch or spot) in a blank writable CD?
Thanks
|
|
|
|
|
NS17 wrote: How to identify a physical damage (like scratch or spot) in a blank writable CD?
You will need a small cotton ball, a mild liquid soap, clean water and a table lamp.
Add a few drops of the liquid soap in water, soak the cotton in the soapy solution and wipe the surface of the disc gently, rubbing the cotton back and forth against it in a rocking motion.
Switch on the table lamp and let the light lit the surface of the CD. You will be able to spot scratches and physical damages on it easily now.
BTW, this forum is for Visual C++ questions.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
bro your a comedian.
he wants to know how to check for physical damage when the cdrom is reading the cd.. software-wise i think
search for
damaged sectors checking source code
doubt u'll find any.. but there must be a way to check it. how do CDR programs know the CD is blank when you enter it.. oh thats easy.. check the size of the cd.. but when its already full.. I guess you have to check every byte.. written to CD and see if it is changed? if it is.. then return damaged.
|
|
|
|
|
Cbadboy wrote: I guess you have to check every byte.. written to CD and see if it is changed? if it is.. then return damaged.
It is changed or it is unreadable? If thought if the data could not be read, then he must return damaged. That's kinda obvious, I thought. Therefore my funny reply to him.
But however, I think that one cannot be very much sure about if the read failed due to a physical damage or not.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
I just only need to know damaged area's position (sector, or something else)... CD can be blank or not, but the damage will not be in the written area. If it was in the written area then error will occur in the normal reading, right? Since it will not be so, I think I need to find another method.
|
|
|
|
|
Rajesh R Subramanian wrote: BTW, this forum is for Visual C++ questions.
So just retool your cotton ball/soap/water/lamp example in the form of code.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I need to create a directory under c:\Users\Public. My os is Vista. I am using VC++. I cannot use latest SDK. Can I know to to get to that path programmatically using VC++6.0
Thanks....
|
|
|
|
|
To create a folder use CreateDirectory
To change working folder use SetCurrentDirectory
|
|
|
|
|
Thanks.. But I cannot manually mention the directory path. I would like to know any macro which maps to that directory path.
|
|
|
|
|
MyView wrote: But I cannot manually mention the directory path.
Do you mean that you cannot hard code that path? Can you please clarify?
|
|
|
|
|
The standard way is to use the SHGetKnownFolderIDList()[^]function by passing the REFKNOWNFOLDERID as FOLDERID_Public. This function is available only in vista and in you case since you cannot install latest SDK, you have to dynamically load the function from the shell32.dll.
How ever I think the following code will also work( I didnt test it because i dont have vista right now )
TCHAR tcPath[MAX_PATH];
GetEnvironmentVariable( _T("PUBLIC"), tcPath, MAX_PATH );
|
|
|
|
|
is there some way to call OnKillFocus Method of editboz against button clicking.
|
|
|
|
|
ani_ikram wrote: s there some way to call OnKillFocus Method of editboz against button clicking.
Yes, by clicking outside the edit box.
or you can explicitly set focus to some control other than the edit box after setting it first on the edit box. ON another note, OnKillFocus is called by the framework, when the control looses the focus.
or
Try SendMessage with WM_KILLFOCUS as one of the params (Just a guess)
Hope this helps..
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
ani_ikram wrote: way to call OnKillFocus Method of editboz against button clicking
If you click button then the focus will be set to button. So the OnKillFocus of editbox will be called, provided you have mapped like
ON_EN_KILLFOCUS(IDC_EDIT1, OnKillFocus)
|
|
|
|
|
Did you declare OnKillFocus for editbox?
|
|
|
|
|
Simply map "OnKillFoucus" to the click event of button
ON_BN_CLICKED(IDC_BUTTON, OnKillFoucus)
|
|
|
|
|
i am having problem with sscanf being how I say o.O
line exactly
<br />
"spawn = 1648\t3409\t3536\t0\t3410\t3557\t3408\t3535\t2\tCow"<br />
the code I use
struct Pos {
int x;
int y;
};
int npcId = 0;
Pos coords;
int heightLevel = 0;
Pos moveRange1;
Pos moveRange2;
int direction;
sscanf(line,"spawn%*[ ]=%*[ ]%d%*[\t]%d%*[\t]%d%*[\t]%d%*[\t]%d%*[\t]%d%*[\t]%d%*[\t]%d%*[\t]%d",&npcId, &coords.x, &coords.y, &heightLevel, &moveRange1.x, &moveRange1.y, &moveRange2.x, &moveRange2.y, &direction);
"spawn = 1648\t3409\t3536\t0\t3410\t3557\t3408\t3535\t2\tCow"
outputs =
npcId: 0 (has to be 1648) (wrong for no reason o.O)
coords.x: 3412
coords.y: 3536
heightLevel: 0
moveRange1.x: 0 (wrong for again no reason as the format pattern matches)
moveRange1.y: 3557
moveRange2.x: 3408
moveRange2.y: 3535
direction: 2
the last \tCow is to be ignored its not really needed.
So whats wrong really
|
|
|
|
|
I just copied your code and tested... I am getting correct results...
|
|
|
|