|
|
hi,
I an sdi application how can we change the title of the application in the caption bar.
Radhika.
|
|
|
|
|
::AfxGetMainWnd()->SetWindowText(_T("new caption"));
|
|
|
|
|
hi, where should we code that statement.
Thanks,
Radhika.
|
|
|
|
|
radhika28 wrote: hi, where should we code that statement.
where you want to change the application caption...
|
|
|
|
|
toxcct wrote: ::AfxGetInstanceHandle()->SetWindowText(_T("new caption"));
Did you mean AfxGetMainWnd, Tox?
|
|
|
|
|
oops
modified ! thanks a bunch for the correction
|
|
|
|
|
toxcct wrote: thanks a bunch for the correction
No probs, I was sure it was a typo
|
|
|
|
|
hi,
i am getting the a debug error when i added it in the mainframe class oncreate() function.
Thanks,
Radhika.
|
|
|
|
|
Inside the frame window's OnCreate, you only need to call SetWindowText (no need to call AfxGetAnything...)
|
|
|
|
|
Hi,
I have just place the function like this in the oncreate() function , SetWindowText(_T("Radhika"));
But still i am not getting the required one.
Radhika.
|
|
|
|
|
radhika28 wrote: But still i am not getting the required one.
What exactly do you see as title then?
|
|
|
|
|
toxcct wrote: in the mainframe's oncreate(), isn't the window not created yet ?
Yes, it is, but AfxGetMainWnd may return NULL as the m_pMainWnd has not been set yet.
|
|
|
|
|
Hi,
I got it when i added have added negation the caption style in the precreatewindow function and added the above code in the on create function.
Thanks both for ur help.
Radhika.
|
|
|
|
|
Hi all,
i am working on a simulink model (graphical block programming) and in a block i am supposed to write a user defined function (S-Function) which takes a double value and outputs 8 uint8 values. It has some simulink related commands but basically C Code. Since i have an error message, i would like to share it with you all to find a way out.
#define S_FUNCTION_NAME double2integer
#define S_FUNCTION_LEVEL 2
#include "simstruc.h"
typedef union
{ uint8_T uvalue[8];
real_T d; //real_T is double
} UnionNum;
static void mdlInitializeSizes(SimStruct *S)
{
ssSetNumSFcnParams(S, 0);
if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {
return; /* Parameter mismatch will be reported by Simulink */
}
if (!ssSetNumInputPorts(S, 1)) return;
ssSetInputPortWidth(S, 0, 1);
ssSetInputPortDataType(S, 0, SS_DOUBLE);
ssSetInputPortDirectFeedThrough(S, 0, 1);
if (!ssSetNumOutputPorts(S,1)) return;
ssSetOutputPortWidth(S, 0, 8);
ssSetOutputPortDataType(S, 0, SS_UINT8);
ssSetNumSampleTimes(S, 1);
ssSetOptions(S,0);
}
static void mdlOutputs(SimStruct *S, int_T tid)
{
int_T i;
int_T width = ssGetOutputPortWidth(S,0);
InputPtrsType uPtrs = ssGetInputPortSignalPtrs(S,0);
uint8_T *y = (uint8_T *)ssGetOutputPortSignal(S,0);
UnionNum num;
num.d = *uPtrs[0] ;
for(i=0; i
|
|
|
|
|
cahit23 wrote: Error : Have illegal types 'double' and 'void'
Do you not think it pertinent to include the line number of the code this error refers to? We're not mind readers.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Do you not think it pertinent to include the line number of the code this error refers to? We're not mind readers.
Oh sorry, pointed lines are :
real_T d; and
** real_T is the representation of double in this format, even if i write there 'double' appears again as error **
num.d = *uPtrs[0];
Thank you for your consideration!
Cahit
|
|
|
|
|
cahit23 wrote: How split up a double value into 8 sets of uint8
use this :
union DoubleToBytes {
double _d;
uint8 _ui[8];
};
|
|
|
|
|
Hello!
my problème is when I pick the date from a day Time picker, i have for
example 9 but I want to have 09 (2digits) because i need it in this format
can you help me
thanks a lot!
|
|
|
|
|
zizzzz wrote: because i need it in this format
Use CString::Format(...); // This is if you want to use Strings. It's a bit
// lengthy procedure
CDateTimeCtrl::SetFormat(...)
-- modified at 9:58 Monday 18th September, 2006
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
zizzzz wrote: ...a day Time picker...
What's this?
zizzzz wrote: i have for
example 9
9 what? September? Ninth day of the month?
zizzzz wrote: I want to have 09 (2digits) because i need it in this format
So how are you currently extracting the date from the control?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yes it is exactly that 9--->september
|
|
|
|
|
zizzzz wrote: I want to have 09 (2digits) because i need it in this format
can you help me
you should read format specifier
"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
Support CRY- Child Relief and You
|
|
|
|
|
Hi all,
OK, so lets say you have an application, lets call it app1. app1 may not have more than one process running at one time. And if another process was found restore the previous app1. This is where the problem comes in.
See the thing is the the second instance of app1 has been opened and the app sees that another instance is running (of itself), how will it diffrenciate between the two app window names, to bring the correct one to the foreground??
Really Hope this makes sense
Any ideas???
Thanx in advance
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
actually, it does use a semaphore/mutex, which name must be unique.
see this[^] class to understand what it actaully does.
|
|
|
|