|
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...
|
|
|
|
|
I now its right.. because I used the same code.. just a little modified for another part of loading files.. and it works perfectly.. but this.. doesn't.. i should post full method can u try it?. I believe my error is divine intervention because god doesn't want me to become a programmer.
#ifndef NPCHANDLER_H
#define NPCHANDLER_H
#include <stdio.h>
class NpcHandler {
public:
NpcHandler();
~NpcHandler();
void loadAutoSpawn();
};
#endif
</stdio.h>
NpcHandler::NpcHandler() {
loadAutoSpawn();
}
void NpcHandler::loadAutoSpawn() {
printDebug("Loading autospawn list\n");
FILE* dataIn;
char line[80];
char* ptrOffset;
int numTabs = 0;
int numOfNpcs = 0;
int npcId = 0;
Pos coords;
int heightLevel = 0;
Pos moveRange1;
Pos moveRange2;
int direction;
dataIn = fopen("data/autospawn.cfg", "rb");
if(dataIn) {
while(!feof(dataIn)) {
fgets(line, sizeof(line), dataIn);
if((ptrOffset = strstr(line, "spawn =")) != NULL) {
numTabs = 0;
for(int i = 0; i < strlen(line); i++)
if(line[i] == '\t') numTabs++;
if(numTabs == 9) {
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);
printf("DAM U npcID = %d\n", npcId);
printf("coords x = %d\n", coords.x);
Sleep(1000);
} else {
}
numOfNpcs++;
}
}
fclose(dataIn);
} else {
}
}
and here is the data file..
autospawn.cfg successfully uploaded!
Here is your link:
http://uppit.com/URNOXU
|
|
|
|
|
Cbadboy wrote: I believe my error is divine intervention because god doesn't want me to become a programmer.
That's a joke...
BTW, first you should identify which line of data is having the error. Did you try so?
|
|
|
|
|
there is no errors.. the line is correct.. just can't solve
|
|
|
|
|
Can someone plz try it.. i'm serious it has no errors.. i can't even see any by eye.. but it skips some..
|
|
|
|
|
Cbadboy wrote: i'm serious it has no errors...
Well it obviously does or you would not be asking for help. Use the debugger.
"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
|
|
|
|
|
Debugger isn't helping what do u think I've been using this whole time before I posted question.. it just breakpoints on 1 line.. i see everything inside sscan the tokens and such... I even see the npcId value but it doesnt set up inside the npcId datatype.. which remains zero.................................
|
|
|
|
|
Cbadboy wrote: Debugger isn't helping what do u think I've been using this whole time before I posted question...
How could I possibly know the answer to that since you never mentioned what you tried?
As someone that helps on this board FOR FREE AND IN MY SPARE TIME, my assumptions are based solely on the information, or lack thereof, that you provide. If you want us to know something, tell us.
"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
|
|
|
|