|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think you can see an example on http://www.codersource.net/ about this object but i cant remember its name.
|
|
|
|
|
I have two addins installed in my Outlook 2003, both have their specific functionality, I would like to integrate the functionality of both thru global mouse hooks, here is my senerio
1) Lets say there is a button "abc" on toolbar "A" in outlook mail composing window
2) and there is a button "xyz" on toolbar "X" in the same mail composing window
3) on click of button "abc", I would like to generate click of button "xyz" first
4) and then resume back to the process of button "abc"
I am thinking of developing application using VC++ and creating global mouse hooks (may be there is some better approach), I know I can capture the mouse click but my questions are
1) how do I know that the click that was captured is for "abc" button....I think I'll have to determine if the click was for OUTLOOK main window and then determine which mail composing window the click was for, and then finally determine which toolbar/button was it for........but how do I do this all ? any ideas/pointers/suggestions
2) Once I know that the click was for button "abc" now second step is, how do I push a new click event in the windows queue for button "xyz" in toolbar "X"
Also one thing to note is, there may be multiple mail composing windows open but we got to work on the active one only which initiated the click event in question.
Thanks in advance.
|
|
|
|
|
In my opinion, mouse hooks won't help you in this scenario. Write a COM addin or use VBA. It will be much simpler.
Obstacles are those frightful things you see when you take your eyes off your goal.
|
|
|
|
|
Hi,
does anyone know how I can convert a IntPtr of a HWND object to the data type HANDLE ??
I want to register the window Form1 to receive PnP Messages from a USB API from cypress:
USBDevice = new CCyUSBDevice(Form1->Handle);
CCyUSBDevice expects HANDLE, but I get only IntPtr from my Form1....
Please help me!
maggi01
|
|
|
|
|
HWND s and HANDLE s are distinct objects: there is no meaningful conversion between them.
Steve
|
|
|
|
|
Actually my code goes like this:
<br />
namespace Test_Application<br />
{<br />
using namespace System;<br />
using namespace System::ComponentModel;<br />
using namespace System::Collections;<br />
using namespace System::Windows::Forms;<br />
using namespace System::Data;<br />
using namespace System::Drawing;<br />
using namespace System::IO;<br />
<br />
public __gc class Form1 : public System::Windows::Forms::Form<br />
{<br />
public:<br />
static CCyUSBDevice *USBDevice = new CCyUSBDevice(EnumWindows((HANDLE)this::Form1::Handle));<br />
.<br />
.<br />
.<br />
How do you propose to deliver a handle of my "Test_Application" to the CCyUSBDevice constructor... which expects datatype HANDLE !?
thanx for your answer,
maggi01
|
|
|
|
|
This forum is for C++/MFC, I believe there is a managed C++ forum where you might have more luck getting an answer. Assuming HWND s and HANDLE s have the same meaning in the two environments then, as I said, there is no meaningful conversion between the two. That said, I don't know much about managed C++.
Steve
|
|
|
|
|
hi all i m using the winsock api's for client server communication that works on the blocking mode not asyncronous.
but i m not successfully able to receive the strings it works with one receive call not the multiple calls,with multiple calls it brings wrong data.
Tasleem Arif
|
|
|
|
|
Using the TCP protocol, packet boundaries are not preserved. That is, the number of calls, and number of bytes passed in a call, to send() is not mirrored in recv(). Instead, recv() gives you as many bytes as are currently buffered.
See the Winsock Programmer's FAQ article How to use TCP effectively[^].
|
|
|
|
|
in PE file format why import,export table is in data directory?
I mean in Section table there is a header about .idata(import table) or .edata.But they are already defined in data directory.
So
What are the differences between data directory and section table.Why do we use data directory?
|
|
|
|
|
The sections names and their contents are only convention. Borland compilers use different names for example. You can also instruct the linker to merge sections. Code that relies on section names to find such things as the import and export table is wrong; that's what the data directory is for, it's like a table of contents.
Steve
|
|
|
|
|
ok
Thank you.I want to ask one more question
What are the meanings of or what are the differnces between
VOffset
VSize
ROffset
RSize
RVA
VA
I need clear definitions.I am very confused about these.
|
|
|
|
|
It's not clear exactly what you're referring to but I assume it's the IMAGE_SECTION_HEADER structure. This is what it looks like (from "winnt.h"):
typedef struct _IMAGE_SECTION_HEADER {
BYTE Name[IMAGE_SIZEOF_SHORT_NAME];
union {
DWORD PhysicalAddress;
DWORD VirtualSize;
} Misc;
DWORD VirtualAddress;
DWORD SizeOfRawData;
DWORD PointerToRawData;
DWORD PointerToRelocations;
DWORD PointerToLinenumbers;
WORD NumberOfRelocations;
WORD NumberOfLinenumbers;
DWORD Characteristics;
} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
The VirtualAddress is the RVA of where this section belongs when loaded into memory. RVA stands for Relative Virtual Address. It's of offset from the base address of the DLL to where the section is loaded. An absolute address can't be used as the DLL is not guaranteed to be loaded at a fixed location. The VirtualSize is how much memory is allocated for the section. This can be bigger then the actual size of the data in the section.
See here[^] for more details.
Steve
|
|
|
|
|
I'm converting my base 64 encoder/decoder class to be more unicode friendly, though I have a few questions.
1. Does each base64 character only occupy half of a wchar_t (ie the same as ascii characters)?
2. When reading a file to be encoded, should it be opened as wchar_t array (wfopen) or as a byte array (fopen)?
3. How can a 3rd party decoder tell if the origional was unicode or ascii?
The encodeing is not a problem, but I need to be certain 3rd party decoders can correctly decode the string into it's origional form.
|
|
|
|
|
waldermort wrote: 3. How can a 3rd party decoder tell if the origional was unicode or ascii?
If mu memory serves me right, unicode files starts with two special characters. They are (hex) FF and FE.
The sequence can be FFFE or FEFF, depending on endianess of the creating CPU.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
1. Seeing as it is "your" library, I would hope that you were fully aware how base-64 works?
2. depends on if the filename is in Unicode or not. Completely independent of the file-content.
3. It can't reliably.
|
|
|
|
|
hi , i got problem with opengl why i cannot display cube and triangle in my comp... is there any code wrong below if u know plz inform me thanks
#include<gl glut.h="">
float rtri; // Angle For The Triangle
float rquad; // Angle For The Quad
int InitGL(GLvoid)
{
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
}
void display (GLvoid)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glPushMatrix();
glTranslatef(-1.5f,0.0f,-6.0f);
glRotatef(rtri,0.0f,1.0f,0.0f);
glBegin(GL_TRIANGLES);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f( 0.0f, 1.0f, 0.0f);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f(-1.0f,-1.0f, 1.0f);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f( 1.0f,-1.0f, 1.0f);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f( 0.0f, 1.0f, 0.0f);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f( 1.0f,-1.0f, 1.0f);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f( 1.0f,-1.0f, -1.0f);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f( 0.0f, 1.0f, 0.0f);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f( 1.0f,-1.0f, -1.0f);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f(-1.0f,-1.0f, -1.0f);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f( 0.0f, 1.0f, 0.0f);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f(-1.0f,-1.0f,-1.0f);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f(-1.0f,-1.0f, 1.0f);
glEnd();
glLoadIdentity();
glTranslatef(1.5f,0.0f,-7.0f);
glRotatef(rquad,1.0f,1.0f,1.0f);
glBegin(GL_QUADS);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f( 1.0f, 1.0f,-1.0f);
glVertex3f(-1.0f, 1.0f,-1.0f);
glVertex3f(-1.0f, 1.0f, 1.0f);
glVertex3f( 1.0f, 1.0f, 1.0f);
glColor3f(1.0f,0.5f,0.0f);
glVertex3f( 1.0f,-1.0f, 1.0f);
glVertex3f(-1.0f,-1.0f, 1.0f);
glVertex3f(-1.0f,-1.0f,-1.0f);
glVertex3f( 1.0f,-1.0f,-1.0f);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f( 1.0f, 1.0f, 1.0f);
glVertex3f(-1.0f, 1.0f, 1.0f);
glVertex3f(-1.0f,-1.0f, 1.0f);
glVertex3f( 1.0f,-1.0f, 1.0f);
glColor3f(1.0f,1.0f,0.0f);
glVertex3f( 1.0f,-1.0f,-1.0f);
glVertex3f(-1.0f,-1.0f,-1.0f);
glVertex3f(-1.0f, 1.0f,-1.0f);
glVertex3f( 1.0f, 1.0f,-1.0f);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f(-1.0f, 1.0f, 1.0f);
glVertex3f(-1.0f, 1.0f,-1.0f);
glVertex3f(-1.0f,-1.0f,-1.0f);
glVertex3f(-1.0f,-1.0f, 1.0f);
glColor3f(1.0f,0.0f,1.0f);
glVertex3f( 1.0f, 1.0f,-1.0f);
glVertex3f( 1.0f, 1.0f, 1.0f);
glVertex3f( 1.0f,-1.0f, 1.0f);
glVertex3f( 1.0f,-1.0f,-1.0f);
glEnd();
glPopMatrix();
rtri+=0.2f;
rquad-=0.15f;
glutSwapBuffers ( );
}
void keyboard ( unsigned char key, int x, int y )
{
switch ( key ) {
case 27: // When Escape Is Pressed...
exit ( 0 ); // Exit The Program
break;
default:
break;
}
}
int main(int argc, char** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(100,100);
glutCreateWindow("simple");
glutFullScreen ( );
glutKeyboardFunc ( keyboard );
InitGL ();
glutDisplayFunc(display);
glutMainLoop();
}
|
|
|
|
|
You haven't set the camera perspective
Your frustum seems to extend only from -1 to 1 . your translation at the beginning (glTranslatef(-1.5f,0.0f,-6.0f);) takes you object beyond the far plane.
try setting the camera parameters or change you glTranslatef line
I hope this helps
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
First, when you have an error, explain what it is (instead of saying error lnk2019). That way, we don't need to google to find what the exact error is.
Also, when posting coed, use the code tag so that your code will look better.
Now, to your question, I see several problems:
#ifdef MYDLL_EXPORTS<br />
#define MYDLL_EXPORTS __declspec(dllexport)<br />
#else<br />
#define MYDLL_EXPORTS __declspec(dllimport)<br />
#endif
What are you trying to do here ? Why do you use the same symbol (MYDLL_EXPORTS) ? You need to have two compiler flags: one to specify if symbols need to be exported or imported and the second that will contain the export or import directive. Something like that:
#ifdef ISDLL<br />
#define MYDLL_EXPORTS __declspec(dllexport)<br />
#else<br />
#define MYDLL_EXPORTS __declspec(dllimport)<br />
#endif
Then, you can add ISDLL in the compiler flag (project options) if you are compiling your dll.
You don't export anything also. Even if your flags were defined correctly, you still don't use them to export your classes.
|
|
|
|
|
There is no problem with my flags actually, it is my error during copy&paste.(Sorry)
and also could not recognize the code tag(Sorry again).
I have corrected my flags by modifying my post and also mentioned the project that mine is based on(http://www.codeproject.com/dll/rsLoadtimeDLL.asp).
This example works properly.I added another class to win32dll project and used its methods from win32app project. Project properties of Load Time dll Sample and mine are the same.
Can it be about my #include header directives?
Thanx...
|
|
|
|
|
baharat wrote: There is no problem with my flags actually, it is my error during copy&paste
If you don't post the right code, it is impossible for us to help you. Did you export the functions from you class as I said in my previous post ? Or was that part also a typo ?
baharat wrote: Can it be about my #include header directives?
No, if the include directive was wrong, then you'll get a compile error, not a link error. The problem here is that the function is not found in the library.
|
|
|
|
|
another dumb man who deleted his question after getting the answer...
|
|
|
|
|
Don't they just annoy you
I have a feeling these little children are trying to do their homework and they don't want their classmates to see just how dumb they are!
|
|
|
|
|
yup.
|
|
|
|
|