|
Why are you doing manual virtual memory management for such a small amount of memory? If having a statically-allocated buffer is the goal, just do new BYTE[5*4096] and use that.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hi Mich
You mentioned a nice point,I wouldnt have thought of that.
Yes your right for small amount of memory its not a good way.But how about when I was to use larger blocks(for example: 100*4096).Does it work fine for that case ?
Though your right but allocating such small memory dynamically can have an advantage; Pages are not allcoated in physical memory until they are really needed.(Reserved memory is not allocated in physical memory till commited).
Thanks for your reply.
-- modified at 18:01 Tuesday 31st January, 2006
|
|
|
|
|
I think this can be possible to use your allocated space, As Mike was saying in another message, I am also not finding this much useful. As If you have some use of this in your mine, please let us know.
some points I found are :
** it'll never release memory, whenever you need memory you are just allocating(if not available then new page). If it started using same memory then it would become long task.
** If one have to use any dynamic variable like CArray, CMap etc. as used in MFC.
Regards,
Sumit K.
Never consider anything impossible before trying to solve that..---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
Hi,
Releasing memory is easy since I have stored the start address of pages in "bm" variable.Calling "VirtualFree" will do it.
About use of this :
Why I started to use it has a story.When I was very beginner.I decided to write a parser which can evaluate mathematical expressions.I implemented that using linklist and stack data structures.I stored my postfix form of my expressions in nodes of a link list.I allocated memory using "new" operator in that.I made it.After that I decided to make an application that draw functions graph using that parser I made.I coded the program.It worked in "Debug" version of my program.But when I changed the build mode to release.The program didnt work and It caused "Access violation" error.That was when I thought that "new" operator didnt work well.Because my program worked in debug mode but...
Thats why I became intrested to use my own memory management.This way I feel better.I want to know what I do .And to know Im doing it right...Story became long
Thanks
-- modified at 18:22 Tuesday 31st January, 2006
|
|
|
|
|
I'm writing code to try to interface with some custom data acquisition boards our company produces. Actually, I've written several interfaces for these boards over the years as changes in technology have forced us to adapt (ISA->PCI, DOS/Win3.1, Win9x, WinXP). Recent changes in motherboard design have foiled a kludge I've been using to acquire the P&P assigned port addresses for the boards, so I'm scrambling to find a way to acquire those port addresses.
I've downloaded the very excellent EnumDeviceProperties[^] demo project submitted by A. Riazi, but the properties enumerated by this project do not include the resources for Port, Base memory, IRQ assignments, etc., as are shown on the Device Manager properties resource sheet.
Obviously there is some way to access this information. Could someone point me in the right direction?
TIA,
-Dethulus
-- modified at 16:02 Monday 30th January, 2006
|
|
|
|
|
Does the driver support WMI?
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
I'm not sure how to answer that question. The current board was adapted from an ISA board with hardwired port addresses. This has been piggybacked onto a PCI interface using a PLX chipset. The devices show up in the Hardware Manager as "Other Devices" and they have valid port and base address values.
Using WMIC PORT I get a listing that includes the port addresses in use by the devices, but that doesn't give me enough information to determine which entries correspond to the devices I'm trying to address.
-Dethulus
|
|
|
|
|
I've solved my problem for the time being. Still yet I'd like to know how to work the magic of getting hardware resource information from the operating system, as the Device Manager and PCITree seem to be able to do. I'm sure it involves esoteric practices such as dynamically linking to hidden exported functions, but it would sure be nice when doing the kind of stuff I do.
In case anyone's interested my problem was not because of a kludge as I had initially suspected, it was because of a programming gaffe in a fellow programmer's code with a hardcoded bus number. The new motherboards were assigning our cards to a different bus. Everything else was working except for the line that used the hardcoded bus.
Anyway, thanks for the consideration...
-Dethulus
|
|
|
|
|
I am currently using VC2005 which provides XP style buttons by default. When I load an icon, though, the button changes to the old Office 2000 style. If all the buttons where the same style it wouldn't be a problem, but some buttons are XP style while the others are 2000.
Is there any way to change this?
Thanks!
|
|
|
|
|
AFAIK you'll have to draw the buttons yourself...
|
|
|
|
|
Hi all - I am trying to follow this Walkthrough from the msdn:
http://msdn2.microsoft.com/en-us/library/ms235628.aspx[^]
my problem is in the part where is says:
"To create a new Windows Forms control project
On the File menu, click New, and then click Project….
In the Project Types pane, select CLR in the Visual C++ node, then select Windows Forms Control Library in the Visual Studio installed templates pane.
I do not have this CLR project template... what am I missing?
I am running Visual Studio .net ver.2002, student edition.
Thanks for any info - mutty
|
|
|
|
|
I would assume this tutorial is for Visual Studio 2005 ( aka vs8 ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
yes, perhaps you are correct. How, then, do I create a new control using ver2002? I have been looking at various articles regarding creating custom buttons, but would like to find a 2002-era walk-through like the one posted.
Anybody help?
thanks -mutty
|
|
|
|
|
Already looked here[^] ?
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
I have used windows socket and template library and when I run the program got an exception completely stopping the program. So when I debugged the program, I observed that the address of a variable (A CPtrList Object actually) was not the orignial address, in the function where the exception occured.
Does anybody know the solution to this problem ?
|
|
|
|
|
RanjanShrestha wrote: I observed that the address of a variable (A CPtrList Object actually) was not the orignial address, in the function where the exception occured
how are you finding this address ?
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Use the watch window and enter the variable with the deferencing symbol. For Ex: &Var_Name
This shows the address of the variable in hex format 0xXXXXXXXX
|
|
|
|
|
you get an adress in hex ? how shocking !!!
seriously, are you in debug mode ? how do you know that the adress is different ?
are you certain that you break point is really set that that line of code ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: you get an adress in hex ? how shocking !!!
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
the addresses of variables may change between calls to the same function, as the program runs.
but, it wouldn't be unusual to find that your app has corrupted its stack in some way. track down those stray pointers...
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
What was the exception (access violation, division by error, illegal instruction, etc...)? Have you got a stack trace and some code from around "ground zero"? In general this is the bare minimum information required to diagnose such a fault. I also like to have the disassembly (machine code) of the code around ground zero as a bit as x86 knowledge and this information allows you to tell where in a line the fault occurred.
Steve
|
|
|
|
|
Hello there,
We just uprgraded to vc8 (aka Visual Studio 2005). Our project is very large, and it would be nice to split it up into a number of dlls to avoid compiling the whole project each time.
How do we share those dll binaries along with the debug symbols among the team? Is there any special way to do this?
Thanks,
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
The most common way I have seen is to set up a common bin directory for each project/app. The debug dll's have a 'D' appended, the release dll's have an 'R' (or nothing). Copy debug symbols into bin directory too.
|
|
|
|
|
Ok, but what if you are debugging a particular dll, or you haven't committed all the code changes for it --- where does it go? You don't want to break the builds of other team members, so you can't put it into the common bin directory.
Or perhaps you can use the Tools|Options|Executable Paths or whatever to set it up to go to your local build path, and if not there, go to the shared directory?
Hmmm...
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
I have developed a very simple client server program using document/view architecture. it has a socket class derived from CAsyncSocket which has functions to handle OnConnect(), OnReceived, OnAccept() messages. When i run this program, it gives error "Unhandled Exception in th2.exe: 0xC0000005: Access Violation". Could anyone tell me how to solve it?
|
|
|
|