|
youbo wrote:
----- 已跳过生成: 项目: circ ------
------ 已跳过生成: 项目: circprops ------
========== 生成: 0 成功或最新,0 失败,2 被跳过 ==========
are you using the other than English OS, if yes please post error message converted to english
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
my edition is 2005,i find there are many new things in the edition relative to 6.0, and the expression sees to be strange.
|
|
|
|
|
youbo wrote: my edition is 2005,i find there are many new things in the edition relative to 6.0, and the expression sees to be strange.
What do you expect after 7+ years of changes in technology?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
HI,
In my application i have some alarms.If the value is goes under limit value then my application should give beep or some alarm sound.For this i have one flag,if the value goes below limit value it gets true.and alrm is get beep.
if(AlarmSummBeep)
{
HINSTANCE hInst = AfxGetInstanceHandle();
if(!PlaySound("IDR_LOWALM", hInst, SND_RESOURCE | SND_ASYNC))
{
MessageBeep(0xFFFFFFFF);
}
}
else
PlaySound(NULL,NULL, NULL);
Actually this conditon is in thread function.So,the alarm is continuosly beeping.
SO i need one mute button in my application and if i press the button,even if the alrm gets there should be no sound or beep at all.
I searched in net..but i cannot find my solution.Pls help me out.Mine is MDI application.
Anu
|
|
|
|
|
From what I've understood, can't you set an additional boolean flag for mute condition? If mute is true, then return without ringing the alarm. But, please help me understand your problem better...
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
Can you set the value of the flat AlarmSummBeep to false when you click on that button. You can also use a different variable in case this conflicts with your existing code. So when the user clicks on the mute button the value of the new flag variable is set to false and the alarm beep is not fired.
While playing the alarm just check for the value of that flag variable.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Maybe you should use the good old Beep(dwFreq,dwDuration);
It will beep through the DOS speaker, which most computers still have.
//Johannes
|
|
|
|
|
In fact, most modern ainboards will (at least optionally) beep via the built in sound device.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Hi all,
In my application, I can read a file and process it to collect some data. To make my application I want to make only allowed to work on one file format. I mean my application read same type of file all the time, so the extension and file name length is fixed.
To confirm that what I have do is, get the file name from the full path with the extension. Then find the length and the extension. Check that both conditions are true with fixed file name length and the file extension.
Is that ok, I mean is that this is proper way to do it.
Thanks.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Checking the file name and extension isn't always helpful. You may get a fake file with the same name and ext. So, better write your file with specific header at it's start. And whenever you open the file, verify the file with your header structure and data in it. If you found anything mismatch in the data, the file isn't yours! So, this makes you use flexible file name and extension. This could be more secured. I hope you got my point.
- Malli...!
|
|
|
|
|
what malli has suggested is good.
and for more security, you can also put the checksum at the end of hte file.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Thanks for the both replay. But I'm not sure that is easy to me
This is the way I've done it.
<br />
void CSRFDBDlg::CheckFileName(CString FileNameToCheck)<br />
{<br />
CString withExt;
CString fileExt;
<br />
withExt = FileNameToCheck.Right(FileNameToCheck.GetLength() - (FileNameToCheck.ReverseFind('\\') + 1));
<br />
fileExt = withExt.Mid(14, 3);<br />
<br />
if( (withExt.GetAt(0) == 'G') && (withExt.GetLength() == 17) )<br />
{<br />
if( (fileExt.GetAt(0) == 's') && (fileExt.GetAt(1) == 'r') && (fileExt.GetAt(2) == 'f') )<br />
{<br />
CString str( _T("Selected Target:\n\n" + FileNameToCheck) );<br />
AfxMessageBox(str, MB_OK);<br />
GetDlgItem( IDC_READ )->EnableWindow( TRUE );<br />
}<br />
else<br />
{<br />
AfxMessageBox( "This file format is not support in this application." );<br />
}<br />
}<br />
else<br />
{<br />
AfxMessageBox( "This file format is not support in this application." );<br />
}<br />
}<br />
I appreciate your help all the time...
Eranga
|
|
|
|
|
If you use CArchive::Serialize it will check if the structure of the data are correct to the project it self.
I.E. you code this:
if (ar.IsStoring ())
{
ar << myObject.myInt;
ar << myObject.myDouble;
ar << myArray[x].myString;
}
and you save a file with those datas, if you afterwards try to read them and you put it in other way, like:
else
{
ar << myArray[x].myString;
ar << myObject.myDouble;
ar << myObject.myInt;
}
the programm will complain and say that the data are not readable. So there is an error coding, or the file is not from your application. Is very difficult to find a "fake" file with the same structure of data as the files from your application (probability will be inverse proportional to the ammount of data saved in your file).
With the CFile you dont have that support, so you should use the solutions above.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Thanks pal. How about if I check both structure(as you said here) and the way the file name organized(as my code). Is it good or bad.
I appreciate your help all the time...
Eranga
|
|
|
|
|
hello,
in my project i have to fix a formview in another dialog like
m_GAUserEnteredOption.Create(this, IDC_S_VIEW_USERENTEREDOPTION,
IDR_F6CP_MAINFRAME,
RUNTIME_CLASS(CGADocument),
RUNTIME_CLASS(CGAMainFrame),
RUNTIME_CLASS(CDigitalUserOption),
WS_CHILD | WS_VISIBLE, 0L);
but once i fix this in another dialog i cant destroy the window
and those controls which are under this frame and dialog is not accesible . how to over come this
"Men never do evil so completely and cheerfully as when they do it from religious conviction"
-Pascal
|
|
|
|
|
This is a simple assignment for my c++ class requiring us to convert some text in a char array inline, not using another array. My code compiles with no errors, but when I run the program nothing comes out. I guess somewhere I'm accidently overwriting the entire string to nothing but... yeah. Anyhow, in the array, the following changes are supposed to occur: th -> z, s -> z, and r -> rr. This, of course, requires the entire string to be shifted if in the cases of th -> z and r -> rr. Here is my code:
<br />
#include "stdafx.h"<br />
#include <br />
#include <br />
#include <br />
<br />
using namespace std;<br />
<br />
#define MAX_SIZE 100<br />
<br />
int getLength(char inputText[]);<br />
void moveLeft(char* inputText, int index);<br />
void moveRight(char* inputText, int index);<br />
<br />
<br />
void main()<br />
{<br />
<br />
char text[MAX_SIZE];<br />
<br />
cout << "Enter your words here: ";<br />
cin.getline(text, MAX_SIZE);<br />
<br />
int sizeText = getLength(text);<br />
<br />
int j;<br />
int k;<br />
<br />
for( j = 0, k = 0; j < sizeText; j++, k++)<br />
{<br />
if ( (text[j] == 't' || text[j] == 'T') && (text[j + 1] == 'h' || text[j + 1] == 'H'))<br />
{<br />
text[k]= 'z';<br />
moveLeft(text, k);<br />
j++;<br />
}<br />
else if (text[j] == 'r' || text[j] == 'R')<br />
{<br />
moveRight(text, k);<br />
text[k] = 'r';<br />
text[k+1]= 'r';<br />
k++;<br />
}<br />
else if (text[j] == 's' || text[j] == 'S')<br />
{<br />
text[k] = 'z';<br />
}<br />
<br />
}<br />
<br />
cout << "The new line is: " << text << endl;<br />
<br />
}<br />
<br />
int getLength(char inputText[])<br />
{<br />
int length = 0;<br />
while (inputText[length]!= '\0')<br />
{<br />
length++;<br />
}<br />
<br />
return length+1;<br />
}<br />
<br />
void moveLeft(char* inputText, int index)<br />
{<br />
for (int i = index; inputText[i] = '\0'; i++)<br />
{<br />
inputText[i] = inputText[i+1];<br />
}<br />
}<br />
<br />
void moveRight(char* inputText, int index)<br />
{<br />
for (int i = 100; i > index; i--)<br />
{<br />
inputText[i] = inputText[i-1];<br />
}<br />
}<br />
Any help that you could provide would be greatly appreciated! Thank you!
-Sam
|
|
|
|
|
I guess here is the mistake :
for (int i = index; inputText[i] = '\0'; i++)
you're assigning it ! Correct it as :
for (int i = index; inputText[i] == '\0'; i++)
Better keep habit of placing constants at left side of '==' and variables at right side while comparing (conditions). i.e.
for (int i = index; '\0' == inputText[i]; i++)
This would raise compiler error itself, if you put single '=', rather double '=='.
- Malli...!
|
|
|
|
|
It's a common mistake to simply look at a program's output in determining if it's correct or not. Instead, you should use the debugger and step through each line of code to verify whether or not it's doing what you expect. Using that approach, you can easily narrow the problem to a statement or two.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hai,
i want to create a thread pool which is having atleast 10 threads,
Normally we are creating threads using Createthread()API,
But how to create pool..and all...?
is any body knows reply me...
Thanks.
Mani
Born to win...!
|
|
|
|
|
|
hai..
thanks for reply,
one doubt....is IOCP method is like a thread pool method...or...what?
if i am using an IOCP method any thread pool will get create..? or...?how it is..?
could u pls tell me short and sweet...
Born to win...!
|
|
|
|
|
D.Mani wrote: if i am using an IOCP method any thread pool will get create..?
With IOCP, you are responsible for creating a pool of threads.
Any thread waiting on GetQueuedCompletionStatus() is part of the IOCP's "thread pool".
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hi,
Please post any help on parsing the excel file.
Regards,
Mayank
|
|
|
|
|