|
The idea is that if you can find the HWND for the file dialog, you could replace its WinProc[^]. All messages are routed through this method. So basically, remove the old WinProc, add your own (all using SetWindowLongPtr[^]), and in your own just redirect all messages to the original, intercepting the F1 keystroke.
This will get you something like the MFC PreTranslateMessage ability.
|
|
|
|
|
Hi All,
I have a service application which runs well on win2k3 with Local System Account.
When I tried to use the same service on Win2k8 server if failed with Local System Account. It says "The service did not respond to the start or control request in a timely fashion."
This service works under domain administrator account.
Now I want to run the service as Local System account on win2k8 server.What and where i need to do changes?
Service is developed in C++ unmanaged code.
Please let me know if anymore information required.
Regards,
Mahesh R. Kulkarni
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
The problem could be anything involved with the startup of the service.
Do you have access to the source code? You could add logging statements to the startup code to see where it's hanging up.
|
|
|
|
|
Hi Richard,
Thanks for the reply.
I observed that it doesn't reach to service's main function also.I checked this with OutputdebugString logs. Surprisingly it works fine Domain Administrator account which can be configured by 'This Account' from service properties.
And one more thing, same piece of code works on Windows 2003 Server.
I suspect that there is something which changed in Windows Server 2008.
But I am really stuck here. I googled a lot but can't find the pointer for this.
Please let me know if you require any other information on this.
Thanks in advance.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Can you post the code that it runs at startup, if it's not too much?
There must be some resource that it's trying to access that it's not being granted permission for.
|
|
|
|
|
Sure I will update pseudo code tomorrow.
Is it ok if I mail it to you.
Regards,
Mahesh
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
No, it would be better if you posted it here so that everyone has a chance to help you.
|
|
|
|
|
void main(void)
{
OutputDebugString("Entering : void main(void)");
SERVICE_TABLE_ENTRY Service_Table_Entry[] = {
{ (LPTSTR) SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION) ServiceMain },
{ 0, 0 },
};
hThread = NULL;
hServiceEventDone = NULL;
hThreadServiceDone = NULL;
StartServiceCtrlDispatcher(Service_Table_Entry)
OutputDebugString("Exiting : void main(void)");
}
This is the entrypoint of the service.
If I run this service by Domain\administrator account debugview shows "Entering : void main(void)" entry.
But,
When I try to run this service as Local System Account it not even reaches to "Entering : void main(void)" statement.
Thanks in advance.
Mahesh R. Kulkarni
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
We've been using MAPISendMail() for some time to send Email messages with attachments via Thunderbird. Its worked fine. We recently re-installed a machine and the MAPI functionality is no longer working. When calling MAPISendMail we get an error code back, -2147467259.
We tried the suggested procedure of ensuring Thunderbird is set as the default Email client with no luck. Oddly the error code is not one of those defined in the header file.
Any ideas? Anyone else run unto this with MAPI and Thunderbird?
|
|
|
|
|
I've managed to get it going with the following workaround. I allow the user to specify a custom MAPI DLL. Then, instead of just loading "MAPI32.DLL" and letting Windows locate it, I load the DLL the user specified (C:\Program Files\Mozilla Thunderbird\mozMapi32.dll in this case). This seems to be working.
|
|
|
|
|
Hi!
I want to maintain GameStates in C++. What are the steps? Can anybody explain?
|
|
|
|
|
|
How do you manage states in a program that's not a game? However you do that you can manage states in a game in the same way. Have a look at finite state machines as most games use them in one form or another.
Cheers,
Ash
|
|
|
|
|
This question is too vague to answer meaningfully. Can you explain more clearly?
Steve
|
|
|
|
|
Hello,
I need to filter details of specific Type(i.e Custom Type) . DIA2Dump blindly dump everything as type. I need to give it specific custom type as string and as result need all data members(i.e data section of that class). Is there any specific function available in DIA SDK for this.
say I have Custom type MyClass and it has 4 variables as data members i.e DWORD data, DWORD location, BOOL MachineType and FLOAT Price. Now I should be able to pass MyClass as in parameter and it should output as data members(listed above as data,location...) of this class. How..??
Regards
Usman
|
|
|
|
|
I have made a quad in open gl in vc++ and balls.Now i want to bounce the balls on the quad repeadetly but i donot know how to do this.I thought of timer function to use to be called repeatedly but i donot know how to use it??which functions to use to set the position of y axis???I am sending thw code.Can anyone tell???
#include <windows.h>
#include <stdio.h>
#include <GL/glut.h>
#include<math.h>
void drawEllipse(float xradius, float yradius,float h,float k,int i);
void TimerFunction(int value);
void ChangeSize(int w, int h);
void SetUpRC();
float angle=90.0;
GLfloat rsize = 25;
int a=10;
int b=10;
float pi=180;
const float DEG2RAD = 3.14159/180;
float z=0.0f;
float u=1.0f;
GLfloat x[10];
GLfloat y[10];
GLfloat xstep[10];
GLfloat ystep[10];
GLfloat windowWidth;
GLfloat windowHeight;
double frame;
void cube (void) {
glBindTexture( GL_TEXTURE_2D, texture );
glBegin (GL_QUADS);
glVertex3f(-2,2,0);
glVertex3f(2,2,0);
glVertex3f(2,-2,0);
glVertex3f(-2,-2,0);
glEnd();
}
void display (void) {
GLfloat aspectRatio;
glClearColor (0.0,0.0,0.0,1.0);
glClear (GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glPushMatrix();
glEnable( GL_TEXTURE_2D );
glTranslatef(2,0,-10);
cube();
glPopMatrix();
glPushMatrix();
glTranslatef(0,0,-2.5);
aspectRatio = (GLfloat)640 / (GLfloat)480;
windowWidth = 100;
windowHeight = 100 / aspectRatio;
glOrtho (-100.0, 100.0, -windowHeight, windowHeight, 1.0, -1.0);
for(int i=0;i<1;i++)
{
drawEllipse(a+2, b+2,x[i],y[i] - rsize,i);
}
SetUpRC();
glPopMatrix();
glutSwapBuffers();
}
void SetUpRC()
{
{
int a=0,b=0;
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
for(int i=0;i<1;i++)
{
ystep[i]=1.5;
}
x[0]=60;
y[0]=50;
x[1]=20;
y[1]=30;
x[2]=-25;
y[2]=45;
x[3]=-70;
y[3]=70;
x[4]=-75;
y[4]=20;
x[5]=-60;
y[5]=40;
x[6]=70;
y[6]=45;
x[7]=-100;
y[7]=40;
x[8]=-140;
y[8]=60;
x[9]=-170;
y[9]=50;
}
}
void reshape (int w, int h) {
glViewport (0, 0, (GLsizei)w, (GLsizei)h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluPerspective (60, (GLfloat)w / (GLfloat)h, 1.0, 100.0);
glMatrixMode (GL_MODELVIEW);
}
void drawEllipse(float xradius, float yradius,float h,float k,int i)
{
glBegin(GL_POLYGON);
for (int i1=0; i1< 360; i1++)
{
glColor3f(z+1.0f, 0.0f, u+1.0f);
float degInRad = i1*DEG2RAD;
glVertex2f(cos(degInRad)*xradius+h,sin(degInRad)*yradius+k);
}
glBegin(GL_TRIANGLE_FAN);
for ( i1=0; i1 < 360; i1++)
{
glColor3f(z+1.0f, 0.0f, u+1.0f);
float degInRad = i1*DEG2RAD;
glColor3f(1.0,z+1.0,u+2.0);
glVertex2f(cos(degInRad)*xradius+h,sin(degInRad)*yradius+k);
}
glEnd();
}
void init (void)
{
}
int main (int argc, char **argv) {
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE);
glutInitWindowSize (800, 600);
glutInitWindowPosition (100, 100);
glutCreateWindow ("A basic OpenGL Window");
init();
glutDisplayFunc (display);
glutReshapeFunc (reshape);
glutIdleFunc (display);
:(( :((
glutMainLoop ();
return 0;
}
|
|
|
|
|
For all/most of my OpenGL questions, I always have a look at Nehe OpenGL Tutorials[^].
Watched code never compiles.
|
|
|
|
|
I don't know if I understood your question properly but are you trying to make something like a pong game?
If yes, your question is not really related to OpenGL in this case: you have to make a distinction between your model (the position and speed of the ball and the position of the paddle) and the visualization of your model (through OpenGL).
I would suggest that you take a look at the series of articles I wrote on OpenGL: these tutorials focus on creating a simple game with OpenGL (a tetris like game). You can find the link in m signature.
|
|
|
|
|
Why don't you read the very good Cédric's article series about [^] (I know it's about 2D, but that doesn't really matter)?
[added]
Beaten, for a couple of minutes, by the very guy...
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Monday, June 14, 2010 8:12 AM
|
|
|
|
|
Ive tried the following codes in win32 console environment
DWORD dwPIDLst[1024];
DWORD dwBytesWritten;
HANDLE hProc;
HMODULE hMod;
char strPath[MAX_PATH];
int nPIDNum;
EnumProcesses( dwPIDLst, sizeof( dwPIDLst ), &dwBytesWritten );
nPIDNum = dwBytesWritten / sizeof( DWORD );
for( int i = 0; i < nPIDNum; i++ )
{
ZeroMemory( strPath, sizeof( strPath ) );
hProc = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwPIDLst[i] );
EnumProcessModules( hProc, &hMod, sizeof( hMod ), &dwBytesWritten );
GetModuleFileNameEx( hProc, hMod, strPath, sizeof( strPath ) );
CloseHandle( hProc );
}
But there come probs:
1.cannot convert char[260] to LPTSTR ( strPath )
2.cannot convert HANDLE to HMODULE ( hMod )
All of these occur in the function GetModuleFileNameEx()
Can anyone help? Really thanx!
|
|
|
|
|
Krauze wrote: 1.cannot convert char[260] to LPTSTR ( strPath )
Change from:
Krauze wrote: char strPath[MAX_PATH];
To:
TCHAR strPath[MAX_PATH];
Krauze wrote: 2.cannot convert HANDLE to HMODULE ( hMod )
This is bit strange, since you're passing an HMODULE ...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Ive changed strPath from char to TCHAR. And the codes can be successfully compiled. However, another prob occurs that the program aborts because of potential memory abuse ( DEP has noticed it ).
As for the 2nd prob, it may be caused by the 1st one. As the former is solved, the compiler doesnt warn it any more.
|
|
|
|
|
I just compiled the above and did not see message number 2. Are you sure that is the exact message your compiler produced?
It's time for a new signature.
|
|
|
|
|
It may be caused by the 1st one. As the former is solved, the compiler doesnt warn it any more.
|
|
|
|
|
Yes quite possibly, but not in my compiler - Visual C++ 2010 Express Edition.
It's time for a new signature.
|
|
|
|
|