|
Try:-
void InitialUpdateFrame( CDocument* pDoc, BOOL bMakeVisible );
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
|
You can try OnCreate(...) of your CMainFrame.
|
|
|
|
|
Hi,
I need my dialog to be active in the background so it works when other applications are running in the foreground. Is there a way to do this?
Thanks for your help
|
|
|
|
|
What do you mean by ACTIVE?(Plz Clarify)
The application created keeps on working even when other application is running. It's just the fact that it looses focus.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Well, I currently have an dialog application which polls a joystick and uses these values to perform an operation on external equipment. However, I will be using video which must be full-screen so the dialog will lose focus. The dialog only reads the joystick values when it has focus. So i need the dialog to read the data when it loses focus.
Maybe, a dialog application is not the best method
|
|
|
|
|
|
You can put a timer in your dialog and do your polling there.
|
|
|
|
|
If you want to minimize,
then WM_SETFOCUS message handler or OnActivateApp,
Call
ShowWindow(SW_MINIMIZE) for minimizing
ShowWindow(SW_HIDE) for hiding the window. Hope I answered you
SaRath.
"Do Next Thing..."
Understanding State Pattern in C++
|
|
|
|
|
Thanks for the advice and time.
The problem was to do with the joystick cooperative levels in the DirectInputDevice. Changing the cooperative level allowed the application to have access to the device when running in the background.
|
|
|
|
|
Hi,
Ive done some searching with no luck to get the ip of client connected to a socked using winsock.
heres what ive got which may be totally off...
accept( ListenSocket, (SOCKADDR*) &clientip, NULL);
int strangeip=clientip.sin_addr.s_addr;
strange ip reports some strange int... cant figure out how to get the actual ip there.. or convert the u_long to hostent.. i think i can get hostent converted to ip however cant get that far...
any help would be appreciated...
|
|
|
|
|
See if this helps
inet_ntoa(client.sin_addr)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hmm.. getting 204.204.204.204 from the inet_ntoa.. which probably means.. that part of the accept is not going to help me get the ip... i assume..
ive seen this before....
char hostname[256]; struct hostent *host; in_addr ip; gethostname(hostname, 256); host = gethostbyname(hostname); memcpy(&ip, host->h_addr, sizeof(ip)); printf("First host IP is: %s\n", inet_ntoa(ip));
which seems to get the local ip.. which is not what im trying to do...
|
|
|
|
|
I think you can get the IP in this manner:
sockaddr_in clientAddress;
accept( ..., (SOCKADDR*)&clientAddress, ...);
in_addr inAddr = clientAddress.sin_addr;
Now the four components of IP, from left to right, are in inAddr.S_un.S_un_b.s_b# members:
printf("The IP is: %i.%i.%i.%i",
inAddr.S_un.S_un_b.s_b1,
inAddr.S_un.S_un_b.s_b2,
inAddr.S_un.S_un_b.s_b3,
inAddr.S_un.S_un_b.s_b4);
Hope it helps.
|
|
|
|
|
here i had aproblem in usage of smpp ie the parameters are not matching with the code in SMPPlibTest.so plz kindely help me howto use SMPP in my project to send SMS
#sankar#
|
|
|
|
|
plz give me solution to solve this problem
#sankar#
-- modified at 4:23 Thursday 22nd June, 2006
|
|
|
|
|
Hello everyone...
Below is a complete sample application.
How can i get the same output but the shape must be circle??
which line of coding do i need to change?
Please help me here.
It is urgent.
Thanks alot
Tillandran
-----------------------------------------------------------------------------
#include <windows.h>
#include <gl\gl.h>
#include <gl\glaux.h>
#include<math.h>
//initial square position and its size
GLfloat x=250.0f;
GLfloat y=0.0f;
GLsizei rsize=50;
GLfloat x2=0.0f;
GLfloat y2=0.0f;
GLfloat x3=250.0f;
GLfloat y3=250.0f;
GLfloat x4=0.0f;
GLfloat y4=250.0f;
//step size in x and y directions
//number of pixels to move each time
GLfloat xstep=0.10f;
GLfloat ystep=0.10f;
GLfloat x2step=0.10f;
GLfloat y2step=0.10f;
GLfloat x3step=0.10f;
GLfloat y3step=0.10f;
GLfloat x4step=0.10f;
GLfloat y4step=0.10f;
//keep track of window's changing width and height
GLfloat windowWidth;
GLfloat windowHeight;
//called by AUX library when the windows has changed size
void CALLBACK ChangeSize(GLsizei w, GLsizei h)
{
//prevent a divide by zero. when window is too short
// you cannot make a window zero width
if(h==0)
h=1;
//set the viewport to be the entire window
glViewport(0,0,w,h);
//Reset the coordinate system before modifying
glLoadIdentity();
//keep the square square, this time, save calculated width and height for later use
if(w<=h)
{
windowHeight=250.0f*h/w;
windowWidth=250.0f;
}
else
{
windowWidth=250.0f * w/h;
windowHeight=250.0f;
}
//set the clipping volume
glOrtho(1.0f, windowWidth, 0.01, windowHeight, 1.0f, -1.0f);
}
//called by AUX library to update window
void CALLBACK RenderScene(void)
{
glClearColor(0.0f,0.0f,1.0f,0.0f);
glClear(GL_COLOR_BUFFER_BIT);
//set drawing color to red and draw rectangle at current position
glColor3f(0.0f,1.0f,0.0f);
glRectf(x2,y2,x2+rsize,y2+rsize);
glColor3f(1.0f,0.0f,0.0f);
glRectf(x3,y3,x3+rsize,y3+rsize);
glColor3f(1.0f,0.0f,0.0f);
glRectf(x4,y4,x4+rsize,y4+rsize);
glColor3f(1.0f, 1.0f, 0.0f);
glRectf(x,y,x+rsize,y+rsize);
glFlush();
}
//called by AUX library when idle(window not being resized or moved)
void CALLBACK IdleFunction(void)
{
//reverse direction when you reach let or right edge
if(x>windowWidth-rsize || x<0)
xstep=-xstep;
//reverse direction when you reach top or bottom edge
if(y>windowHeight-rsize || y<0)
ystep=-ystep;
//check bounds. This is in case the window is made smaller and the retangle is outside the new clipping volume
if(x>windowWidth-rsize)
x=windowWidth-rsize-1;
if(y>windowHeight-rsize)
y=windowHeight-rsize-1;
//Actually move the square
x+=xstep;
y+=ystep;
//reverse direction when you reach left or right edge
if(x2>windowWidth-rsize || x2<0)
x2step=-x2step;
//reverse direction when you reach top or bottom edge
if(y2>windowHeight-rsize || y2<0)
y2step=-y2step;
//check bounds. This is in case the window is made smaller and the rectangle is outside the new clipping volume
if(x2>windowWidth-rsize)
x2=windowWidth-rsize-1;
if(y2>windowHeight-rsize)
y2=windowHeight-rsize-1;
if(x3>windowWidth-rsize || x3<0)
x3step=-x3step;
//reverse direction when you reach top or bottom edge
if(y3>windowHeight-rsize || y3<0)
y3step=-y3step;
//check bounds. This is in case the window is made smaller and the rectangle is outside the new clipping volume
if(x3>windowWidth-rsize)
x3=windowWidth-rsize-1;
if(y3>windowHeight-rsize)
y3=windowHeight-rsize-1;
if(x4>windowWidth-rsize || x4<0)
x4step=-x4step;
//reverse direction when you reach top or bottom edge
if(y4>windowHeight-rsize || y4<0)
y4step=-y4step;
//check bounds. This is in case the window is made smaller and the rectangle is outside the new clipping volume
if(x4>windowWidth-rsize)
x4=windowWidth-rsize-1;
if(y4>windowHeight-rsize)
y4=windowHeight-rsize-1;
//Actually move the square
x2+=x2step;
y2+=y2step;
x3+=x3step;
y3+=y3step;
x4+=x4step;
y4+=y4step;
//redraw the scene with new coordinates
RenderScene();
}
//main body of the program
void main(void)
{
//aux window setup and initialization
auxInitDisplayMode(AUX_DOUBLE || AUX_RGBA);
auxInitPosition(100,100,250,250);
auxInitWindow("Assignment 1");
//set function to call when window is resized
auxReshapeFunc(ChangeSize);
auxIdleFunc(IdleFunction);
//start main loop
auxMainLoop(RenderScene);
}
//GLAUX.LIB GLU32.LIB glut32.lib glut.lib OPENGL32.LIB
-- modified at 3:43 Thursday 22nd June, 2006
|
|
|
|
|
|
|
Bad command or ?...
whitesky
|
|
|
|
|
|
in the end i get this error !?
Do you remember "Bad command or file name" in dos,dos(windows 3.1,gwbasic,qbasic,pascal,turbo c)
and clrscr equal cls and....(many years)
whitesky
|
|
|
|
|
Hi..
Actually there is no any error for the program. The program is correct and can be run.How can i get 4 circle shape instead of square?
There are some command missing for the program.
U hv to include this on the top of the program.
After each #include, please key in the folowing code for each #include
#include windows.h
#include gl\gl.h
#include gl\glaux.h
#include math.h
Please delete this and replace with the above code.
#include
#include
#include
#include
Thanks
|
|
|
|
|
Dear all,
Is there an API function that will hide a partition and/or folder in a USB Memory Stick, so the folder will be inaccessible from other computers - that is protecting the contents of the memory stick. Ideally, the program should be stand alone, and no installation would be required on any computers.
Thanks in advance
Derek
|
|
|
|
|
See:-
SetFileAttributes
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|