|
Fetch the content in a CString type variable and then use the TrimRight() function with no parameters. When used with no parameters, TrimRight removes trailing newline, space, and tab characters from the string.
Vikram Kashyap
"You will never fail until you stop trying"
|
|
|
|
|
Fetch the content in a CString type variable and then use the TrimRight() function with no parameters. When used with no parameters, TrimRight removes trailing newline, space, and tab characters from the string.
Vikram Kashyap
"You will never fail, until you stop trying"
|
|
|
|
|
winzip setup is a single program with exe extenstion, such as winzip80.exe.
But it is a zipped file also - we can use winzip to unzip the exe file.
the exe file is also self-executable - we can run it by double click it.
OK, I want to create a file similar to the exe file programmatically:
1) with exe as extension
2) contains multiple file inside (a zipped file) and can be unzipped by winzip.
3) self-executable by double click it.
do you have idea to implement the file?
thx
includeh10
|
|
|
|
|
|
Hi,
thanks, it looks very good, but...
I have simply tested the program as following:
1) put several files in source folder, one of them is an exe file: try.exe
2) name an output file: my.exe (the file doesn't exist)
3) select try.exe as auto-execute program
then click Action menu: "build self-execute program"
an error message appears:
"Fail to update the resource table of the self-extract executable file!"
do you know what problem it is?
(I didn't read code)
thanks
includeh10
|
|
|
|
|
I know why: I use win98 (My users even use win95).
UpdateResource function is for NT/2K only.
problem!
includeh10
|
|
|
|
|
Hi,
I am currently having a discussion at work.
If I have the following code:
int m_nNumber = 0;<br />
void Increase()<br />
{<br />
m_nNumber++;<br />
}
Is this code threadsafe or should it be:
CCriticalSection m_cProtect;<br />
int m_nNumber = 0;<br />
void Increase()<br />
{<br />
m_cProtect.Lock();<br />
m_nNumber++;<br />
m_cProtect.Unlock();<br />
}
In other words, will the ++ operator be called atomic (in one clockcycle).
Hope someone can help me.
Regards,
Peter.
|
|
|
|
|
++ is not an atomic operator. See InterlockedIncrement in MSDN.
"though nothing
will keep us together
we can beat them
for ever and ever"
rechi
|
|
|
|
|
Agreed, Good point.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Simply no the code is not thread safe. Using critical section will work just fine. Although I would write it a little differently.
CCriticalSection m_cProtect;<br />
int m_nNumber = 0;<br />
void Increase()<br />
{<br />
CSingleLock lock(&m_cProtect, true);<br />
m_nNumber++;<br />
}
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi!
I just try to implement class with members which return const values:
class MyClass{
* * *
protected:
float GetVal() const {return val;}
private:
float val;
}
It compiled well without "const" but with it I got multiple errors. I can not avoid of use "const" becuse I must follow
some coding style.
So your help is very essential for me.
I code in VS 6.
|
|
|
|
|
You function return value why const ?
|
|
|
|
|
The code you posted compiles fine on vc6. Did you missed something ?
There is no spoon.
mail
|
|
|
|
|
What errors did you get?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Thanks to all.
I just fix it.
The metter was not in "const" but in member name.
|
|
|
|
|
Like Mad___ said, you are returning a value - why would you want to return a const value? Isn't it the member, val, that is const?
The method doesn't know the type of variable the return value is being stored in?
Can anybody help please?!!?
Cheers
Angel
===========================================================
The sooner you fall behind, the longer you have to catch up
|
|
|
|
|
As I said I MUST code in certain style. So 'const' comes out of it.
|
|
|
|
|
You must add const in return type.
Like this:
const float GetVal()const {return val;}
Because the type of val had been upgraded into "const float" in the GetVal function.
|
|
|
|
|
hi all,
I am doing a Project using MFC.But I want to import a DLL.(name of the dll is "toks.dll").
How can I get details of Methods in that DLL file?.I want to get names of Methods,Return value of the Methods like that..
Can anybody please tell me how to get details of Methods in DLL?
thanks in advance.
|
|
|
|
|
open the dll using the depends.exe that comes with visual studio tools. dont know whether it gives the information on the method signature.
There is no spoon.
mail
|
|
|
|
|
A DLL can expose the method names, (see the suggestion to use Depends.exe to find these out), BUT that's only part of the problem. There is no way for C functions to expose their return type or parameter list, so without this information you are hosed. Can't you get a header with the function signatures for this DLL?
¡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
|
|
|
|
|
hey every one... well maybe the title is not good enough to explain what is in my mind, but what i want to do is:
an edit box + button
and when i enter text in the edit box and click on the button then it will copy the text inside the edit box and pasting it.... i hope that i made it clear... so any way to do it?
thanks alot
|
|
|
|
|
Dody_DK wrote:
...it will copy the text inside the edit box...
Use GetWindowText() for this.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
oki, does GetWindowText() only copying... or copying and pasting?
and if it is only for copying.. what i should use to paste?
thenks alot
|
|
|
|
|
GetWindowText() gets the text, SetWindowText(text) sets the text.
Where are you pasting the text to?
Artificial intelligence is no match for natural
stupidity.
|
|
|
|