|
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.
|
|
|
|
|
One question.
DWORD dwPIDLst[1024];
nPIDNum = dwBytesWritten / sizeof( DWORD );
Was it ok? In other words, nPIDNum is under 1024?
|
|
|
|
|
In fact there's a fault in my codes when dynamically loading GetModuleFileNameEx(). But Ive corrected it. So it can perfectly run now. What I need to do now is just to add exception handlers. Thank yall.
|
|
|
|
|
Has someone the same problem with the listbox after a security update?
1) No focus frame is displayed:
A CListBox does not display the dotted focus frame rectangle if a list
box item is left clicked with the mouse the first time. The focus frame
is not displayed even when navigating with the up and down keys.
2) In the following scenario two focus frames appear:
- Enter the list box with a left mouse click on the first list box item
for the first time.
- Then move e.g. 3 items down (the focus frame rectangle is not shown)
- Now press the ALT-key
- Move one item down
-> Result: two focus frames are displayed in the list box.
All is fine if
- you enter the list box with a key e.g. TAB-Key for the first time.
- if you enter the list box with a mouse click for the first time and
then press the ALT-key.
The Problem was introduced with a new shlwapi.dll on Feb. 2010.
MS10-007 update from February 9, 2010
http://support.microsoft.com/kb/975713
I created a simple MFC dialog demo application with C++ VS2005
with a CListBox in a dialog (with all properties of the list box set to
default) and added a few strings in the function OnInitDialog.
If I copy the old shlwapi.dll (6.0.2900.5512) to the demo dialog
directory the focus frame of the list box works as expected.
The new shlwapi.dll (6.0.2900.5912)
Andreas.
|
|
|
|
|
Hi!
I've defined two classes. I've used the object of the first class inside the second class and the object of the second class inside the first class. I've forward declared both the classes. But I got the following error
error C2061: syntax error : identifier 'initialMenu'
My Code is:
class InitialMenu;
class PlayMenu;
class InitialMenu : public IEventReceiver
{
private:
SAppContext &Context;
PlayMenu *playMenu;
public:
InitialMenu(SAppContext &context) : Context(context)
{
}
virtual bool OnEvent(const SEvent& event)
{
playMenu = new PlayMenu(Context);
return true;
}
};
class PlayMenu : public IEventReceiver
{
private:
SAppContext &Context;
InitialMenu* initialMenu;
public:
PlayMenu(SAppContext &context) : Context(context)
{
}
virtual bool OnEvent(const SEvent& event)
{
initialMenu = new initialMenu(Context);
return true;
}
};
How to resolve this error?
|
|
|
|
|
You should split the class declarations into header files and class definitions into CPP files.
|
|
|
|
|
If you look at the line that the error refers to you may notice the incorrect constructor call thus:
initialMenu = new initialMenu(Context);
It's time for a new signature.
|
|
|
|
|
Good spot - I'm surprised that he's not getting an error message about trying to create a PlayMenu when the class has been declared but not defined but I completely missed the typo.
Cheers,
Ash
|
|
|
|
|
As you said in a previous post: "who teaches this stuff?".
It's time for a new signature.
|
|
|
|
|
Without knowing which line the error happened at it's a bit hard working out why you're getting that error.
Having said thay if you implement your classes the way you do within the same translation unit you'll never get it to work - you've got a cyclic depenedency between the two clases. Each has to know the size of the other to be able to create instances of the other. Split them up into pairs of .h and .cpp files and it'll have a better chance of working.
Oh, and remember to implement destructors or use some sort of resource management class instead of the pointers. And beware of any class that calls itself a context (or manager) they're usually global state in disguise.
Cheers,
Ash
|
|
|
|
|
I think your spelling wrong:
virtual bool OnEvent(const SEvent& event)
{
initialMenu = new <big>initialMenu</big>(Context);
return true;
}
virtual bool OnEvent(const SEvent& event)
{
initialMenu = new <big>InitialMenu</big>(Context);
return true;
}
|
|
|
|
|
Sorry for my spelling.^_^
|
|
|
|
|
dear radha,
can you please consult MSDN and google, before posting your query here!, if you type C2061 in MSDN, it will let you know, why it's throwing the error!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi All,
I have a scenario where I need to implement something like what setjmp does. I am well aware of using the setjmp API but the problem statement requires this to be implemented in a different manner.
I have a variable that would store the address of the next function to be called. This variable could be passed as a parameter to another function and to another one from that function and so on...
For this I will need the address of the function that is currently executing and the address to which I want to jump to. Any ideas on how can I read the addresses or implement this?
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
I do not understand why you want the address of a function at runtime.
You could simply store the addresses of all available functions in a pointer array and use that array in code.
|
|
|
|
|