|
That was the problem, Mark. I had built debug dlls. Soon as I changed the project configuration I was able to load the librar. MAny thanks!
sb
|
|
|
|
|
for (x=>0; x=<255; y=>0; y=<127)
error C2059: syntax error : '>'
modified on Thursday, February 21, 2008 2:45 PM
|
|
|
|
|
1dayprogrammer wrote: but i can only produce 4 errors which i dont know how to resolve.
Don't you think it would help a lot if you would provide the exact error messages and on which line they appear instead of posting all your code ?
|
|
|
|
|
1dayprogrammer wrote: but i can only produce 4 errors
i never seen such a programmer, who is regretting that he was able to produce only few bugs.
Any way, specify the error and format the code within <pre> </pre> tags, it is difficult for others who finds some extra time from their schedule to answer.
|
|
|
|
|
Rajkumar R wrote: i never seen such a programmer, who is regretting that he was able to produce only little bugs.
How do you know his bugs are little?
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
|
|
|
|
|
but he regrets.
|
|
|
|
|
- use
<pre> tags to surround code snippets. - Please report, for each error:
- the line of code wherein the error occurred
- the error message
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:
1. use pre tags to surround code snippets.
You know, for us non-web programmers, that's really unintuitive.
WTF is "pre"? Doesn't "code" make a lot more sense around code?
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: WTF is "pre"?
Short for PREserve, or PREformatted.
"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
|
|
|
|
|
Uhm...It is not P rogramming R are E xample acronym, is it?
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
|
|
|
|
|
Yeah - I thought it was "P rogramming R are E xample" (thanks cPallini )
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
1dayprogrammer wrote: ...but i can only produce 4 errors which i dont know how to resolve.
They have been fixed. Please try again.
"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
|
|
|
|
|
1dayprogrammer wrote: for (x=>0; x=<255; y=>0; y=<127)
Should probably be:
for (x = 0, y = 0; x <= 255 && y <= 127; )
... If not, you'll have to explain what you are doing, but with a bit less ambiguity.
"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
|
|
|
|
|
for ( initialization ; condition_to_stop ; increment_expressions ) { }
Maxwell Chen
|
|
|
|
|
Hi Experts,
I am creating a Shell Context menu application. When I right click on any folder or file, I display the path of file/folder.
But If I click on file shortcut(.lnk) file it display the target path of file, although .lnk itself also a file.
I want to retrive shortcut (.lnk) file path.
How can I do this?
I will be very thankful to you.
|
|
|
|
|
I am able to open powerpoint slide showusing MFC.I am using power point type library and i am doing this from the msdn help automating powerpoint application using MFC.
The problem is this is opening powerpoint separately.
I want to create an activex control which itself holds the powerpoint slides.Basically my activex should behave like other container activex like web browser control
Please help me to do this.
|
|
|
|
|
If you want to create a control container the best way is probably to take a look at the "ActiveX Control Test Container" that shipped with VC6. The source code for it is availbale if you hunt around on Google and it contains a very thorough and pretty readable implementation of every single ActiveX container interface. I used this when I was writing a Powerpoint style app some years ago and my app was able to succesfully host actual Powerpoint shows in its douments as well as form controls, grids, its own controls and support scripting them all like a browser as well. It wasn't a small or an easy project but it would have been pretty much impossible without a rock solid working example of a general container.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
HI
i have a application to run my program in Service as SINGLE INSTANCE application .
i have done upto single instance sucessfully. when i move to run this application in service ,it fails to run.
can u tell how to create common GUI id in my application...
i have written SINGLE INSTANCE program in .cpp file
thanks in advance
k.guru moorthy
|
|
|
|
|
guru moorthy.k wrote: can u tell how to create common GUI id in my application...
if u r looking to get a unique id, Create GUID[^] may be useful.
guru moorthy.k wrote: i have done upto single instance sucessfully. when i move to run this application in service ,it fails to run.
not clear, does ur service works without the single instance code? did u try debugging?
|
|
|
|
|
Hi,
I have written a class as follows:
class A
{
char str[2];
public:
A (LPSTR Astr)
{
strcpy(str, Astr);
}
A& operator = (LPSTR Astr)
{
strcpy(str, Astr);
return *this;
}
};
I have created a variable of the class and trying to assign it some values using following code
A a1("aa");
and returning this variable from a function.
This is failing with the following error message
"Run_Time Check Failure#2 - Stack around the variable 'a1' was corrupted" when I do this in a MFC application. This is right since I am not leaving any space for the null character.
However when I am doing the same thing in the DLL, it is running perfectly. I am not getting why it is running in DLL and failing in direct Application?
Can anybody please explain?
|
|
|
|
|
Well, basically why bother if obviously broken code apparently works?
Anyway probably you have such information because MFC (at least in debug build) puts additional code to check memory corruption.
Your code is, BTW, dangerous in both the environments.
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
|
|
|
|
|
abhijitr wrote: char str[2];
This member variable does not have enough room for two characters PLUS the terminating \0 character.
"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
|
|
|
|
|
Also, the assignment operator fails to insure there will be no buffer overwrite. Simple assignments such as,
A Astring;
Astring = "too long";
will cause errors. Changing the size of the buffer won't be enough.
The arguments to the assignment operator should be constant; unless you intend to allow it to change its argument?!?
A& operator = (LPCSTR Astr)
{
::memset(str, 0, sizeof(str));
if (!Astr)
return *this;
int len = ::strlen(Astr);
if (len <= sizeof(str)) {
::strcpy(str, Astr);
} else if (sizeof(str) < len) {
::strncpy(str, Astr, sizeof(str) - 1 );
str[1] = '\0';
}
return *this;
}
Should probably check for the degenerate case of an empty string as well.
|
|
|
|
|
This should be between you and the OP.
"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
|
|
|
|
|