|
G Haranadh wrote: _stprintf(str1,_T("The Sum is %d"),Add(10,20));
Try this...
_stprintf(str1,L"The Sum is %d",Add(10,20));
Hope this works
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
: error C3861: 'sprintf': identifier not found, even with argument-dependent lookup
: error C3861: 'L': identifier not found, even with argument-dependent lookup
Sorry. it gave two errors.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
lol
It is working fine here. Not the one I suggested but the one you gave
TCHAR str1[50]=_T("");
_stprintf(str1,_T("The Sum is %d"),Add(10,20));
MessageBox(NULL,str1,_T("Add"),NULL);
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
_stprintf(str1,L"The Sum is %d",Add(10,20));
use swprintf instead of _stprintf if u r using L"The Sum is%d"
|
|
|
|
|
Hope you included stdio.h header file.
and plus try using stprintf instead of _stprintf
<hr<span style="color:gray;size:15px;">-Prakash
-Prakash
-- modified at 11:39 Wednesday 28th December, 2005
|
|
|
|
|
did u include <stdio.h>
have u tried this
char *str1="";
sprintf(str1,"The Sum is %d",Add(10,20));
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I feel it wont work
char *str1="" is equivalent to const char *str
that means we cannot change the content of the address stored in str
|
|
|
|
|
Yeh u r right
but this works i have done it
int Add(int a,int b)<br />
{<br />
return a+b;<br />
}<br />
<br />
char str1[100];<br />
sprintf(str1,"The Sum is %d",Add(10,20));<br />
MessageBox(NULL,str1,_T("Add"),NULL);
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
it will work in case of array
there is a diff b/w array and pointer.No doubt in some cases array boils down to pointer
never say die
|
|
|
|
|
sunit5 wrote: char *str1="" is equivalent to const char *str
try this :-
const char *str1="";
char str[]="alok";
str1=str;
MessageBox(str1);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
yes in this case it will work
as char *str1!= char *const str1
never say die
|
|
|
|
|
vikas amin wrote: char *str1="";
sprintf(str1,"The Sum is %d",Add(10,20));
I think an exception will be raised coz str1 is just a pointer and no memory allocated for the result to be stored.
-Prakash
|
|
|
|
|
if u try in gcc compiler it will give u segmentation fault a well known nightmare error in Linux/Unix
never say die
|
|
|
|
|
Are you sure you did this:
#include <tchar.h>
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|
|
Hello; Thanks for all. I got the solution.
------------------
Previous code is
#include < tchar.h >
#include < stdio.h >
#include "stdafx.h"
Which is wrong.
------------------
Present code is
#include "stdafx.h"
#include < tchar.h >
#include < stdio.h >
Which is correct.
------------------
Oh. Sorry for my mistake and Thanks for All.
Advance Happy new year to all
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
-- modified at 13:07 Wednesday 28th December, 2005
|
|
|
|
|
hi,
can anyone tell me how to make a dialogbox (modal and non modal) fade in ?
I have heard that you can do it with AnimateWindow() , but there is not much code around and MSDN isn't helping much either.
thanks for the replies in advance
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
|
Hi, i already saw that link before. My question is when to call the function and how?(yea, I can be pretty dumb sometimes )
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
yeh kane i have gone through this stuff
but i cannot find the implemented file.
Sooner i get it will send it to u
I had done it with a DialogBox
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Use it in place of ShowWindow(...).
That's what they say...;)
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
well, if you are meaning something like this :
CMyDialog *dlg;
dlg=new CMyDialog;
dlg->Create(IDD_MAINDIALOG,NULL);
then
dlg->AnimateWindow() is not a member. Its a member of CWnd.
On the other hand, I had a look at Shog9 's code at http://www.codeproject.com/miscctrl/balloonhelp.asp[^] and did the following:
made the following addition in my .h file :
private:<br />
typedef BOOL (WINAPI* FN_ANIMATE_WINDOW)(HWND,DWORD,DWORD);<br />
FN_ANIMATE_WINDOW m_fnAnimateWindow;
made the edition in the default constructor as :
CMyDialog::CMyDialog(CWnd* pParent )<br />
: CDialog(CMyDialog::IDD, pParent),m_fnAnimateWindow(NULL)
and changed the WM_SHOW like this :
void CMyDialog::OnShowWindow(BOOL bShow, UINT nStatus) <br />
{<br />
if ( NULL != m_fnAnimateWindow )<br />
{<br />
<br />
m_fnAnimateWindow( m_hWnd, 200, AW_BLEND);<br />
<br />
}<br />
}
now I get no compiler errors, the window shows, but no animation
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
OK i have figured it out, the problem was AW_BLEND. it don't work with child windows. I used AW_CENTER and it worked fine, but now the 2nd hurdle.
I have used bitmapped background and controls and they appear messed up.
any ideas what to do?
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
Make sure you set the bitmap background in the message handler for
WM_ERASEBKGND.
And if you are doing your own background painting return a NON-ZERO value.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
_kane_ wrote: thanks for the replies in advance
Ok.. My Pleasure .. kiddin.. Use AnimateWindow in OnInitDialog Function like this :-
BOOL CAnimateWndDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
::AnimateWindow(this->GetSafeHwnd(),5000,AW_BLEND);
return FALSE;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
_kane_ wrote: thanks for the replies in advance
Thanks ... Kiddin. Use AnimateWindow Api in the OnInitDialog Function of Dialog like this, its working fine for me :-
BOOL CAnimateWndDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
::AnimateWindow(this->GetSafeHwnd(),5000,AW_BLEND);
return FALSE;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|