Click here to Skip to main content
Email Password   helpLost your password?
Unanswered questions View unanswered questions in the C / C++ / MFC forum    RSS: RSS Feed
Home > Forums > C / C++ / MFC

You must Sign In to use this message board.
 
 
Per page  Date Filter 
 FirstPrevNext
GeneralRe: Handle to child windows in Start Menu?
Omnicoder
11:15 20 Nov '09  
If you mean you have to get the start menu 'dialog'/popup before getting the "Run" button on it then I agree.

Have you tried the Krypton Toolkit? http://www.componentfactory.com/free-windows-forms-controls.php

GeneralRe: Handle to child windows in Start Menu?
yeswekey
20:22 21 Nov '09  
Even GetMenu fails!

I want to find the coordinates of "Run..." that appears in the start menu.

Plz see this:
http://i626.photobucket.com/albums/tt346/yeswekey/run.jpg

I actually don't wanna change the text, but i want to find its coordinates Cry

-
S.V.Kaushik

Questionoperator over loading problem?
york528
7:22 20 Nov '09  
lately when I use STL map as a parameter in a function I have a problem?
such as:

void func(const map<struct>& mapUsed)
{
map<struct>::iterator iterMap = mapUsed.begin()
while(iterMap != mapUsed.end())
{
//do something
}
}

The vs2008 report an error and when I use const_iterator to instead random iterator
It's ok

And I wanna know If STL use "const" overloading such as operator == ...
If not ?
How dose STL do?

Thanks a lot! D'Oh!
AnswerRe: operator over loading problem?
josda1000
9:17 20 Nov '09  
map<struct> should be more like map<int, int> or something. you're indexing one type of thing to another type of thing. you're not just making a vector of structs. even then, if you are making a map of int->structs, then the data type has to be used. the map must know how large of an allotment of memory it has to block off for each part of the map. hope that made sense...
GeneralRe: operator over loading problem?
york528
23:43 20 Nov '09  
Hi,

I'm sorry that I made a mistake!

what I mean is when I use STL::map or else

Using iterator as a left value and a map&amp;lt;X,Y&amp;gt; as a parameter of a function

as bellow

void func(const map<X,Y> mapUsed)
{
map<X,Y>::iterator iterMap = mapUsed.begin(); //IDE report wrong here
while(iterMap != mapUsed.end())
{
//do something
}
}

mapUsed.begin() returned a const_iterator

it dosen't match with iterator

I was confusing that how dose mapUsed know itself is a const one and return const_iterator

Did the IDE do it for us or STL used some other way?

Thanks a lot!
GeneralRe: operator over loading problem?
Lim Bio Liong
23:25 22 Nov '09  
>> I was confusing that how dose mapUsed know itself is a const one and return const_iterator...

It depends on how "mapUsed" is declared for the function func :

void func(const map<X,Y> mapUsed)

since "mapUsed" is declared as a const, the compiler naturally uses the const_iterator.

- Bio.
GeneralRe: operator over loading problem?
york528
19:14 23 Nov '09  
I thought it is about the program language

Now I know the complier do this, Thank you

Poke tongue
GeneralRe: operator over loading problem?
Lim Bio Liong
0:10 24 Nov '09  
Most welcome york528   Smile
Questionpow function appears to fail randomly.
Member 2088
7:21 20 Nov '09  
This my program

int _tmain(int argc, _TCHAR* argv[])
{
int a=0;
double b=10;
double result = pow(b,a);
double r=0;
for(int aa=0;aa<30000;aa++)
{
for(int i=0; i<30000;i++)
{
for(int j=0; j<30000;j++)
{
r = pow(b,a);
if(r != result)
{
int error =0;
}
}
}
}
return 0;
}
I put a breakpoint on the int error = 0. It got hit when aa=0,i=19383,j= 26848.
Could this be a hardware problem or something else?
Running VS2008 with latest service packs.
AnswerRe: pow function appears to fail randomly.
Richard MacCutchan
7:43 20 Nov '09  
Member 2088 wrote:
I put a breakpoint on the int error = 0. It got hit when aa=0,i=19383,j= 26848.

