|
Thanks.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Windows 32 bit maintains 2 Gigabyte of address space for User Mode processes and 2 Gigabyte of address space for Kernel Mode (Which is segmented into Session Space and System Space).
This causes memory below 80000000h to be "user mode" and memory equal to or above this number to be a kernel mode address.
So, depending on how many DLLs you have loaded into your process, how much physical/virtual memory is on the system, how much you can allocate varies.
There are two methods that you can use to extend your user mode address space. The first is the /3GB switch. This will allow you to use 3 Gigabytes of User Mode space and restrict the kernel to 1 Gigabyte... So, what's wrong with this?
1. You're limited to 1 Gigabyte of kernel address space. So, don't plan on loading tons of heavy drivers or using this as a scalable multi-user system.
2. The drivers and applications you load should not depend on using "80000000h" as a check to determine if an address is user or kernel.
So, what's the other method to extend into more memory? Buy more! You can buy 8 Gigabytes of memory! So, how do you use more than 32 bits of memory on a 32 bit system? The answer is that the Operating System can use 36 bit addressing on some machines that support PAE (Physical Address Extensions) (/PAE). This allows the OS to use that 8 Gigabytes for user mode applications since it can swap in a different set of page tables for each process. You as an application programmer may also take advantage of this using AWE (Address Windows Extensions).
Physical Address Extensions[^]
Address Windowing Extensions[^]
Alternatively you can use memory mapped files and create section views to various parts of the file to simulate large memory yourself as well.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Hi
I have to develop a client server application where the client is an MFC SDI application & my server is a dialog based application.
I m using Winsock2 as the communication mechanism between client & server.
The basic skeleton is developed. Sockets at both ends r successfully created & binded. Client has successfully connected to server.
Now the next thing is client sending some data to the server.
My question is where should i write the recv() so that the server is able to receive all what is send by the client.
Also does the server receives any notification that the data is coming.
|
|
|
|
|
Hi,
you can simply create a thread for any incoming connection, and there you recv data in an endless loop:
do{<br />
ret = recv(sock, buf, len, 0);<br />
}while(ret>0);<br />
Or you create asynchrone sockets. With this way, you get a WM message when an action to your socket happens (new client wants to connect, data is incoming etc.), then you can react on it, and do your stuff...
EDIT: check out the following message from Jack Squirrel posted on another thread:
Try the Winsock Programmer's FAQ<br />
<br />
<a href="http://tangentsoft.net/wskfaq/" rel="nofollow">http://tangentsoft.net/wskfaq/</a>[<a href="http://tangentsoft.net/wskfaq/" target="_blank" rel="nofollow" title="New Window">^</a>]<br />
<br />
<br />
<a href="http://tangentsoft.net/wskfaq/articles/io-strategies.html" rel="nofollow">http://tangentsoft.net/wskfaq/articles/io-strategies.html</a>[<a href="http://tangentsoft.net/wskfaq/articles/io-strategies.html" target="_blank" rel="nofollow" title="New Window">^</a>]Which I/O Strategy Should I Use?<br />
<br />
If I remember correctly, there should be sample C code of the various techinques somewhere on that site.
DKT
|
|
|
|
|
Dear all,
I'm beginer, Can you help me to distinguish between "class" and "struct" in C++ ?
Thanks!
Remis
|
|
|
|
|
not much difference, the first is class members are by default private, and struct members are public, unless you explicitly change their access level.
http://www.priyank.in/
|
|
|
|
|
Members of a class are by default private whereas members of a struct are by default public. Apart from that, there is not much of a difference.
Usage wise, structs are generally used to represent PODs (Plain Old DataType) whereas classes are used to more complicated datatypes (with constructors/virtual functions...)
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello,
There is no 'real' difference in these types. The only reason that there is a struct in C++ is because it was there in C. It's there for backwards compatability.
As other members stated, the little difference between the two is the default access of members.
I also got the blogging virus..[^]
|
|
|
|
|
There is a lot of difference b/w struct in C and in C++.
The first and the fore most thing is that C++ structure are nearly equivalent to the classes with some exceptions. They are active data structures.
but in C the structures is a grouping data, they are as passive as any other data types;
binding of code and data is not possible in C structures. this makes them to remain passive.
|
|
|
|
|
Anonymous wrote:
There is a lot of difference b/w struct in C and in C++.
I believe that the original quesion was: The differences between "class" and "struct" in C++
I know that you cannot have member functions and such in C, but in C++ you can, either with a struct or a class. There is really no behavioral difference between them in C++
I also got the blogging virus..[^]
|
|
|
|
|
Hi All,
I am trying to specify the output tray (output bin) for specific printer. It is quite easy to specify the input tray but I couldn't find the way to specify the output tray. I can specify the output tray within PCL printer by sending the PrintString (Escape sequence: ESC&l#L)
Is any of the Master/Guru can help me? Thank you in advance
Cheers...
|
|
|
|
|
Anyone??? Master/Guru, please help...
|
|
|
|
|
Hi All,
When I am using CDC::StartPage() and CDC::EndPage() it does NOT honour the setting of "Start Printing Immediately". It means that if I have 10000 pages job, I must wait until it spooled completely before it starts printing to the printer.
I know that StartPagePrinter() and EndPagePrinter(), it does print the page even though the print job is not completely spooled. That means for 10000 pages job, the printer is start printing as soon as the first page is completely spooled.
Is this a bug in CDC::StartPage() and CDC::EndPage()? I do not want to use StartPagePrinter() and EndPagePrinter(). Is there any way around it so I still can use CDC to do an immediate printing?
Thanks for any help in advance
|
|
|
|
|
You also need to do a CDC::StartDoc() which informs the device a new job is starting. Then you do a CDC::StartPage() which informs the device a new page is being printed.
When don, you need to do an CDC::EndPage() for the end of a page and CDC::EndDoc() to inform the device that it has everything.
Take a look at the MSDN CDC::StartDoc documentation. There is an example in there.
Hope this helps.
Larry J. Siddens
|
|
|
|
|
Hi Larry,
Sorry if I wasn't make my question clear. What happen is that the page is start printing when it reaches CDC::EndDoc(). What I want is that the page starting to print as soon as it reaches CDC::EndPage() (NOT CDC::EndDoc()). Therefore if I have 10000pages job, I do NOT want to wait until it completely spooled before it starts printing.
The only way that I know to do this is using StartPagePrinter() and EndPagePrinter(). Of course, I need to get the printer handle by calling OpenPrinter() to get the printer handle, StartDocPrinter() before calling StartPagePrinter() and EndPagePrinter(), and finally EndDocPrinter() to indicate end of print job.
With this way, as soon as it reaches EndPagePrinter(), it will start printing. That means if I have 10000pages job, I can start printing as soon as the first page is completely spooled. (Please note that this will depend of the setting of your printer. Set your printer setting to "Start printing immediately").
Since my application is using a CDC to draw rectangle, etc... I do not want to change my application from using CDC.
Thanks for any help again in advanced...
Cheers
|
|
|
|
|
If I understand you correctly, you have a handle to a printer and want to use the CDC.
Look at CDC::Attach(). This takes the handle (HDC) and attaches it to the CDC so you can use it just like any other CDC. When you get done, you can use the CDC::Detach(). Unless you wish the ~CDC() to close it for you.
Hope this helps.
Larry J. Siddens
|
|
|
|
|
Hi Larry,
(No offence), but you are totally miss-understand my question. My CDC print is working perfectly. The only problem I have is when I need to print, say, 100000pages report (a hundred thousand pages report).
Currently if I wanted to print 100000pages report, I have to wait until 100000pages report to be COMPLETELY spooled before start to print the 1st page.
What I really need when I print 100000pages report is that as soon as the 1st page is spooled, I can print it straight away. So, I do NOT need to wait until 100000th pages is COMPLETELY spooled before printing the first page.
Now, this feature is currently supported by StartPagePrinter() and EndPagePrinter(). Unfortunately, I can’t use these two functions because I need to use CDC to draw text, rectangle, etc…
I know that I am still be able to draw the text, rectangle, etc, by passing the HDC, but it will involve too much modification on the application. Therefore, I must stick with CDC.
Do you know how to do this? Thanks again for any help in advanced
|
|
|
|
|
Friends,
AfxGetAppName() is an MFC function.
What is the API equivalent of this function ?? There is an API GetModuleFileName() but unlike AfxGetAppName() it returns the entire path.
Imtiaz
|
|
|
|
|
Why not split the string ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
char szPath[_MAX_PATH], szBase[_MAX_FNAME], szExt[_MAX_EXT];
GetModuleFileName(NULL, szPath, sizeof(szPath));
_splitpath(szPath, NULL, NULL, szBase, szExt);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
I am going to develop apps for autocadd. I have some ?'s.
Some customers only have AutoCad2004 or above.
I would like to use c# for all dev, but I want my screens to appear like they are part of the Autocad application. Some will be extremely complicated. Speed is an issue also
It must be compatible with 2004 or above. I cannot expect customers to use any energy at all to use my products
With those in mind, what version and should I go for MFC or .NET and, if .NET can it be c# or am I forcerd to use c++.net?
Can you give advice. Obviously I woulkd prefer c# for ease of use.
thanks,
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
What does Autocad expose to allow you to write plug ins ? Is it COM based ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
yes its com based. But I answered my question. Because to modify you must wrap the ADS library so its easier to do MFC.
thanks for helping though
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
If you're targeting AutoCAD 2004, then you'll be forced to use c++. The .NET framework is only supported in AutoCAD 2005 and 2006. Also note, with c++ you'll be forced to use Microsoft Developer Studio 2002, NOT 2003 and AutoCAD itself is based on that version.
If you need more questions answered, please feel free. My company (http://www.cadfx.com) does this all day as we specialize in AutoCAD developement (but not limited to).
--
Joel Lucsy
|
|
|
|