|
How can I make a CString to a int?
I have a CString with numbers let's say 30 and I need to count down that so I get to zero. I cant use a int to start with it need to be a CString. But I need to convert that CString to a int? But how can I do that?
|
|
|
|
|
use _ttoi() function
Yuvaraj N
|
|
|
|
|
Ok but how do I set up this?
|
|
|
|
|
Supps
CString ValueString=_T("30");
then
int Value=_ttoi(ValueString);
Yuvaraj N
|
|
|
|
|
|
CString str = "32";
int i;
sscanf((LPCTSTR)str, "%d", &i);
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
It can be a solution for all platforms, only you have to create a normal window - not message only - a bit more overhead, but should work.
If you want to receive a message, you need a window (WM_ stands for Window Message ) for window you need a message pump...
Or might be there will be a better way how to detect the windows shutdown, but I don't know them from the head now.
|
|
|
|
|
Can I add active GIF onto a dialogue box under Visual C++6.0? Using Window OS from Win98, Win98SE, Win2000 and WinXP.
On Visual C++ 6.0, how to I identify a user who is having what kind of privileges? (i.e admin privilege, etc)
|
|
|
|
|
hello all,
cau any one tell me, in VC++ what messege do i need to send in the button function so that when ever the user clicks the button on the dialog box which is created in an SDI application, the cursor moves up in the client area , where my button is member dialog class and object of button class
void MyDialog::OnButtonup()
{
short caps=GetKeyState(20);
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
if( (TRUE && !(keyState[38] & 1))||(!FALSE && (keyState[38] & 1)) )
{
// Simulate a key press
keybd_event( 38,0x45,KEYEVENTF_EXTENDEDKEY|0,0);
// Simulate a key release
keybd_event(38,0x45,KEYEVENTF_EXTENDEDKEY|KEYEVENTF_KEYUP,0);
}
}
but this code dos't compelete my requirement
|
|
|
|
|
Hi,
I am working with MDI application. I want to ovverwrite ID_APP_EXIT, File->Exit menu function of Mainframe menu. When I click on this menu option or on the close icon button of Main frame, I should check for a particular condition and then allow to exit the application if condition is true or else I should not allow the user to exit.
I am able to overwrite and check the condition, but unable to close the application if condition is met. If I used PostQuitMessage(0), it's getting closed but I'm getting lot of memory leaks due to this function.
Can anyone please help me to do this?
Thanks
Madhavi
|
|
|
|
|
Try
AfxGetMainWnd()->PostMessage(WM_CLOSE);
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Everywhere it says: "Create project by going to Other Projects/Extensibility Projects". I don't have that! OTOH I don't have the Pro version of VC++. Is that needed ? I've download the VSIP 2003 SDK, that don't help either
/Rob
|
|
|
|
|
File > New... > 'project'
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Thanks, but... that was what I said. There are no "Extensibility Projects" and thus no Add-in wizard
|
|
|
|
|
i use VS pro and i never see this either sorry
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Hi!
I need to draw some information on screen, without having to create a window. Here my code:
<br />
CWnd* pDesktop=GetDesktopWindow();<br />
CDC* pDC=pDesktop->GetDC();<br />
CBrush* pOldBrush=(CBrush*) pDC->SelectStockObject(BLACK_BRUSH);<br />
CPen* pOldPen=(CPen*) pDC->SelectStockObject(NULL_PEN);<br />
pDC->Rectangle(0,0,100,100);<br />
pDC->SelectObject(pOldBrush);<br />
pDC->SelectObject(pOldPen);<br />
pDesktop->ReleaseDC(pDC);<br />
This code is not working, nothing appears on screen!
What's wrong? Do I need to create a transparent window and draw on this window?
Thks in advance!
Appstmd
http://www.atlence.com
|
|
|
|
|
Hi. I’m a VC++ programmer that have plans to use some functionalities from MSN Messenger into my programs.
I need some kind of tutorial on how to start… I’ve earlier coded against MS Outlook and MS PowerPoint so think I could get most things quite fast.
Really need some tips on where to start!
_____________________________
...and justice for all
APe
|
|
|
|
|
How can i copy a system file that is already in use
CopyFile fails with error GetLastError -> 32
i am tring to copy SAM,SOFTWARE...(Registry) files in XP
i have an application that backs up registry and it is copying all files to a folder
do i need some security tokens to copy these files
please help
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Any good suggestion or links for taking MCSD Exams for VC++ ?
|
|
|
|
|
Hello Friends,
I am having CListView in which I am displaying some image and underneath them I having some text. The Main problem is that whenever the text is not having sufficient space then its displaying ... and when I select the text gets wrapped to the next line.
Please give me a solution for not displaying the three dots(...) and the text should be displayed on the next line.
Thank you in advance.
Neelesh K J Jain.
|
|
|
|
|
Hi,
While I've never done anything with images and text in a ListView I have an idea that might help you. This is the same thing that happens if you look in any folder and the name is too long. The obvious reason you get the "..." is because displaying the full name could overlap with an image below the text. Each row has a certain height to it and if the text goes beyond the height it gets truncated. At least that's how I see it. So my idea is for you to manually override the row height and change it to make the text fit. I don't know if this definitely will work, but its worth a shot.
Edit: After messing around inside a folder, it seems that there usually is enough space to display most names without doing that. Maybe there is a property you can check to allow it to display?
|
|
|
|
|
HI ,
I wanna help on a simple application.
I have 2 applications in c language.
First application 'A' has some data being written in a text file 'T'.
Second Application 'B' simultaneously is reading that data from the same file 'T'(if any) and producing the desired output.
Can it b done n how.
amit mishra
|
|
|
|
|
set a flag in the registry (or in a temporary text file).
this way, by testing the flag before writing or reading, you could know if you are allowed to (or not)...
prog1 :
if (!flag) {
<font color=#0000FF>int</font> fd = fopen(<font color=#808080>"T"</font>);
fprintf(<font color=#808080>"some datas to write"</font>);
fclose(fd);
flag = <font color=#0000FF>true</font>;
}
prog2 :
if (flag) {
<font color=#0000FF>int</font> fd = fopen(<font color=#808080>"T"</font>);
<font color=#0000FF>char</font> strTab[100];
fscanf(<font color=#808080>"%s"</font>, strTab[0]);
fclose(fd);
flag = <font color=#0000FF>false</font>;
}
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
What you should do is lookup "Named Pipes". This is in essence exactly what you want to do. Do a search on SS_Log on Codeproject and you'll find the SS_Log_Server article that does exactly that.
|
|
|
|
|
a language question. i have the following:
-------------------
class BUFFER{
public:
char* string;
int size;
~BUFFER()
{
delete[size] string;
}
};
-------------------
void func1(BUFFER buf)
{
...
// on exit, the original "buf.string" will be deleted, because the
// destructor is called once
}
-------------------
void main()
{
BUFFER mf;
mf.string = new char[20];
lstrcpy(mf.string, "test");
func1(mf); // <-- after this returns, the mf.string
// was deleted once, and will be deleted the second
// time when "main" returns in the second call to the
// destructor, which will lead to an error
}
-------------------
The question is:
how can i override this behavior? i want the buffer in "string" pointer to be a copy of the original too - just like the "size" attribute, so there won't be a second delete called in destructor for the same pointer.
Thanks.
|
|
|
|