|
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.
|
|
|
|
|
Hi!
How do i show a browse dialog box?
for example : DoModal function of CFileDialog calss show an open file or save file dialog box.
but to select a directory, i need browse dialog box.
please help me
-- modified at 4:22 Monday 2nd October, 2006
Zo.Naderi-Iran
|
|
|
|
|
open/save allows you to change the directory. Can you be a little more specific.
|
|
|
|
|
I guess his question is SHBrowseForFolder becuase he said a dialog for select directory .
|
|
|
|
|
|
Hello!
Which tool can I use under win32 to see which symbols are linked in the to the libray someLib.lib. I can use "nm" utility under Linux (example: someLib.a). Is there some simmilar tool for MSVC constructed libraries? I use MSVC++ .NET 2003.
Regards,
Rostfrei
|
|
|
|
|
Try using depends.exe, not sure if will look at a .lib file though, I know it works for .dlls
|
|
|
|
|
Thank you for response waldermort and benjymous. I tried both tools and it looks like it's the same tool. One comes with .NET installation and another can be downloaded from net. Both were unsuccessful in my case. They work when I open some DLL but when I open LIB file, I get "Error: At least one file was not a 32-bit or 64-bit Windows module." Is there some other tool I can use?
Regards,
Rostfrei
|
|
|
|
|
Depends.exe and other dependency walking tools will only show the imports and exports in a DLL or EXE; I don't believe this is what you're after. I think the tool you need is Dumpbin[^] which comes with Visual Studio. Using this you can examine the symbols and contents of LIB and OBJ files.
Steve
|
|
|
|
|
That is exactly what I needed.
For anybody else: for Dumpbin to work you need to put "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin" to the PATH and also "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE" because Dumpbin needs mspdb71.dll to work.
Thank you Stephen!
Regards,
Marko Kukovec
|
|
|
|
|