|
Ok I've found a solution: I can calculate the log10 of the number. I round the solution to integer value. This integer value will give me the number of zero of the number
for 5238.12 the log10 is 3.7192. So I know I have 3 zeros...
Negative numbers will give me the floating point position.
|
|
|
|
|
Cool!!!
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
Hi,
I have 25 dialogs who's contols have no access keys or tab order assigned to them.
I was thinking that these two processes are both automatable.
does anyone know of a solution that would auto-tab order and auto-access key my dialogs?
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
The controls do have a tab order. It's the one defined by which order they appear in, in the dialog template.
Steve S
|
|
|
|
|
I need to use a percentage in a dialog box to see the evolution of a process. Are there any functions for that? I would like to change a text field with the evolution of a Progress Bar. Do you have any idea ?
Thank's for advance
|
|
|
|
|
|
Hi another question... ok I've got CSplitterWnd working perfectly.
I create stuff with CreateStatic, and I wanna pass in a dialog resource (IDD_SOMETHING) designed in the resource editor to the view with CreateView... So how do I pass in CFormView into CreateView?
CreateView(0, 0, RUNTIME_CLASS(CFormView), CSize(0, 0), &ccontext);
does not work... or do i need to derive a class from CFormView and pass it in instead? please help... thanks in adv...
|
|
|
|
|
Yes, you should derive a class from CFormView . Remember to use DECLARE_DYNCREATE in the class declaration and IMPLEMENT_DYNCREATE for the class in a source file.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
hey all below is a bit of code that i am working on at the moment - it a region growing function.... initially i had it written as a recursive function, but i was running into problems related to running out of stack space. so i need to rewrite it as a non recursive function, but i am stumped as to how? Can anyone provide some hints or tips??
Recursive version of the function(s) follow
// Code is called by
void CAviView::RegionGrow(CPoint pt_in) // Issue when coming out of region growing process -
{
MessageBox("Region Growing function called", "Region Growing", MB_ICONERROR | MB_OK);
CPoint realxy;
int threshold; // Amount of difference allowed in order to pass test test-conducted to determine if similar enough for same region
BYTE r,g,b;
threshold = 50; // Use 10 as initial value for threshold on region growing
realxy.x = int(pt_in.y / m_smallestscalefactor); // SURE now, they are correct.
realxy.y = int(pt_in.x / m_smallestscalefactor);
m_bmp.GetRGB(realxy.x, realxy.y, r,g,b);
m_bmp.SetRGB(realxy.x, realxy.y, RGB(255,g,b)); // possibly get the original values for B and G
Check8Neighbours2(realxy, threshold);
//m_isRegionGrowing = false;
Invalidate();
}
//Actual recursive implementation of the function.
bool CAviView::Check8Neighbours2(CPoint pt_in, int thresh_in)
{
bool match = false;
int startbval = m_bmp.Get256Level(pt_in.x, pt_in.y); // initial brightness value of selected start pixel
BYTE r,g,b;
int threshold = thresh_in;
int testbval;
// Should this RegionMap be a local or a global variable??? - how does the recursive nature of this functoin handle it?
m_RegionMap = C256GreyDIBitmap(m_bmp.Rows(), m_bmp.Cols(), 1); // This bitmap should hold a map of which pixels lie in which regions regions are given by the 256grey level allowing for up to 256 different regions in any given image
m_RegionMap.Set256Level(pt_in.x, pt_in.y, 1); // 1 = In selected region, 2 /200 = NOT in selected region
CPoint new_pt;
for (int i = -1; i < 2; i++){
for(int j = -1; j < 2; j++){
int m=pt_in.x+i;
int n=pt_in.y+j;
int test2 = m_RegionMap.Get256LevelSafe(m,n);
if ( test2 == 1 || test2 == 200){
}
else
{
testbval = m_bmp.Get256LevelSafe(m, n);
if (abs(testbval - startbval) < threshold){
TRACE("\n trace test2");
m_bmp.GetRGB(m, n, r,g,b);
m_bmp.SetRGB(m, n, RGB(255,g,b));
m_RegionMap.Set256Level(m,n,1);
new_pt.x = m;
new_pt.y = n;
if (( (1 < m) && (m < (m_bmp.Cols()-1) ) && ( (1< n) && (n < (m_bmp.Rows()-1))))){
TRACE("\nFound 1 positive match");
Check8Neighbours (new_pt,threshold); // ?? Problem lies in the recursive calling of this function?????
}
}
else{
m_RegionMap.Set256Level(m,n,200); // USE 2 or 200 to designate a different region area. ie. pixel has been tested and thrown away as not in region1
}
match = true;
}
}
}
// Use bitmap display for visual check of R egionMap
CBitmapDisplayDlg test3(m_RegionMap, "Testing");
test3.DoModal();
return match;
}
|
|
|
|
|
I need to download end of file only,
of know size.
How to do it?
I searched WINHTTP and Wininet libraries reference,
and not find such a method,
but it is widely used in download managers.
Can someone point me a library and methods that can do this ?
(library can be else than two cited here, but free).
thanks.
|
|
|
|
|
You need partial downloading concept.. Read the RFC on HTTP 1/1 how to read partial file from the internet.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
I need people who read and understand,
but not sender far.
There is people who knows?
|
|
|
|
|
What kind of information are you looking at the end of the file? and how much end of the file ? after end of the file there is void.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
No need to understnd this.
need to do.
|
|
|
|
|
Then Just do it.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
I asked it at people there.
You only speak much.
Please better not making spam here,
I do not want to loose time to it, (as with your responces).
Dowes someone know how to use HTTP headers?
|
|
|
|
|
Ok you are the boss with the question.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
If you're using FTP, use FtpCommand to send a REST (RESTart) command before calling FtpOpenFile and InternetReadFile to get the data. See RFC 959[^].
If you're using HTTP, you can set the Range header to indicate which part of the document you want to retrieve. See RFC 2616 (HTTP/1.1)[^]. Send headers with HttpSendRequest .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Can you write C++ method,
even in concide form, to show using that header for http ?
This is my primary purpose for ask.
|
|
|
|
|
vgrigor wrote:
Can you write C++ method
yeah i will write it for you but my rate is $300 / hour and paid in advance.
|
|
|
|
|
How can a VC program detect the site address visited from the IE ?
|
|
|
|
|
I think what you are asking about is a Browser Helper Object (BHO).
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Actually we want a practial example.(i.e. code)
|
|
|
|
|
You can search here at CP, MSDN, and Google. You'll find tons of examples.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Can my program be notified if the address bar in IE is changed ? how?
|
|
|
|