|
Well here's what I've got. It compiles, but I've no idea if it's any good. It all depends on what is sitting at 0x4E5DA2 in memory.
#include <windows.h>
#include <stdio.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <math.h>
#include <process.h>
#include <mmsystem.h>
#include <tlhelp32.h>
#include <vector>
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "winmm.lib")
#define Client_GLDRAWELEMENTS 0x4E5DA2
typedef void ( WINAPI *GLDRAWELEMENTS_TYPE )( GLenum iMode, GLsizei iCount, GLenum iType, const GLvoid *pvIndices );
GLDRAWELEMENTS_TYPE g_dwGlDrawElements = NULL;
void WINAPI glDrawElementsHook( GLenum iMode, GLsizei iCount, GLenum iType, const GLvoid *pvIndices )
{
( g_dwGlDrawElements )( iMode, iCount, iType, pvIndices );
}
bool WINAPI DllMain(HINSTANCE hDll, DWORD dwReason, PVOID pvReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{
g_dwGlDrawElements = *( GLDRAWELEMENTS_TYPE * )Client_GLDRAWELEMENTS;
*( DWORD*)Client_GLDRAWELEMENTS = PtrToUlong(glDrawElementsHook );
return true;
}
else if(dwReason == DLL_PROCESS_DETACH)
{
}
return false;
}
|
|
|
|
|
thnx for the help i try it later im on school now but il post the result !
|
|
|
|
|
HI all,
I m using Date Time Picker type resource in MFC and CDateTimeCtrl and COleDateTime type class for this.
Please tell me there is some limit for years.
Beacuse when i put some value in year or use spin of datetimectrl to set the year it gives an error.
Error is :: "The Parameter is incorrect."
please help me for this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
COleDateTime has this range (From MSDN) The COleDateTime class handles dates from 1 January 100 – 31 December 9999.
You can set the CDateTimeCtrl range with CDateTimeCtrl::SetRange();
There are two posibilities SetRange(CTime,CTime); or SetRange(COleDateTime,COleDateTime);
CTime has this range 1970-2038.
CDateTimeCtrl won't allow dates before 1752 AFAIK
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks.
so please tell me the range for CDateTimeCtrl
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
BOOL SetRange( const COleDateTime* pMinRange, const COleDateTime* pMaxRange );
BOOL SetRange( const CTime* pMinRange, const CTime* pMaxRange );
u can use any of the syntax depending on the requirement.
The COleDateTime class handles dates from 1 January 100 – 31 December 9999.
and CTime can handle dates from 1970-2038.
hope this information was useful
|
|
|
|
|
Hi,
in operating systems prior to windows vista a service could easily send message to desktop as they both shared the same session.
but in windows vista services run in console session 0, hence it is not possible to send a message to desktop, as the message remains in the terminal session without being displayed on desktop.
this is all due to session 0 isolation mae in windows vista.
as specified, now in order to send a message to desktop we have to use the API "WTSSendMessage" and also use the "WTSEnumerateSession" to find out which console session are active.
can i get some help on how to implement these functions to be able to send a message to the desktop successfully??
|
|
|
|
|
There's tons of articles floating around about this...
But why not use a better IPC[^] method than messages?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Is there any website or user manual to show me how to import XML data file into Crystal Report? I have problems in XML and Web services.
|
|
|
|
|
My application (MFC MDI) launches Excel, but I would like to keep my app on top of Excel. Is there a way to do this in my app or in Excel. I have tried things like SetWindowPos() but I do not know how to get a handle to my application window.
|
|
|
|
|
Like this,
CWnd *pWnd=AfxGetMainWnd();
pWnd->SetWindowPos(&CWnd::wndTopMost,0,0,100,100,0);
system
|
|
|
|
|
It works!! Thank you so much for a complete and effective answer. I did not know how to get a pointer or handle to my current window.
Now one more question, is there a way to keep my window in focus or active after starting Excel. When Excel starts Excel has the focus or is the active window, I would like my window to stay in focus or active.
Thanks again
|
|
|
|
|
I've no pretty way for this.
pYourWnd->SetParent(pExcelWnd);
And this should happen when either your application or Excel starts.
To much to say.
system
|
|
|
|
|
Hi Gurus,
Is there any windows API or struct from which I can come to know whether day light saving is currently on/off?
Thanks in Advance.
Regards
Abhi Lahare
|
|
|
|
|
GetTimeZoneInformation()?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hi,
I'm coding huffman and have a doubt.I'm writing the preorder version of my huffman tree in term of 0's and 1's as the header of my encoded file.How do I know when my header ended and my encoded data started?
|
|
|
|
|
aksgh wrote: How do I know when my header ended and my encoded data started?
A binary tree whose leaves are the given characters of the file can do this.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
First four bytes of the header -> size of header
|
|
|
|
|
error LNK2005: "protected: void __thiscall CxImage::Startup(unsigned long)" (?Startup@CxImage@@IAEXK@Z) is already defined in ximage.obj
how can i resolve this error?
thanks
|
|
|
|
|
susanne1 wrote: how can i resolve this error?
By consulting the the docs.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
The error means CxImage::Startup is defined in multiple files. You must eliminate one of the (redundant) definitions.
|
|
|
|
|
This[^] may help.
use #pragma once if you're using visual studio or another compiler that supports it, and inclusion guards if you aren't like so;
#ifdef YOUR_SYMBOL<br />
#define YOUR_SYMBOL<br />
<br />
<br />
#endif<br />
Using both at the same time doesn't hurt one bit.
|
|
|
|
|
First, why don't you reply to the original poster ?
Second, this won't help because these include guards are used by the compiler and the OP has a linker error, not a compile error.
|
|
|
|
|
1) My answer was intended as an extension to yours.
2) From the article I linked:
Potential Pitfalls:
...
4) Duplicate instances of objects within the code that compiled fine. This is a linking error, often difficult to understand. (In MSVC, you might see something like "error LNK2005: "int myGlobal" (?myGlobal@@3HA) already defined in myotherfile.obj".)
...
If you read the article properly (or at all, if you didn't already) then you will see that this was a perfectly good suggestion.
|
|
|
|