|
If what you're after is having commited pages with increasing contiguous addresses without imposing an a priori limit, you can always reserve the largest block of memory the system allows you to (which is 2GB minus some safeguard amount of memory for the rest of the program and libraries, say 1.8GB). After all, reserving such a huge block of memory costs nothing --the system is only doing some bookkeeping of your request.
It's better to reserve this block of memory as soon as you can, so that the memory hasn't been fragmented by then.
If you run out of memory after consuming the 1.8GB, then there's nothing more you can do: a process cannot simply handle more memory than that.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi
I hope this question is an easy one for all you experts here at CodeProjetct
I have a dialog based app that launches another modeless dialog in OnInitDialog using Create and ShowWinow. So far everything works.
I declared a new struct using
struct CONFIG
{
CString one, two, three, andsoon;
}
The main dialog has a member variable named
CONFIG cfg
Now my question:
My second dialog needs to have access to this variable in order to read some values out of it
How do I set it up in order to be able to read values from CONFIG cfg from my second, modeless dialog?
regards
Gregor
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi Gregor,
If you created the modeless dialog from the main dialog with something like Create(ID_MODELESS_DLG,this) (where this refers to the main dialog) then the modeless dlg has the main one as its parent, and the sentence
((CYourDlg *)GetParent())->cfg access the variable cfg . Note the casting to CYourDlg * (or whatever your main dialog class is called).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
i used this article http://www.codeproject.com/com/vb_from_vc.asp to call a function from a vb dll but if i created a function with multi params then for some reason my string gets lost!!
I have used this in visual basic:
Sub irc_1_client_init(ByVal what_nick_name As String, ByVal what_server As String, ByVal what_channel As String)
blah
end sub
--------------------------------------------------------------------------------
and in c++ i call the function like this :
irc_clientClass->irc_1_client_init(_bstr_t("blah"), _bstr_t("east.gamesnet.net"), _bstr_t("#blah"));
but when the event triggers it dont send the strings to the dll for some reason the strings get lost!
|
|
|
|
|
There is an article here:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q145616
which explains how to activate the cut, copy, paste commands of Edit. The second step says:
Add an UPDATE_COMMAND_UI handler for ID_EDIT_COPY & ID_EDIT_CUT:
What exactly does that mean? If I add a public member function
public:
void OnUpdateNeedSel(CCmdUI* pCmdUI);
The program seems to work okay. I just don't understand what UPDATE_COMMAND_UI means. Do I need to add something to BEGIN_MESSAGE_MAP????
Please, please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Those UPDATE_COMMAND_UI handlers are called by the framework to determine whether the handled command (ID_EDIT_COPY , etc.) should be enabled or disabled on your menu. If you don't provide those, my guess is that the commands "Copy" and "Cut" will remain enabled all the time, even when there's nothing to copy (nor cut).
Do I need to add something to BEGIN_MESSAGE_MAP????
Yes you do. Check the online help about ON_UPDATE_COMMAND_UI for more info on how to add such handlers.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi all,
I maked a MFC project without Help Support !
So, i made .HLP and .CNT ( a help with index list ! not bad )
i made .HM file, too.
i added .HPJ and .CNT and .RTF and etc to my project, too.
But when i hit F1 button, program show me this error message:
"The topic does not exist. Contact your application vendor for an updated Help file(129)."
Ahhhh, GOD !
Help me
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
How and where do I cahnge an icon in an SDI app? And am I limited it 16 bit colors?
Derek Smigelski
Dereks@mip.com
|
|
|
|
|
Mike Dunn's C++ FAQ teaches you how to do it.
As for the number of colors, I think you are not limited to 16 (just try to know).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm designing a 3D graphics software, using OpenGL on a visual C++ compiler for all the graphics stuff. But as far as the non graphics stuff goes, I'm probably just going to use MFC. How do I use them together. For example, I just created a window and did all the animation stuff using OpenGL. How do I know use MFC to put little menus and buttons on the screen to do stuff. Or should I just use OpenGL for all that stuff?
|
|
|
|
|
I've got a little app I'm writing, and I went dialog based because I like the "toolbox" and "view window" (the view isn't an MFC view, just a control that behaves like one). Basically I want to have a view take up two thirds of the mainframe and one third with buttons etc stuck on it. Any suggestions?
jon brown
|
|
|
|
|
Hey'all, i need something that'll block the keyboard and mouse so the user cant do anything anymore (or f*** things up like Bill would say it :p) but so you can still use SendInput and control the mouse and keyboard input programatically. Does anyone know a way to do this?
Thanks in advance.
Kuniva
--------------------------------------------
God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.
|
|
|
|
|
Put a hook on keyboard and mouse messages, and throw them away.
See articles on this site about System Hooks.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Okay, it isnt done yet and this is the first time I have ever used arrays. Visual Studio 6.0 gave me 21 errors, and I dont know how to fix it.
heres the code:
// Password Generator.cpp : Randomly generates an 8 charactor password.
//with swapping vowls and consenents for maximum pronounciblity.
#include "stdafx.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
char cons[19];
char vowl[6];
int number[10];
cons[0]="b" || "B";
cons[1]="c" || "C";
cons[2]="d" || "D";
cons[3]="f" || "F";
cons[4]="g" || "G";
cons[5]="h" || "H";
cons[6]="j" || "J";
cons[7]="k" || "K";
cons[8]="l" || "L";
cons[9]="m" || "M";
cons[10]="n" || "N";
cons[11]="p" || "P";
cons[12]="r" || "R";
cons[13]="s" || "S";
cons[14]="t" || "T";
cons[15]="v" || "V";
cons[16]="w" || "W";
cons[17]="x" || "X";
cons[18]="z" || "Z";
vowl[0]="a" || "A";
vowl[1]="e" || "E";
vowl[2]="i" || "I";
vowl[3]="o" || "O";
vowl[4]="u" || "U";
vowl[5]="y" || "Y";
int number[0]="1";
int number[1]="2";
int number[2]="3";
int number[3]="4";
int number[4]="5";
int number[5]="6";
int number[6]="7";
int number[7]="8";
int number[8]="9";
int number[9]="0";
return 0;
}
"To wonder is to begin to understand"
|
|
|
|
|
First, cons is declared as an array of 19 characters. You are attempting set each item to a string logically or-ed with another string. The or-ed strings will result logically in a just a one. You probably want to set them to single character value so use the single quotes around each one. This applies to vowl also.
Second, number is already declared as an array of 10 integers. You have an int in front of each use of them. Also, you probably don't want to set each entry in the int array to a string. To set each one to an integer value you need to lose the double quotes.
|
|
|
|
|
If you're new to arrays, I assume you're relatively new to programming. In which case, you should be creating console apps, not Win apps. Replace the WinMain() function with a standard C-style main(). Also, you should use the "Console application" in App Wizard.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
okay, what does this mean?
error C2440: '=' : cannot convert from 'char [2]' to 'char'
I got 25 of these for that code.
"To wonder is to begin to understand"
|
|
|
|
|
"b" is a character string of length 2. If you want just the character 'b', then use single quotes.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
I have what may be a simple question. I have a couple of DOS apps that I would like to have a Windows Front-End for. I know how to launch the apps from the windows app, but I want the output to be piped directly into text box (or something like that), instead of sending it to a text file then reading the text file one line at a time. Is there a simple way to capute or redirect the screen output to a window?
Thanks,
Leo T. Smith
Senior Programmer/Analyst
Hartwick College
|
|
|
|
|
This bit sends cout to a console
<br />
if( !AllocConsole() )<br />
MessageBox(_T("AllocConsole failed."));<br />
<br />
m_hConsole = GetStdHandle(STD_OUTPUT_HANDLE);<br />
freopen("CONOUT$", "wt", stdout);<br />
cout = new stdiobuf(stdout);<br />
|
|
|
|
|
|
I need to delete the following recursively programatically. Any ideas??
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Enum\Root\LEGACY_NETBIOS\
Thanks,
Derek Smigelski
DerekS@mip.com
|
|
|
|
|
Are you really sure you want to do that?
|
|
|
|
|
Yes, not that exact registry path but a protected one yes. How can that be done programmatically?
Derek
|
|
|
|