|
use __int64.
__int64 nNum1 = 999999999999;
__int64 nNum2 = 111111111111;
__int64 nResult = nNum1 - nNum2;
nave
|
|
|
|
|
How can i convert sring to _int64? because my "9999 9999 9999" and "1111 1111 1111" is a string. I need to convert these string values to _int64 and do the subtraction. after do the operation, i need to convert the result from _int64 to string. is there any way to do it?
Thanks a lot.
Regards,
Ram
|
|
|
|
|
Ram Murali wrote: How can i convert sring to _int64?
use _atoi64() to convert string to _int64 type.
and after convertion use _i64toa() to convert it back to string.
nave
|
|
|
|
|
Thanks for your information. I found the function to convert the string value to the _int64.
CString str = "999999999999";
_int64 val = _atoi64(str);
Thanks again.
Regards,
Ram
|
|
|
|
|
Hi,
GetMediaType and DecideBufferSize require to know the image width and height from the get go. Is it possible to set the buffer size and stuff after we have started the directshow graph or does all the buffer values need to be known before we begin running the filters.
Thanks
|
|
|
|
|
godspeed123 wrote: Is it possible to set the buffer size and stuff after we have started the directshow graph
See Dynamic Format Changes in DirectShow[^]
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I have got a list view control with the LVS_ICON style. The icons that I use are 64px by 64px. They work fine and are displayed correctly, however, if one of the items is selected, then a blue semi-transparent selection rectangle covers the image. How would I get rid of this, or make it so that the blue selection rectangle only covers the white area of the icon image?
I'm writing in plain C/C++, so no MFC
Thanks for your help!
--PerspX
|
|
|
|
|
if you set the LVS_EX_BORDERSELECT extended style, you can make only the border of the items highlighted instead of the whole item during seelction.
nave
|
|
|
|
|
I create a SDI appication and split the main frame to rows and columns using CreatStatic()and CreateView() for each of the splitter frame. It works fine. In One of the pane frame, I display the graphic rectangle and text using FillSolidRect(), and DrawText(), and these rectangles and text need to redraw every time to update system status. To do that, I call InvalidateRect(NULL,FALSE) in OnDraw() to redraw this window frame. It is working fine also. But some how by calling InvalidateRect(NULL,FALSE) all of my modal dialogs in my application doesn't work any longer causing my application to hang ( no response from any buttons in toolsbar). If I commented InvalidateRect(NULL,FALSE) all of my modal dialogs work but then the graphic rectangles and text no longer redraw and update. Help!!!!
|
|
|
|
|
As before i have problem when i try to exam a string that i had took it from a file
The problem (via debug) i detected it was that it doesnt get the last letter of this string
the LineRead (buffer) is correct contains all the letters but when i do LineRead.GetAt(LineRead.GetLength() - 1) it return me nothing
As a result when i create .exe and run it throw me windows error (and when i try to detect the problem ) it throw me an exception
my workspace[^]
input text file[^](you select it via Select bottun)
|
|
|
|
|
Immunity18 wrote: the LineRead (buffer) is correct contains all the letters...
How are you verifying this?
For future reference, you do not need to include PCH, NCB, TXT, OPT, APS, CLW, or PLG files when archiving a project. Those files, as well as the Debug and Release folders, get rebuilt.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
By the way you teach me DEbug and see the values on each variable
|
|
|
|
|
Ok, then can you show a relevant code snippet?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
void CBayesDlg::OnCalc()
{
int nStart;
UpdateData(TRUE);
nStart = 1;
if (nStart ==1)
{
ReadFileII();
}
UpdateData(TRUE);
}
void CBayesDlg::ReadFileII()
{
double rn = 0;
double ry = 0;
CString FilePathName;
CString LineRead ;
const int sz =100;
char buf[sz];
int rCount = 0;
CString str;
FilePathName = m_FilePath;
ifstream FileText(FilePathName);
while(FileText.get(buf,sz))
{
FileText.get();
LineRead = (LPCSTR) buf;
Compare ( LineRead,rCount);
rCount = rCount +1;
}
int a=0,b=0,c=0,d=0,e=0,n=0,y = 0;
for (int i = 0 ; i < (rCount) ; i++)
{
if ( m_Array[i][5]== "N" || m_Array[i][5] =="n")
{
n = n +1;
if ( m_Array[i][0] == m_A)
{
a = a+1;
}
else if ( m_Array[i][1] == m_B)
{
b = b+1;
}
else if (m_Array[i][2] == m_C)
{
c = c +1;
}
else if (m_Array[i][3] == m_D)
{
d = d +1;
}
else if (m_Array[i][4] ==m_E)
{
e = e +1;
}
}
}
if ( rCount && n != 0 )
{
rn = (double) (n/rCount)*(a/n)*(b/n)*(c/n)*(d/n)*(e/n);
}
else
{
rn = 0;
}
if ( rn > ry)
{
m_R = "NO";
}
else if (ry > rn)
{
m_R = "YES";
}
FileText.close;
}
void CBayesDlg::Compare(CString line, int y)
{
int v = 0;
CString word;
CString tab = "\t";
int x = line.GetLength();
for (int i = 0 ; i < x ; i ++ )
{
if ( i==0)
{
word = line.GetAt(i);
}
else if ( i>0 )
{
if ( line.GetAt(i) != tab)
{
word = word + line.GetAt(i);
}
else if (line.GetAt(i) == tab)
{
m_Array[y][v] = word;
word.Empty();
v = v +1;
}
}
else if (i == (x -1))
{
m_Array[y][5] = line.GetAt(i);
}
}
}
-- modified at 8:56 Wednesday 30th May, 2007
|
|
|
|
|
What exactly is your project doing with the text file? I'd like to step through your code, but I need to know what to expect for that to do any good.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
omg i think i found it :/
i have inside for 3 if
if (i ==0)
{}
if (i>0)
{}
if( i== (x-1))
{}
x-1 >0 so i had to put the 3rd if inside 2nd
i correct it and now my program works
1 whole week trying to fingure out. So i will have to watch about that false in the other 2 project
I think that's the problem I hope you agree with me David or i have to dive deeper !
|
|
|
|
|
Immunity18 wrote: I hope you agree with me David or i have to dive deeper !
I wouldn't know without stepping through it myself. After looking at your code, however, I did find several places that need attention.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
could you printscreen and mark them on paint ? and give me a link so i could look on that ?
|
|
|
|
|
hm and something else
when i debug how i move the for () loop?
i mean it so me variables for i = 0 how i make it to move and show me the variables for i = 1?
|
|
|
|
|
Immunity18 wrote: i mean it so me variables for i = 0 how i make it to move and show me the variables for i = 1?
F10 = step over
F11 = step into
Shift+F11 = step out
Ctrl+F10 = run to cursor
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanks
|
|
|
|
|
I wonder, how do I change the name of my main dialog window when my MFC program is running? (from the program itself)
I'm working on a Dialog based MFC application in vc6.0)
thanks!
//Johannes
|
|
|
|
|
Hi
You can use SetWindowText("New Title");
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Thanks Zainu!
That works perfectly!
//Johannes
|
|
|
|
|
Hi,
I am using the CPushSource Filter as a step to get my filter working, I have the Pushsource working nicely.
I have a camera that requires a callback in which it sends all the images to, I simply want to take this data and transfer it to the filter but I want to do it using a callback or any other method that is efficient.
Is there any way of doing this?
Thanks in advance
|
|
|
|