|
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.
|
|
|
|
|
Programm3r wrote: app sees that another instance is running (of itself)
So do you want to keep the second instance also running?
Or kill the second instance and bring the focus on the first instance that was already running?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanx for the reply...
"....Or kill the second instance and bring the focus on the first instance that was already running? ...."
Yes, I want to send a return code to the calling app (2nd opened application) so that it will see that another instance is already running, kill itself and cause the 1st instance to restore it's window.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
There could be various solutions to this problem.
Preferrably using mutex's .
something like
HANDLE hMutex;
hMutex = CreateMutex(
NULL, // no security attributes
FALSE, // initially not owned
"SomeUniqueName"); // name of mutex
If this exists already return from the application.
Another option would be to use a shared variable and check for its value. Increment it each time an instance is created. If the value is greater than one you can just return from the second instance.
The third option would be to use the FindWindow function. You would get the handle to the window if it's already running.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Thanks buddy. Will try and go through this article tomorrow.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanx for the help... I'll try it
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|