|
Tanvon wrote: there is no such API called GetDocument.
I again confirmed it from MSDN for my surety.
It is a member function of CView class
Isn't i know that.... GetDocument itself imply that it will retrive the pointer to the document class associated with view... isn't are anybody using WIn32 to simulate DOC-View architecture....i believe no..
and tell me what is MFC?.. a thin wrapper over win32!.
here what actual coding of GetDocument gives
_AFXWIN_INLINE CDocument* CView::GetDocument() const
{ ASSERT(this != NULL); return m_pDocument; } Actually many people here doesn't think what is api and what is funtion....
like for Example if you use FindWindow() it is api... and CWnd::FindWindow() it is function..
but if you refer them ... you will use this api or that api... what is api at end a function which providing
application programming interface
"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
|
|
|
|
|
Actyally I have also some unix, Linux background.
And another matter is that I also studied many operatin systems.
And that all things tell, that an API is an
interface which an operating system provides to the outside
world. So in that context every direct function in an operating system
is an API. Actually an API provides an interface for applications programs.
And that way application programs can interact with the operating system.
And libraries comes at a second stage. These libraries also provides us ways to
interact with them, they sometimes also called APIs, but it is not an
approperiate word for that purpose.
Tanvon
the brain behind ...
I Blog here
|
|
|
|
|
this is not a good practice, You should not call a particular view from a document, because it makes document to depend on a specific view, And document view articture tells us that we may have multiple view,and documents so we should not make decument to depend on a specific view.
You can do so
1: call UpdateAllViews() from your document, with a hint.
2: this will call OnUpdate() in all views (if more than one)
3: in OnUpdate in your view class watch that specific hint and call that view class method you want to call
Tanvon
the brain behind ...
I Blog here
|
|
|
|
|
Hi,
I have a win98 system and I am in need of being able to read the partition table. I'm not sure if this is specificaly a c++ question, but I am writing the code in c++. I've looked up DeviceIoControl(...), which has a IOCTL_DISK_GET_PARTITION_INFO_EX control code. That would be awesome, except it is only supported in win2k/XP systems.
In win98 you have to use VxD and DOS interupt functions with DeviceIoControl(...). Again that would be fine, but I haven't been able to find an old dos int. that will give me the partition table. Does anyone know of one, or know a better way to do this? Thanks.
-(not so epic)yeti
|
|
|
|
|
Hmm. From memory,
Int 13h is the Disk I/O one, and you'd want the first sector of the relevant disk, which should be where the MBR and partition table is.
ax = 0x0201
cx = 0x0001
dx = 0x0080 (1st HDD, 2nd = 0x81 etc)
es:bx is data buffer
CF (carry) set if an error occurred.
Disk sector should be 512 bytes.
Win9x might need you to 'lock' the volume using an Int 21h call, but I can't remember the details, since all this is so old....
Steve S
Developer for hire
|
|
|
|
|
I'm writing an application that grabs images from an IP Camera. These images are in the JPEG format.
I want to be able to display these images in an MFC dialog. It currently works using iPicture to load the buffered images and display them.
I want to try using GDI+. I noticed that GDI+ can load an image from a file. However, I can not find any references on how to do this with a buffer. Is this possible?
-- modified at 10:34 Monday 18th September, 2006
I forgot to add that I'm storing the image in a Byte Buffer.
|
|
|
|
|
Bitmap::FromStream works nicely
Look into CreateStreamOnHGlobal for how to get the BYTE buffer into a stream object (IStream interface)
|
|
|
|
|
|
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];
};
|
|
|
|