|
waiwai933 wrote: so I naturally forgot what an initializer is,
May be true , AFAIK initializers are for data types not for function, which gives initial values to variables.
waiwai933 wrote: but I'm pretty sure that it's not int.
iam not sure couple of years ago it was so.
return of main is same as calling exit function in main, it is used to return the success code of the application and it is int. u can avoid returning any value if the type of main is void. As a side note C++ doesnot assume default int for function return type (may be this is ur "pretty sure").
u can check whether main is using int by giving return type like double (where sizeof(return type) > sizeof (int) or user type)
waiwai933 wrote: this one line in my C++ code
In this line of C++ code, i think no issues. can u state what is the exact error statement.
waiwai933 wrote: Can anybody help?
I suspect some code above or below this function causing the error
say
struct MyStruct
{
}
int __cdecl main(int argc, const char* argv[])
{
in this case compiler says error in return type as it takes MyStruct as return type.
|
|
|
|
|
Unless you are passing arguments to main() and are returning a value to the command interpreter, you could simplify things by using:
void main( void )
{
...
}
"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
|
|
|
|
|
I seem to have stumbled upon a bit of a problem. My program is using several DLL's that I wrote (6 in total). When I use the URLOpenStream() call I get a weird error deep in one of the threads spawned by URLOpenStream. It seems to happen when xpsp2res.dll is loaded. What ends up happening is that the URL starts to load, then fails some point after xpsp2res.dll is loaded.
Googleing turned up some links indicating that this was a rebase problem, something I'd never heard of, or (as far as I know) run into before. The same codes works perfectly on a different machine (both machines are Windows XP SP2). The supposed solution is to explicitly specify a base address for my DLL's. Is this actually correct? Is there some other solution?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Rebasing is only an optimisation and need not be done explicitly. It just saves the system from having to go to the trouble if two DLLS occupy the same space.
Steve
|
|
|
|
|
I am starting a new side-project: I would like to scan file access in real-time and deny access if the windows file system wants to access a folder that I have deemed inappropriate.
Use Case:
whenever the Windows file system (i.e. as directed by my wife) accesses a file, I want to check the path against a list of blocked paths. If the path matches an item in the black-list then I'd like my app to deny access. To enable/disable this security I'll set an environment variable.
The problem is that I have no idea how to implement something like this; I've never experimented with real-time file access. I imagine it's pretty low-level.
Does anyone have any pointers to help me learn about real-time file access ? Is it even possible ?
|
|
|
|
|
abiemann wrote: Does anyone have any pointers
Right click on the file and select "Properties". In the Properties Dialog select the "Security" tab and set the User/Permissions however you want.
led mike
|
|
|
|
|
right, but we don't use log-in accounts on the PCs at home; our WinXP PCs default to an Administrator account when booting up to Windows.
|
|
|
|
|
abiemann wrote: right, but we don't use log-in accounts on the PCs at home;
So I guess you want me to reply with the obvious: "Then set them up and start using them". Well I'm not going to.
led mike
|
|
|
|
|
I've written a status bar control which works well, except for the height. I'd like a way to determine the right height for the control, taking into account XP themes's if they are present. I know there is GetThemePartSize() and the SP_PANE, but that doesn't seem to return a useful height (it's significantly smaller than what is actually used). Anyone know how to do this?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Jim Crafton wrote: Anyone know how to do this?
No but did you try using GetThemeMargins[^] in conjunction?
led mike
|
|
|
|
|
Nope, missed that one - I'll look into that.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Jim Crafton wrote: I'd like a way to determine the right height for the control...
Windows does it based on the size of the font.
"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
|
|
|
|
|
Yeah, that doesn't surprise me. But how *exactly* are they doing it? Are they just DLU units? As in saying that the status bar is 12 DLU's high based on whatever the current font you've chosen to use with the status bar? Or is there some other magic behind determining the number?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Jim Crafton wrote: Or is there some other magic behind determining the number?
They probably used advanced copies of Cobra. It's going to solve everything don't you know.
led mike
|
|
|
|
|
Hmm, Cobra, that's XML based right?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Someone voted your OP a 2 Although it could be a feature of the new ASP.NET site.
led mike
|
|
|
|
|
I guess I forgot add "plz must hve code in fast!" in the original query. I'll keep that in mind for the next time
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
I'm using VS 2008 C++ and when I write a file out using CStdioFile or CFile under file type I get "SQL Server Compact Edition Database File" does anyone if this is alright?
I expected to only see ".sdf" under type. Right clicking on the file and selecting properties the filename alog with the ".sdf" extension is there along with "SQL Server Compact Edition Database File". What's happening?
A C++ programming language novice, but striving to learn
|
|
|
|
|
I've come across some code that is structured like this:
do {
//stuff...
} while(FALSE);
What's the difference between that and just doing the items that are in stuff WITHOUT the do-while(FALSE) "loop"?
|
|
|
|
|
The difference is that the above code is entitled to stand on the top position of the Coding Horrors forum.
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
modified on Friday, February 8, 2008 3:06 PM
|
|
|
|
|
CPallini wrote: the Coding Orrors forum.
What means "Coding Orros"? I know what Coding Oreos[^] are but never heard of Coding Orros.
led mike
|
|
|
|
|
led mike wrote: What means "Coding Orros"?
Coding Orros refers to members of a family tree: http://www.genealogytoday.com/surname/finder.mv?Surname=Orros[^] who are better at making pizza than coding. http://www.yellowbot.com/orros-pizza-grill-saint-johns-fl.html[^] although obvious to us, it was not obvious to them. After seeing the pizza examples in head-first-design-patterns, you begin to realize how they thought that any pizza maker is automatically a programmer. As you see, the results of pizza makers writing software is extra cheese in our code.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
And I even made it bold.
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
|
|
|
|
|
CPallini wrote: And I even made it bold.
I've always said "That Pallini is nothing if not bold"
led mike
|
|
|
|
|
Maybe they were trying to exercise the compilers optimization capabilities?
led mike
|
|
|
|