|
The memory footprint for Debug versions will be larger than Release versions, but this isn't what you are seeing. This is most likely a bug in your code and you should investigate it (sounds like a memory/resource leak from what you described).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
OK . .But why is it when I minimize, I always go back to the minimum possible memory ..i.e. 384K ..then it starts building up. The server receives something like around 10 connections per second and this can cause memory leaks that also I agree, but how come when minimizing it returns to 384K? When I restore it, because of SHOW_WINDOW, it takes another 300K and the memory becomes 700K. But it again starts increasing. .to a huge number. .even 110MB .. :-S but one minimize click . .returns to 384K. ..
Will look at memory leaks too!
Thanks
Varchas R S
|
|
|
|
|
Varchas R S wrote: ...the memory abruptly returns to 400K and again starts building up.
How are you verifying this?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Using Task Manager!! .. we have hosted the server and the connections per second is more than 10. so quite a lot of socket creation and socket closing that is done.. but minimizing the window is flushing some memory ... its strange ..
|
|
|
|
|
Varchas R S wrote: Using Task Manager!!
Which is not the best tool for what information you are after. Task Manager is simply reportng to you is the address space currently in use.
Varchas R S wrote: ...but minimizing the window is flushing some memory ... its strange ..
This is not strange at all. In fact it is quite expected. When a program's main window is minimized, the memory that the OS had reserved for it can be freed. If the window is restored, the OS must once again allocate memory for it.
See here for more.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If you do the follwing in VB6
<br />
Dim myVar as Boolean<br />
myVar = True<br />
<br />
Debug.Print myVar<br />
you'll see a 'True' in the debug window, but only on an english system, the string is actualy language dependent.
My problem now is that I need to read a text file that was written with VB6 with C++.
Therefore I need a list of the languages VB6 was shipped and the used strings to represent the value of a Boolean.
I know that this is more a VB than C++ question, but I don't know any good VB forum
Thanks
|
|
|
|
|
ABuenger wrote: but I don't know any good VB forum...
Including this one?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Including this one?
I thought it is only for VB.NET
|
|
|
|
|
i have displayed the valuess from database. when i change the TAB IN DIALOG it should not read from database.it should store the values in local structure.and when ever the TAB changes it display the values from the structure.how it is possible?
|
|
|
|
|
Arul Joseph wrote: when i change the TAB IN DIALOG...
What tab? Is this with a property sheet, or a tabbed dialog? In either case, once you add items to a list control, those items remain even as you select other tabs.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
tabbed dialog. first it read it from MS-access database and store it local structure.Then we take the data from that structure.dont refer every time to database.How to store in local structure?
|
|
|
|
|
Arul Joseph wrote: dont refer every time to database.
There shouldn't be a need to. What makes you think otherwise?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
Where can I download SDK for crystal report 10??
Thank you.
|
|
|
|
|
Somehow, I've lost the controls palette used for creating controls on a dialog box. How do I get it back?
Thanks in advance.
John P.
|
|
|
|
|
Go to Tools --> Customize --> Toolbars tab
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Right click on the tool bar and check on the option controls to get the controls palette
|
|
|
|
|
Does a setup file of an application created to be distributed via a CD differ from one created to be distributed via the web?
Fortitudine Vincimus!
|
|
|
|
|
No it need not be. Atleast we haven not used a different setup file for CD and a different setup file in the web. The only additional stuff in the CD could be the Autorun file which will be absent in the web.
HTH
|
|
|
|
|
Thanks.
Fortitudine Vincimus!
|
|
|
|
|
I have created a DLL (Hook.dll) in unicode using .net 2003. The builder use vc++. I am loading the dll dynamically with an hook into a target process (Main.exe) with an dll injector.
BOOL APIENTRY DllMain (HMODULE hDll, DWORD reason, PVOID lpReserved)<br />
{<br />
if(Reason == DLL_PROCESS_ATTACH)<br />
{<br />
DisableThreadLibraryCalls(hDll);
I have a function within the DLL(Hook.dll) that tries to get the DLLs(Hook.dll) file name and path (fullpath with filename of Hook.dll).
this is the original code, this code gets and reads the crc32 checksum of the Main.exe:
pEXEFile = fopen(pszEXEFileName, "rb");
now i have changed it to and can fopen and read the dll, when i use::
pDLLFile = fopen("C:\\Documents and Settings\\Shawn\\Desktop\\Hook.dll", "rb");
this code above works, it will open my dll and read it's crc32 checksum, when i place and load the dll from my desktop.
another code that works:
pDLLFile = fopen("\\Hook.dll", "rb");
this last code above works, when i move the Hook.dll into the same folder where the Main.exe is.
I thought that because I used LoadLibrary to load the DLL that it would be
in its own application space. So I figured I could just use the DLLs
Application component to extract the file name using GetModuleFileName
However, I was supprised to find that the returned name was the main
application not the DLL.
Is there another way to get the DLLs files name when dynamically loading it or is their a better way to use GetModuleFileName?
The problem is I do not know what directory the DLL was in when i inject the dll into the main program and I need to figure this out at run time.
what im trying to do is, get the fullpath to the injected dll at runtime, fopen the dll then to read it in binary mode and get a crc32 hash from the dll, check the retrieved crc32 checksum and validate the dll, if the dll was altered, exit the Main.exe.
i got some example code and need now some help, how could i bring the code to give me the fullpath of my loaded module "Hook.dll" from the Main.exe
example codes:
extern HINSTANCE _hInstance;<br />
<br />
const char *OurFileName()<br />
{<br />
static char our_filename[MAX_PATH + 1];<br />
<br />
if (!*our_filename)<br />
{<br />
GetModuleFileName(_hInstance, our_filename, sizeof(our_filename);<br />
}<br />
<br />
return our_filename;<br />
}
You can do something like this to get path of a loaded module: <br />
<br />
HMODULE hmod = NULL; <br />
<br />
LPCTSTR lpszModuleName = TEXT("MyLibrary.dll"); <br />
<br />
TCHAR szPath[MAX_PATH + 1] = {0}; <br />
<br />
hmod = GetModuleHandle(lpszModuleName); <br />
<br />
if (!hmod) <br />
<br />
<br />
GetModuleFileName(hmod, szPath, MAX_PATH); <br />
<br />
FreeModule(hmod); <br />
<br />
This copies path to the module into szPath.
Thanks for every help
Shawn
|
|
|
|
|
I'm coding a program which gives a stimuli and wait for the user's answer before giving another one. The user answer by pressing one of 2 keys, and at the moment the program seems to be storing extra key pressed for the next stimulis. For example, if the user is asked to answer a question but presses twice the key, the second hit is used to answer the next question. Could anyone point me to a way of flushing all these keypresses before asking the user for the real one? Thanks in advance,
I'm using a windows form and the KeyPress event handler (which I'm really not yet comfortable with) and visual c++ studio express
//Code in the form1 constructor :
this->KeyPress += gcnew KeyPressEventHandler(this, &Form1::Form1_KeyPress);
Form1::KeyPreview = true;
//Code for the function
void Form1_KeyPress(Object^ sender, KeyPressEventArgs^ e)
{
// Here I handle the key
}
Simon
|
|
|
|
|
i wonder if someone could help me with an issue im having converting a hex value to a binary string..
i am trying to convert the hex string 0x00C000000000 to binary which should work out to be 1100000000000000000000000000000000000000.
i am using std::stringstream to fist convert the hex value to decimal and this is where it seems to be failing.. for the hex string 0x00C000000000 the decimal equivalent should be 824633720832 but i am not getting that..
here is my code
<br />
<br />
std::string hexvalue = "00C000000000";<br />
std::string binary = "";<br />
<br />
long decimalVal;<br />
<br />
std::stringstream sstr(hexvalue);<br />
sstr >> std::hex >> decimalVal;<br />
<br />
std::ostringstream out;<br />
long digit;<br />
bool nonzero = false;<br />
<br />
for (long i = 31; i >=0; i--)<br />
{<br />
digit = (decimalVal >> i) & 1 ;<br />
if (!nonzero && digit)<br />
nonzero = true;<br />
<br />
if (nonzero)<br />
out << digit;<br />
}<br />
<br />
binary = out.str();
by the way, if i set hexvalue to a smaller number then it seems to work. for example.
std::string hexvalue = "12";
can anybody help me out here?
thanks in advance
|
|
|
|
|
doh!!! im a muppet... its always the way isnt it.. no sooner than you ask for help to a problem then you realise what your doing wrong! hehe
as soon as i hit the send button i realised my small "long" was to small, and so ive changed it to __int64 and all is sound!! - ignore me all
std::string hexvalue = "00C000000000";<br />
std::string binary = "";<br />
<br />
__int64 decimalVal;<br />
<br />
std::stringstream sstr(hexvalue);<br />
sstr >> std::hex >> decimalVal;<br />
<br />
std::ostringstream out;<br />
__int64 digit;<br />
bool nonzero = false;<br />
<br />
for (__int64 i = 50; i >=0; i--)<br />
{<br />
digit = (decimalVal >> i) & 1 ;<br />
if (!nonzero && digit)<br />
nonzero = true;<br />
<br />
if (nonzero)<br />
out << digit;<br />
}<br />
<br />
binary = out.str();
-- modified at 11:26 Monday 7th August, 2006
|
|
|
|
|
Hello,
How can change the working directory of NT service from WINNT\system32 to the
exe directory (C++ unmanaged)?
Thanks,
|
|
|
|
|