|
Each Win32 process has its own independent address space, of which only the upper part is shared system wide. For example, address 0x10000000 can point to different data in process1 vs. process2.
http://www.amazon.com/exec/obidos/ASIN/0130869856
|
|
|
|
|
I thought it was clear that I ment address space when I wrote of "address start" (base address) and "address end". I know that it's called Address Space but I think the address space MUST have
a beginning (I think this is the BASE ADDRESS of a process, which I already figured out how to get it) and I also think it should have an END because I don't think a process uses all of the
momory in a system.
Ok what I want to know is how to get the "End-Address" of the ADRESS SPACE.
By the way I'm using Win9x.
Thanks for your reply
Tommy
|
|
|
|
|
I am using a form view as my view object.
Using NT workstation 4.0 service pack 5, I can not
insert any more control after 340 controls. My controls
are only static and edit controls.
I have a big table like a matrix. So I have to
have around 500 controls. As far as I know, having much more
controls on one form with Visual Basic is OK. But why not in VC.
I have several other form views, I just switching forms one to other,
without any trouble.
What can be the reason for having the limited number of control on one
dialog resource ?
|
|
|
|
|
Sounds like a bug in the IDE, edit the .rc file yourself.
|
|
|
|
|
As far as I know the resource compiler will not handle more than 255 controls correctly.
May bew you could write you static text dynamically onto the view instead of using a control for every single text.
Kurt
|
|
|
|
|
I'm relativly new in pogramming C++ (and MFC and Visual-Studio). Now I need a Dialog which
can be expand 2 times. I detected more examples (in internet...) of Dialogs which can expand 1 time.
But nowhere was a "multi-"expandable dialog.
Thanks in advance
Werner Raffl
(Vienna, Austria)
|
|
|
|
|
In witch way should it expand ?
Make your template in expanded size and hide the parts with movewindow, setwindowpos.
I think a Region (CRgn) could be useful, too.
hope it helped
-widi
|
|
|
|
|
Hi,
I have a class that connects to the internet. I have no problem using this class in one function (in response to a button click) using this code:
CInternet* iNet = new CInternet();
iNet->Connect();
...
...
However, how do I create the new object, say in InitInstance() and get a pointer to that object so that I can use it in different functions. Example:
InitInstance()
{
...
CInternet* iNet = new CInternet();
...
}
CClient::Function1()
{
iNet->SetServerName("Servername");
}
CClient::Function2()
{
iNet->Connect();
}
I don't think I'm ever going to get a handle on pointers. They confuse the hell out of me every time! ![Smile | :)](https://www.codeproject.com/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
hi,
You should make your CInternet class a data member of your application CApplication derived class. Then you initialize your internet connexion in your application "InitInstance()" and when you want to access to the iNet connexion, you use the following code:
in your CInternetApp.h:
public:
CInternet *iNet;
then modifie:
CInternetApp::InitInstance()
{
iNet = new CInternet();
}
access to the application data member frome anywhere in your application :
(from a CClient member function)
CClient::Function1()
{
CInternetApp *pApp;
pApp = (CInternetApp *)AfxGetApp();
// Accessing to the CInternet member of the
// CInternetApp class
pApp->iNet->SetServerName("Servername");
}
hope it help !
++ Benoit aka Falsem
authem_b@epita.fr
|
|
|
|
|
Thanks Falsem.
I had an idea that this was the route to go, but didnt know how to get there. It worked great.
Thanks,
Frank
|
|
|
|
|
You could make a constructor of the CClient class that takes a parameter of the type CInternet and/or a function to set it (SetiNet( CInternet* iNet ) ). I would implement both. If you have a connection before you construct the client, you will have the constructor to fall back on. If the connection is not yet established, you could use the set function when a connection is made after the construction of the client.
|
|
|
|
|
Hi there,
I'm relatively new to C & win32, and I'm having a few problems...
I'm trying to put a main menu inside a toolbar (which is contained inside a rebar). Although I've tried 101 different ways, I'm currently doing this...
HMENU hMenu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_MAIN_MENU));
SetMenu(hToolbarWnd, hMenu);
... but SetMenu fails. (where hToolbarWnd is a valid toolbar handle)
If anyone knows how to do this, then I would appreciate any help.
Thanks
Jon
|
|
|
|
|
I know this has to be simple, but when compiling...I get this error:
cannot convert from 'class CString' to 'char *'
How do I convert a CString to 'char *'?
Thanks!
Frank
|
|
|
|
|
CString str;
conversion -> LPCSTR(str);
|
|
|
|
|
I need to convert from CString to LPSTR. The conversion from CString to Constant CHAR* doesnt work for this function.
Any other ideas?
Frank
|
|
|
|
|
The CString provides operator LPCTSTR to perform the conversion to const char*.
This conversion is implicit if you call a method taking a const char * with a CString.
I find this a bit clunky, but you can use it explicitly and cast away the const like so:
(LPTSTR)(LPCTSTR)str
|
|
|
|
|
CString str = _T("fluff");
LPTSTR psz = str.GetBuffer(0);
str.ReleaseBuffer();
|
|
|
|
|
Worked great. Thanks Mike.
|
|
|
|
|
Have you tried this:
CString str;
(char*)(LPCTSTR)str
|
|
|
|
|
str.GetBuffer(0) does the work. Don't forget to call str.ReleaseBuffer
Also (LPSTR)(LPCSTR)str will be ok in the case you don't plan to play with the buffer
|
|
|
|
|
hi,
I currently tried to add a CMenu menu to a CDialogBar which is docked in a CReBar. My CMenu initialization and ressource loading work fine with a CDialog based dialog window, but it do not load any menu in a CDialogBar ...
(ie5 and most of the win2k dialog does this ...)
ex:
(just after my CDialogBar creation)
m_MyMenu = new CMenu();
m_MyMenu->LoadMenu(IDR_DLGBAR_PRODUCT_EDITOR)
ASSERT_VALID(m_MyMenu);
m_wndDlgBar.SetMenu(m_MyMenu);
m_MyMenu->Detach();
(m_wndDlgBar is correctly docked in my ReBar)
---> no assertion, but no menu displayed !
(this code work if you do a CDialog::SetMenu(m_MyMenu)
I see plenty application doing this, can someone help me ?
thanks in advance,
Benoit
email: authem_b@epita.fr
|
|
|
|
|
The menu bar in IE isn't a menu. It's a toolbar where the buttons have no images, just text.
I have seen an article on how to duplicate the menu bar, but it was a while ago I can't remember where the article was. Probably an issue of MSDN mag (or the old MSJ).
|
|
|
|
|
For anyone interested, the article is on MS's site here and in the VC help under \Periodicals\Periodicals 1999\MSJ\January\Q&A C++
|
|
|
|
|
Does anyone know how to hide Close button from the system menu of a modeless dialog box?
I am able to disable it.
|
|
|
|
|
Hi,
I currently have a Dialog based application written in Visual C++ 6.0 SP2 using MFC 6.0 in the Visual Studio 6.0. I am currently on Windows 98 but the app needs to work under Windows NT 4+, and Windows 2000 as well.
On the dialog box I have implemented 'F1' help. I did override OnHelpInfo() so that I could specify which control to get help for (standard windows operation is to get help on the 'dialog', not each control).
Now I am trying to implement 'Shift+F1' help. When the user clicks on the '?' in the title bar, or presses 'Shift+F1' the cursor changes to the 'Help cursor' and they should get help for the next item they click. In this app the cursor does change properly, but I am having trouble catching the info about the control they click.
If I go to my override of OnHelpInfo(), this function does get run but the dwContextId member of the HELPINFO structure is NULL.
I checked out the MSDN help and according to technical note 028, the application should post a message WM_HELPHITTEST, when the user clicks the control with the 'Help Cursor', to the CWnd which was clicked, and then to its parent, etc.
I have included that message in my Message Map and it does not appear to have been posted because my dialog box is not catching that message.
Any thoughts on how I can identify on which control the user wants help?
Any info will be appreciated
Jeff
|
|
|
|