|
If you have the source code for the application, try setting breakpoints to zero in on where the blackout is occurring. When you locate the exact statement that's doing it, it will probably tell you what the problem is.
|
|
|
|
|
When i run application its working fine ,this situation occur after running application for a long time .
so i m unable to find out even with use of breakpoints.
When the black out situation occur i chek the task manager and find out these details
Memory(Private Working Set)-101,640 K
Handles 7,099
Threads 1,298
GDI Objects 145
please help me...
|
|
|
|
|
Hi all,
I am reading some values from command line and i want to replace them with other values.
Command line input ranges are from (50,51,52,........... 480,481,482)
I need to replace with (172,171,.....0,-1,-2,...-260)
Here is my code:
int main(int argn, char **argv)
{
char c;
int h;
double Pos[9];
double pd[6];
double test=51;
printf("\nEnter position (val1, val2,val3,val4,val5,val6,val7,val8,val9):\n");
for(h=0; h<9; h++)
scanf("%lf",&Pos[h]);
if(Pos[7]=="50")
Pos[7]=172
if(Pos[7]=="51")
Pos[7]=171;
if(Pos[7]=="52")
Pos[7]=170;
return 1;
}
Can someone help me how to do.
Thanks
Raj
|
|
|
|
|
I don't understand the details of your requirements, however for sure you must take advantage of the linear relationship between the input and the output range:
newValue = 222 - originalValue;
|
|
|
|
|
Your transformation law is
y = 222 - x
(y = 172 - (x-50))
Cannot you simply apply it to the input data?
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]
|
|
|
|
|
Don't use doubles for integer values, it will only cause you problems. As stated by both Luc and Carlo, you have a simple calculation to do on each input value, you can then store or output the new values as required.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Loop in X to Y, where
X = first command line Value(Convered to Int)
Y = Last command line Value (Converted to Int)
output = Y - X - 260;
Thanks
Anand
Thanks,
Anand.
|
|
|
|
|
Apart from the fact that you could simplify the code as suggested by others, there are a number of immediate problems with this bit of code:
raju_shiva wrote: if(Pos[7]=="50") Pos[7]=172
First, Pos[7] is a double - in C if you compare Pos[7] to "50", which is a null-terminated string not a numeric value, you will not get what you expect. That line should be:
if(Pos[7]==50)
Second, even with that change, it will almost certainly not work, because comparing floating-point value to an integer is unlikely ever to give a match. Change Pos to an array of integers instead.
Third, you are missing the terminating semi-colon at the end of the next line, which should be:
Pos[7]=172;
|
|
|
|
|
Hi
i have one cpp file. i want Programmatically parse this cpp file.
Then i got all function name with argument name from parsing cpp file output.
please any idea?
Regards,
M.Mathivanan
|
|
|
|
|
It's a bit (euphemism) tricky parsing a C++ file.
If you're lucky the source file you need to process use a small subset of the C++ language expressive power and then you may write down the parser without too much effort.
Parsing tools like bison[^], ANTLR[^] or the lua LPeg library[^] may greatly help you in the development.
Good luck.
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!
I've ten images. I've stored them in an array. For evey 6 seconds I've to load each image. i.e initially, I've to load the first image. After 6 seconds, I've to load the second image. After 12 seconds, I've to load the third image etc. How to do this?
|
|
|
|
|
1:add WM_TIMER message;
2:if(time%6==0)
{
show the second image
}
|
|
|
|
|
void CLoadImagesDlg::OnBnClickedOk()
{
this->SetTimer(110, 6000, NULL);
}
void CLoadImagesDlg::OnTimer(UINT_PTR nIDEvent)
{
static int i = 0;
switch(nIDEvent)
{
case 110:
if (i >= 10)
this->KillTimer(110);
break;
}
}
public:
afx_msg void OnBnClickedOk();
afx_msg void OnTimer(UINT nIDEvent);
private:
HBITMAP m_bitmap[10];
我爸是李刚
|
|
|
|
|
Im a newbie in MFC
Does anyone can help me build a small tool to rename multiple filenames in a folder like this:
- all filename are unicode with sign
- rename each filename to a new one without sign
aàáảãạăằắẳẵặâầấẩẫậ------->a
AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬ------->A
ÒÒÓỎÕỌÔỒỐỔỖỘƠỜỚỞỠỢ------->O
EÈÉẺẼẸÊỀẾỂỄỆ------------->E
UÙÚỦŨỤƯỪỨỬỮỰ------------->U
IÌÍỈĨỊ------------------->I
YỲÝỶỸỴ------------------->Y
Đ------------------------>D
oòóỏõọôồốổỗộơờớởỡợ------->o
eèéẻẽẹêềếểễệ------------->e
uùúủũụưừứửữự------------->u
iìíỉĩị------------------->i
yỳýỷỹỵ------------------->y
đ------------------------>d
Example: người mình.mp3 ----> nguoi minh.mp3
Thank you for all ur help!
|
|
|
|
|
What is your trouble about?
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]
|
|
|
|
|
In some cases there is a direct one to one relationship between a Unicode character and its ASCII equivalent, but not in all. For the latter case you need to create a translate table for all the accented characters that maps them to their non-accented equivalent. Which part of this problem are you having trouble with?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi,
As already stated by Richard you need to map the accented characters to their non-accented counterpart.
Here is a way of doing it, with your inputs:
#include <string>
#include <algorithm>
#include <iostream>
struct StringChanger
{
struct CharChanger
{
std::wstring change;
CharChanger(const std::wstring str) : change(str)
{}
wchar_t operator()(wchar_t wc)
{
return change.find(wc) != change.npos ? change[0] : wc;
}
} changer;
StringChanger(const std::wstring& str) : changer(str)
{}
void operator()(std::wstring& s)
{
std::transform(s.begin(), s.end(), s.begin(), changer);
}
};
StringChanger changers[] =
{
L"aàáảãạăằắẳẵặâầấẩẫậ",
L"AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬ",
L"OÒÒÓỎÕỌÔỒỐỔỖỘƠỜỚỞỠỢ",
L"EÈÉẺẼẸÊỀẾỂỄỆ",
L"UÙÚỦŨỤƯỪỨỬỮỰ",
L"IÌÍỈĨỊ",
L"YỲÝỶỸỴ",
L"DĐ",
L"oòóỏõọôồốổỗộơờớởỡợ",
L"eèéẻẽẹêềếểễệ",
L"uùúủũụưừứửữự",
L"iìíỉĩị",
L"yỳýỷỹỵ",
L"dđ"
};
int main()
{
std::wstring str = L" người mình.mp3 ";
std::wcout << str << std::endl;
for (StringChanger* s = changers; s < changers + sizeof changers / sizeof StringChanger; ++s)
(*s)(str);
std::wcout << str << std::endl;
return 0;
}
cheers,
AR
Edit: This is not very efficient, see a better way requiring VC2010 here[^].
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
modified on Sunday, November 28, 2010 4:31 PM
|
|
|
|
|
Hi all,
i find out the available port on machine using CreateFile function.
i also want to find out these names.
please tell me how can i find out these names here.
thanks in advance.
|
|
|
|
|
This is yet another question that you could try putting to Google. How many times do we need to suggest that?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi all,
i m using 4 CUIntArray,all are having some values.
i want to find diffrent entries form all array and put in the final output array without repeating tha values.
please tell me how can i do this.
thanks in advance.
|
|
|
|
|
You may:- Implement yourself the algorithm that verifies if the value candidate for insertion is already present in the destination array.
- Use a destination container that provides automatically such a facility, like, for instance the std::set[^].
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]
|
|
|
|
|
hello guys....im compiling a small program but this error is coming. I dont know where I am missing what? This is MFC generated code. Here is the starting code of the function...AfxEnableControlContainer() is creating all the problem
BOOL CMyApp::InitInstance()
{
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
...............
...............
...............
|
|
|
|
|
What is the exact text of your message? If it really is as above then find a reference to the variable or function xxxxx in your source code.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
As mentioned in the original post, AfxEnableControlContainer() is the identifier that is not found. I tried to get definition, declaration and all the references to it but could not find any.
A messagebox pop ups saying "The symbol AfxEnableControlContainer() is not defined/referenced"
|
|
|
|
|
This MSDN page indicates afxdisp.h has the header containing the symbol definition.
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]
|
|
|
|