|
Thanks dear Ryan Binns! It worked with _T("e"). Thanks a lot .
Using same replacesel I am unable to put the characters above 128. Is there any way to do that ?
Thank you again.
Jai Srimannarayana
|
|
|
|
|
Hi there
We've tried to write a screensaver that starts (a bit after it starts) and stops (after it stops) a service using the codeproject ServiceHelper class here: http://www.codeproject.com/system/cservicehelper.asp
the problem is that the screensaver runs fine when a user is logged in, but when they're logged out, there are no privileges granted to the process, so we get ERROR_ACCESS_DENIED from the call to the service control manager.
Can anyone help us think of a workaround?
|
|
|
|
|
Can we know, is your purpose to only start or stop this service if YOUR screensaver is running?
Or would you want this to happen for ANY screensaver?
Also, I just examined the source for the service helper class, and it asks for SERVICE_ALL_ACCESS just to start and stop a service. Why don't you try 'relaxing' the requirement to SERVICE_START for starting and SERVICE_STOP for stopping and see if that helps.
|
|
|
|
|
I want to add a button to the title bar. How can I do this using the API Windows ?
Thank in advance.
|
|
|
|
|
|
Thank Alok !
|
|
|
|
|
CryptAcquireContext(&cspContext,UserName,MS_DEF_PROV,PROV_RSA_FULL ,0); returns an error ERROR_FILE_NOT_FOUND ( 2L )
Anybody knows why ? How to getrid of this error ?
Sandeep Naik
|
|
|
|
|
Hi,
When I have designed my application, I had a class (CVerifiPoteau) that was inheriting from a base class (CPoteauBeton).
Now I want to serialize my class CVerifiPoteau and I have added another inherited class : CObject.
See my code here :
class CVerifiPoteau : public CPoteauBeton , public CObject
It seems to work properly since it respect C++, but I want to know if it can cause some difficulties with MFC (Visual Studio.NET 2003 C++).
Thanks,
Claude
|
|
|
|
|
Why would using a class that comes with MFC cause problems in MFC ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
Why would using a class that comes with MFC cause problems in MFC ?
Multiple inheritance and MFC does not mix particularly well See my answer below for the problem that I found.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Although it shouldn't make a difference, the MSVC++6 compiler was dependent on the order in which the classes appeared in the derivation list for multiple inheritance. Consequently, it often caused very wierd runtime errors if the MFC class was not the first class in the derivation list. As a general rule, make the MFC class the first class in the derivation list (swap the two around in your example above) and it should work fine.
I don't know whether the same problem appears in the .NET 2003 compiler, but I would still put the MFC class first.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
wouldn't the following be better ?
class CPoteauBeton : public CObject {};
class CVerifiPoteau : public CPoteauBeton {};
Serge
|
|
|
|
|
I have to change color of some characters in RichEdit control.
It’s not difficult do with SetSel function and SetSelectionCharFormat.
But I have to change many characters in different colors, and it takes too much time.
How can I do it faster ? Perhaps without using by selection functions.
|
|
|
|
|
scanf wrote:
How can I do it faster ?
You could try using the StreamOut method to get a copy of the raw RTF, modify the RTF (it's just text - not too difficult to process), and then use StreamIn to put the new RTF into the control.
Parsing RTF is a bit tricky, but it will be quicker than using the formatting functions (which have to modify the RTF as well as updating the display)
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Yeah that’s a good direction.
static DWORD CALLBACK <br />
MyStreamOutCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
And really not difficult.
Thank you for help.
|
|
|
|
|
I want to create a shortcut within my Visual C++ program and put it in the All Users Startup directory. Anyone know how? Thanks, GAF
|
|
|
|
|
|
hello friends
plz help me in this problem. i m making an intrusion detection system using vc++, in this output of sniffer has to be written in text file. is there is any function for that.
thanx
bye
|
|
|
|
|
(all platforms) C/C++ functions: fopen, fclose, fwrite, fread, fprintf, fputs, fputc.
(Windows specific) C/C++ functions: CreateFile, CloseHandle, WriteFile, ReadFile.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
thanx for ur reply
but can u send a small module in which it takes an output of exe file and write it in text file
bye
|
|
|
|
|
The functions I listed assumed that the exe file was one that you wrote your self. If not you could probably write a program that uses shell programming to capture the output and copy it to a text file, but that would be the (VERY) hard way. If the exe writes the output to stdio/screen/console (standard I/0), then I would look into using redirection. That is you could add redirection command to the short cut.
I have not used redirection for several years, but this is basicaly how it worked in DOS:
SomeProgram.exe > output.txt
What that does is sends the output to the text file, instead of the screen.
Anyway, maybe you should do a search for redirection on the command line.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Are you using MS-DOS based? or MFC EditBoxes?
MFC EditBox...
<br />
#include "fstream.h"<br />
<br />
CString strE1Input;
CString strFilename;
GetDlgItemText(IDC_EDIT1,strE1Input);
strFilename = "Info.txt";
ofstream a_file ( strFilename );
a_file<< strE1Input;
a_file.close();
**Hope that helps... If ur using MS-DOS (Windows App) let me know**
/* Just a Human Trying to Live in a Computers World. */
|
|
|
|
|
MS-DOS based...
<br />
#include "fstream.h"<br />
#include "iostream.h"<br />
<br />
using namespace std;<br />
<br />
int main()<br />
{<br />
char first[50];<br />
char answer[2];<br />
<br />
cout << "Enter First Name:";
cin>>first;
cout << "Your Name is:" << first << "." << endl;
cout << "Is this Correct? (y/n)" << endl;<br />
cin>>answer;<br />
<br />
if (answer == "y") {<br />
ofstream a_file ( "Names.txt" );
a_file<< first;
a_file.close();
cout << "Saved in Names.txt" <<endl;<br />
}<br />
if (answer == "n") {<br />
}<br />
else {<br />
}<br />
}<br />
Forgive me if this doesnt compile... Just a quick type out...
/* Just a Human Trying to Live in a Computers World. */
|
|
|
|
|
Why didn't you list the way to do it in C++ ? ifstream/ofstream rocks, fopen/fclose totally sucks.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
1) I admire your work!
2) In my opinion, ifstream/ofstream sucks!
3) We are way off the subject of the post (personaly I do not care).
Since he appears to redirect the output to a file.
As for item (2), it is too complicated. If some one does not understand the list I gave (looked it up), then they (all though they could use ifstream/ofstream) they would not understand how it works.
File objects are like every thing else in C++ (only more so!), you need to know 10x as much as you do inorder to do the same thing in C; or to put it anouther way, you are offten - shooting in the dark.
C is straight forward, either you do it right or you do not; there is no in-between.
Do not get me wrong, I love C++ (up to a point). But, it hides to much of the details.
I am a believer in the KISS principle and C++ is based on the the KIC (keep it coplicated) principle.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|