|
Hi all,
I am trying to allocate memory of more than 2GB using the system boot flag /3G and also i set the linker option /LARGEADDRESSAWARE. This should let me have atmost 3GB of allocation. After doing that, i try allocating slighly more memory than 2GB
BYTE* m_pDIB = (BYTE *)VirtualAlloc(NULL, (size_t)0x81000000, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
UINT32 ui32Err = GetLastError();
printf("\nVirtualAlloc(NULL, (size_t)0x81000000, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); Results: Address is %Xh and error is %d", m_pDIB, ui32Err);
I have also set the system virual memory(swap) to have bigger size than 3GB.
The error code returned is ERROR_NOT_ENOUGH_MEMORY with the VirtualAlloc returning NULL.
Any help in this regard would be greatly appreciated.
Best regards,
RUI
|
|
|
|
|
umarcool wrote: Any help in this regard would be greatly appreciated.
There has to be 2GB of contiguous memory available.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Why the hell would you allocate soooo much memory
|
|
|
|
|
Yes i have increased the virtual memory to 15 GB now but this still does not work
I am trying using the code given below:
BYTE* m_pDIB = (BYTE *)VirtualAlloc(NULL, (size_t)0x81000000, MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE);
UINT32 ui32Err = GetLastError();
printf("\nVirtualAlloc(NULL, (size_t)0x81000000, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); Results: Address is %Xh and error is %d", m_pDIB, ui32Err);
m_pDIB = (BYTE *)VirtualAlloc((LPVOID)0x81000011, 0x100, MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE);
ui32Err = GetLastError();
printf("\nVirtualAlloc(LPVOID(0x81000000), 0x1000, MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE); Results: Address is %Xh and error is %d", m_pDIB, ui32Err);
|
|
|
|
|
Hi all,
I want to enable Auto logon feature through my application. I got help for doing so manually from the below link.
http://support.microsoft.com/kb/315231[^]
But if i try to do it programmatically then i am not being succeeded in that. I made all three registry entries(AutoAdminLogon, DefaultUserName, DefaultPassword) correctly through programming as mentioned in manual steps in above link. If i do it manually it works.
But somehow it is not happening. can anyone please throw some light on this? It would be a great help to me. Please help me out.
Thanks
Hemang
|
|
|
|
|
When you add those value through code, can't you just open the registry and see if they are correct? The registry does not care how keys and values are created. If they are correct, something else other than your code is wrong.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello,
I have to use a smoothing algorithm in my COde. I am using Visual C++ .Net 2008 with 3.5 framwork.
I am reading a data through serial port from a target device and this data is store into a XML file. I have to display(plot) this data on the window. For ploting the waveform, i read the data from the XML file, and draw(Plot) the point using "Drawline" function. but the curve generated is not in Smooth shape. It shows some noise(like steps).So in this case I want to use smoothing algorithm but dont know how to use it.So plz can anyone tell me how to use smoothing algorithm? its urgent so plz help me out.
Thanks and Regards,
Abhijit
|
|
|
|
|
For urgent questions key plz into Google. For 'smoothing algorithm' you might try Googling for 'smoothing algorithm' or even for Bezier. Good Luck.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
how create a shortcut key of each button control mfc code
|
|
|
|
|
Put an ampersand (&) character before the shortcut key you want in the button's text.
For example: "&Cancel". 'C' is the shortcut key, and the button with this text can be invoked with Alt-C. The ampersand won't be displayed.
|
|
|
|
|
thank Alan Balkany,
that is working perfectly
thank u very much. 
|
|
|
|
|
mathy wrote: ...a shortcut key of each button control...
Also called a mnemonic.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
I am using a CTreeCtrl control in my application with a Single root node and having severla item.
I want when the CTreeCtrl is displayed the root should be intially be already expanded.
Please tell how to achieve it.
Thanks In Advance.
Dhiraj
|
|
|
|
|
|
Hi! I am asked to code an asynchronous non-blocking echo server in C++ that compiles in both Windows and Unix platforms. Having no background in networking, I don't know where to start. Any help would be appreciated. Thank you.
|
|
|
|
|
Does this[^] help?
Regards,
Sandip.
|
|
|
|
|
Thanks! I have background in C++ but don't have any background in network programming. Can I ask for a tutorial on how to begin coding my project? Any help would be appreciated. Thanks!
modified on Monday, October 20, 2008 10:37 AM
|
|
|
|
|
gamzi wrote: Can I ask for a tutorial
The link page previously provided to you has a "Tutorials" link too!
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
Hi! I found this code under the boost c++ libraries. I also read that it is platform independent. Here's the code:
#include < cstdlib>
#include < iostream>
#include < boost/bind.hpp>
#include < boost/asio.hpp>
using boost::asio::ip::tcp;
class session
{
public:
session(boost::asio::io_service& io_service)
: socket_(io_service)
{
}
tcp::socket& socket()
{
return socket_;
}
void start()
{
socket_.async_read_some(boost::asio::buffer(data_, max_length),
boost::bind(&session::handle_read, this,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
}
void handle_read(const boost::system::error_code& error,
size_t bytes_transferred)
{
if (!error)
{
boost::asio::async_write(socket_,
boost::asio::buffer(data_, bytes_transferred),
boost::bind(&session::handle_write, this,
boost::asio::placeholders::error));
}
else
{
delete this;
}
}
void handle_write(const boost::system::error_code& error)
{
if (!error)
{
socket_.async_read_some(boost::asio::buffer(data_, max_length),
boost::bind(&session::handle_read, this,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
}
else
{
delete this;
}
}
private:
tcp::socket socket_;
enum { max_length = 1024 };
char data_[max_length];
};
class server
{
public:
server(boost::asio::io_service& io_service, short port)
: io_service_(io_service),
acceptor_(io_service, tcp::endpoint(tcp::v4(), port))
{
session* new_session = new session(io_service_);
acceptor_.async_accept(new_session->socket(),
boost::bind(&server::handle_accept, this, new_session,
boost::asio::placeholders::error));
}
void handle_accept(session* new_session,
const boost::system::error_code& error)
{
if (!error)
{
new_session->start();
new_session = new session(io_service_);
acceptor_.async_accept(new_session->socket(),
boost::bind(&server::handle_accept, this, new_session,
boost::asio::placeholders::error));
}
else
{
delete new_session;
}
}
private:
boost::asio::io_service& io_service_;
tcp::acceptor acceptor_;
};
int main(int argc, char* argv[])
{
try
{
if (argc != 2)
{
std::cerr << "Usage: async_tcp_echo_server <port>\n";
return 1;
}
boost::asio::io_service io_service;
using namespace std; // For atoi.
server s(io_service, atoi(argv[1]));
io_service.run();
}
catch (std::exception& e)
{
std::cerr << "Exception: " << e.what() << "\n";
}
return 0;
}
I'm having a hard time understanding this code. Can someone familiar with this code help me out in understanding how the code works? Really sorry because I'm not really familiar with network programming. Thank you.
|
|
|
|
|
I am not clear as to whether you always need to declare a session class to be able to use asynchronous read and write functions? And also I'm not really that clear about the flow of the program. Thank you and any help would be appreciated.
|
|
|
|
|
|
Hi All!
I'm creating a project and i'd like someone to tell me a way to change multiple controls properties
(ie: Enable, Display, Change texts ...) whenever i click on different tree items.
Is it ok to use EnumChildWindows?
Or is there any other method?
Thanks for any reply!
|
|
|
|
|
Dennis L wrote: Is it ok to use EnumChildWindows?
It depends on your requirement.
If you want to modify less number of controls you can add the control variables for these controls and use them.
EnumChildWindows will enumerate all the child controls which might not be efficient if your dialog has huge number of controls and you need to alter only 4-5.
BTW: Use some relevant title for your post.. "Hi All" does not relate to your query in anyway.
Regards,
Sandip.
|
|
|
|
|
Hello everyone,
I am learning how to use WinHttp to do .Net Passport based authentication. I read a couple of documents, like this,
http://msdn.microsoft.com/en-us/library/aa384067.aspx[^]
my question is I want to find some external web site to do more testing, i.e. to request to access some Url, and if supply with the correct .Net Passport credential, the authentication will pass, if not the authentication will not pass. My confusion is I tried some ones, but seems are all Http Forms based authentication.
Could anyone suggest some web sites?
thanks in advance,
George
|
|
|
|