What were the values of r and result at the time of failure?
GeneralRe: pow function appears to fail randomly.
Member 2088
8:03 20 Nov '09  
When it hit the error line
r = -1.#IND000000000000
a and b are correct.
GeneralRe: pow function appears to fail randomly.
Richard MacCutchan
8:14 20 Nov '09  
Member 2088 wrote:
When it hit the error line
r = -1.#IND000000000000
a and b are correct.

So what were the values? Also I asked what the value of result was.
GeneralRe: pow function appears to fail randomly.
Member 2088
8:46 20 Nov '09  
b=10.000000000000000
a = 0
result = 1.0000000000000000
GeneralRe: pow function appears to fail randomly.
josda1000
9:09 20 Nov '09  
Is this really the intent of the program, to never change "a" or "b"? because in this case, you'll always get a result of 1. So you'll be going in a double-nested loop for a long time to just get a result of 1...
GeneralRe: pow function appears to fail randomly.
Member 2088
12:55 20 Nov '09  
The point is to demonstrate the 'random' failure.
GeneralRe: pow function appears to fail randomly.
Richard MacCutchan
0:07 21 Nov '09  
The value -1.#IND indicates a number that cannot be represented (IND = indeterminate) and will be caused by a floating point error. This could well be a hardware problem but it is impossible to be certain.
AnswerRe: pow function appears to fail randomly.
dxlee
7:50 20 Nov '09  
Your program ran without a problem on my system. It never reached the break point.
QuestionRe: pow function appears to fail randomly.
DavidCrow
9:21 20 Nov '09  
Member 2088 wrote:
double b=10;
double result = pow(b,a);
double r=0;

What happens if you did:

double b = 10.0;
double r = 0.0;


"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons


AnswerRe: pow function appears to fail randomly.
Ted2102
13:45 20 Nov '09  
Are you only running the block of code above or is it part of a larger program? Taking over a buggy program in the past, I have had programs that malfunction when a variable name was changed from x to y. This was the result of memory errors that I had to track down and fix.
QuestionCode snippet for reading from a .xlsx file in VC++
V K 2
3:15 20 Nov '09  
Hi,
I have a excel file with two columns. Namely Binary Name, Binary Size. I need to read each binary name,size from the excel file and compare that with the Binary name and size in the corresponding installation folder.

Can I have a code snippet for reading the Binary Name, Binary Size from the .xlsx file

Thanks in advance.
AnswerRe: Code snippet for reading from a .xlsx file in VC++
Richard MacCutchan
3:42 20 Nov '09  
Try this[^], lots of good suggestions for you.
AnswerRe: Code snippet for reading from a .xlsx file in VC++
DavidCrow
4:21 20 Nov '09  
Are you wanting to use Excel Automation, or if you are using MFC, there's CDatabase and CRecordset which can read through an Excel file via ODBC.

"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons


QuestionGetting Error with msscript.ocx
Ash_VCPP
2:41 20 Nov '09  
Hi All,

Please look into the errors which i am getting, if someone has faced same then please tell me where i am going wrong.

Errors are:

fatal error C1083: Cannot open type library file: 'xceedcry.dll': No such file or directory(in utils.h)

error C2146: syntax error : missing ';' before identifier 'IWebBrowser'
(in exdisp.h)

fatal error C1004: unexpected end of file found(in exdisp.h)

Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....

AnswerRe: Getting Error with msscript.ocx
Richard MacCutchan
3:08 20 Nov '09  
Ash_VCPP wrote:
fatal error C1083: Cannot open type library file: 'xceedcry.dll': No such file or directory(in utils.h)

That seems fairly clear, the file 'xceedcry.dll cannot be found. Does it exist in your system and if so is it in the include path(s) for your compiler?

I suspect the other two messages are related to the first.
QuestionHow to change page header and footer EMF.SPL file ?
semaphore1
0:49 20 Nov '09  
Hello

I am developing virtual printer driver.The virtual printer have EMF spool file format.
I use windows default printer driver and forward print job at real printer.

I want to change in header and footer of .SPL(emf spool) file.Means i want put some default name in header and footer.

Is it possible to change via emf spool ?
or
Any other solution?

Thanks
Mahendra


Last Updated 10 Aug 2007 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010