|
The most simple version.
WIN32_FIND_DATA fd;<br />
HANDLE hf = FindFirstFile(fullfilename,&fd);<br />
if(hf==INVALID_HANDLE_VALUE) return 0;<br />
FindClose(hf);<br />
return (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
|
|
|
|
|
Sorry i forgot the neg (!) at the return line.
|
|
|
|
|
Hello,
Actually, am getting data from the machine as 0x03 0x10 0x82 0x10..... and length of the buffer is varying, as Length:108 or 256 or....so how to proceed further to parse the data and store the data in an array. do we have any Active X control for parsing the data?
|
|
|
|
|
srija wrote: do we have any Active X control for parsing the data?
how an activeX could help you there ???
well, you reposted your question, but you don't really say much once again.
srija wrote: am getting data from the machine as 0x03 0x10 0x82 0x10
this doesn't mean anything (or it could mean everything) depending on haw you want to interpret those bytes...
that's why i asked you the format of the datas supposed to be received...
please precise the type on how you receive those data, how you want to change them, tell also if there are some important thing to read from the stream...
help us or we won't be able to help you !!
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
I would like to have the data in (Radius, Angle) i,e in polar coordinates, thats all the data what i could read from machine, i dont even have the header information also.
I think, you got my problem...
|
|
|
|
|
I would like to have the data in (Radius, Angle) i,e in polar coordinates, thats all the data what i could read from machine, i dont even have the header information also.
I think, you got my problem...
shirin
|
|
|
|
|
Use CArray for storing the data
nave
|
|
|
|
|
I hope to understand you right. The aim is to convert a variable length block of input data with hexadecimal numbers into an array to integers. If it' true try this:
<br />
void ParseBlock(const char* lp)<br />
{<br />
CArray<int,int> a;<br />
unsigned int i,n;<br />
int result;<br />
for(i=0;lp[i];i+=n)<br />
{<br />
if(!(n=ParseOneValue(lp+i,result)) break;<br />
a.Add( result );<br />
}<br />
}<br />
<br />
unsigned int ParseOneValue(const char* lp,int& result)<br />
{<br />
unsigned int i;<br />
char* e;<br />
while(lp[i] && !isdigit(lp[i])) ++i;
if(!lp[i]) return 0;<br />
if((lp[i]!='0')||(lp[i]!='x'))
{<br />
result = strtol(lp+i,&e,10);<br />
return e-lp;<br />
}<br />
i += 2;<br />
result = strtol(lp+i,&e,16);<br />
return e-lp;<br />
}
sorry the html won't take the tabs.
|
|
|
|
|
How to store the data first in CArray object? am getting continous data output with just
Length:204
0x02 0x90 0x02 0x8D 0x02................
LEngth:204
0x02 0x71 0x02 0x78 0x02 0x79
0x0 in C output window, how could i store certain set of data in CArray object?
|
|
|
|
|
in my project, i have a login dialog which opens to a MDI form if the username is valid. how can i call an MDI form from the dialogs button click
-- modified at 4:25 Wednesday 1st March, 2006
Using App wizard i chose to create a MDI application. In such cases when we run the program the MDI will run first. But i want to insert a dialog eg a login dialog such that when we run the project the dialog should be displayed first. And on the button(which is placed in the dialog) click the MDI interface should open up. pls give a solution
|
|
|
|
|
mailsafe wrote: how can i call an MDI form from the dialogs button click
You don't. The dialog is displayed when the applicaton is first launched, but before the main frame has been created.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Can you tell us more about the circumstances you want to do that. A short code extract would help. Nobody wants to steal anything from you but everybody wants to learn. Therefore tell us more detailed what you want to do.
|
|
|
|
|
MFC is so full of capabilities that I am a bit confused in the documentation and help files and cannot find the solution.
The problem:
I have a simple CDialog based app window with an ActiveX control in it. This ActiveX control has a feature that I do not need at all: it makes the dialog box jump in the foreground sometimes. Even if I hide the window (ShowWinow(SW_HIDE)), my app steals the input focus. It is normal behaviour for that ActiveX control and I do not want (and can't) modify the ActiveX control.
But I want to make my app "focusless" - that means if it receives some message to activate or jump foreground or capture keyboard and mouse focus, it should not respond. Have tried OnActivate, OnActivateApp, OnNcActivate, OnSetFocus, but these handlers are triggered AFTER the actual event and this does not work for me. I even agree to have this window to be invisible all the time (or maybe you know how to get ActiveX work without any window at all? , it just needs to be silent in the background until it does what it has to do and then exits.
Any ideas?
Thanks (at least for reading this)
|
|
|
|
|
On WM_WINDOWPOSCHANGING examine the WINDOWPOS* pointer in the LPARAM and set the flags member always on SWP_NOZORDER.
case WM_WINDOWPOSCHANGED:<br />
case WM_WINDOWPOSCHANGING:<br />
{<br />
WINDOWPOS* wp=(WINDOWPOS*)lParam;<br />
wp->flags |= SWP_NOZORDER;<br />
}<br />
break;
|
|
|
|
|
Thanks a lot!
I knew that the solution is simple just did not want to try out all of message handlers available; so your help eased my life a lot
-- modified at 11:42 Tuesday 28th February, 2006
Oops! That does not work. Seems that ActiveX control is stronger - I completely hide my window and try filter with SWP_NOACTIVATE but nothing.
Maybe if I tell that ActiveX control is WebBrowser that would give you some more ideas?
Thanks
|
|
|
|
|
No I have no other idea. You can try to disable the window to prevent it from getting focus (EnableWindow(hwnd,0); ).
|
|
|
|
|
Hi All
I have to erase a file permanently by using Gutmann Algorithm,
I studied Gutmann algorithm and learned that it deletes a file after 35 passes, in which in first 4 and in the last 4 passes random values are written to buffer and in the rest 28 passes RLL & MFM technique is used to write the data in to the buffer.
Here I'm not getting RLL & MFM.
So Please explain these terms, and I will be grateful if provide some code snippets for the same.
Please help me
Thanks
|
|
|
|
|
Run Length Limited and Modified Frequency Modulation - these are encoding techniques when writing data to the disk head, it's more to do with eletrcial issues than software issues.
The tigress is here
|
|
|
|
|
Hi All,
Can anyone tell me how to change the value of an Environment variable programmatically? I have tried _putenv, _wputenv and SetEnvironmentVariable. All of them are returning success but the value is not changing.
Can anyone tell me where I am going wrong?
Thanks and Regards,
Anil
|
|
|
|
|
the environment variable are acutally changed, but within the process...
close the windows session to see the changes appear...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
The environment block for each process is a copy of the system environment. You can modify it for your own process. But you cannot change the environment for other applications.
|
|
|
|
|
|
Maybe you should copyright your answers
|
|
|
|
|
that's not what i meant, but the guy has been answering twice on something i already answered...
was there a real need to spam the forum with answers that don't solve the problem more ?
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|