Click here to Skip to main content
15,922,007 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Recycle bin API restore all files API Pin
Dominik Reichl21-Aug-03 20:48
Dominik Reichl21-Aug-03 20:48 
GeneralRe: Recycle bin API restore all files API Pin
rohit.dhamija21-Aug-03 20:55
rohit.dhamija21-Aug-03 20:55 
GeneralRe: Recycle bin API restore all files API Pin
David Crow22-Aug-03 2:58
David Crow22-Aug-03 2:58 
GeneralSimple Problem VC++6 Pin
questaware21-Aug-03 19:01
questaware21-Aug-03 19:01 
GeneralRe: Simple Problem VC++6 Pin
Member 34642221-Aug-03 19:05
Member 34642221-Aug-03 19:05 
GeneralRe: Simple Problem VC++6 Pin
Michael Dunn21-Aug-03 19:45
sitebuilderMichael Dunn21-Aug-03 19:45 
Generalsizeof() problem Pin
IceBerG7121-Aug-03 17:49
IceBerG7121-Aug-03 17:49 
GeneralRe: sizeof() problem Pin
Brad Sokol21-Aug-03 18:06
Brad Sokol21-Aug-03 18:06 
The Intel processors are most efficient when accessing data that is located at memory addresses that are a multiple of eight (I think). This is common with many microprocessors.

Visual C++ defaults to locating structure members on 8-byte address boundaries. Each data element of a structure (or class) will be located at next memory address that is a multiple of 8. This can be changed in the project settings under C/C++, Code Generation.

You can also get fine grained control using #pragma directives in your code. This might be a better approach since you could pack your structures passed to VB on 1-byte boundaries and leave all the internal stuff at the default of 8 which is much more efficient.

Here is a sample:

<br />
#pragma pack(push, test)<br />
#pragma pack(1)<br />
struct Five<br />
{<br />
	int i;<br />
	char c;<br />
};<br />
#pragma pack(pop, test)<br />
<br />
struct Eight<br />
{<br />
	int i;<br />
	char c;<br />
};<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
	Five five;<br />
	Eight eight;<br />
	cout << sizeof(five) << endl;<br />
	cout << sizeof(eight) << endl;<br />
<br />
	return 0;<br />
}<br />


Hope that helps.

Brad
GeneralRe: sizeof() problem Pin
IceBerG7121-Aug-03 18:58
IceBerG7121-Aug-03 18:58 
GeneralNeed some help with CreateProcess() Pin
Flack21-Aug-03 17:22
Flack21-Aug-03 17:22 
GeneralRe: Need some help with CreateProcess() Pin
Brad Sokol21-Aug-03 17:31
Brad Sokol21-Aug-03 17:31 
QuestionNeed I define a function as &quot;extern&quot;? Pin
George221-Aug-03 15:46
George221-Aug-03 15:46 
AnswerRe: Need I define a function as &quot;extern&quot;? Pin
Brad Sokol21-Aug-03 16:54
Brad Sokol21-Aug-03 16:54 
GeneralRe: Need I define a function as &quot;extern&quot;? Pin
George221-Aug-03 23:28
George221-Aug-03 23:28 
GeneralRe: Need I define a function as &quot;extern&quot;? Pin
Brad Sokol22-Aug-03 1:52
Brad Sokol22-Aug-03 1:52 
GeneralRe: Need I define a function as &quot;extern&quot;? Pin
George222-Aug-03 2:10
George222-Aug-03 2:10 
AnswerRe: Need I define a function as &quot;extern&quot;? Pin
Maxwell Chen21-Aug-03 20:09
Maxwell Chen21-Aug-03 20:09 
GeneralRe: Need I define a function as &quot;extern&quot;? Pin
George221-Aug-03 23:24
George221-Aug-03 23:24 
GeneralRe: Need I define a function as &quot;extern&quot;? Pin
Dangleberry22-Aug-03 4:09
sussDangleberry22-Aug-03 4:09 
GeneralRe: Need I define a function as &quot;extern&quot;? Pin
George224-Aug-03 0:47
George224-Aug-03 0:47 
General3D layer visualization Pin
coda_x21-Aug-03 15:29
coda_x21-Aug-03 15:29 
GeneralRead DLL source code Pin
wow999921-Aug-03 15:24
wow999921-Aug-03 15:24 
GeneralRe: Read DLL source code Pin
Brad Sokol21-Aug-03 16:18
Brad Sokol21-Aug-03 16:18 
GeneralRe: Read DLL source code Pin
Ryan Binns21-Aug-03 16:31
Ryan Binns21-Aug-03 16:31 
QuestionWhat project type to choose to run on all windows Pin
Chris Ormerod21-Aug-03 14:23
Chris Ormerod21-Aug-03 14:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.