|
Thanks. This is probably the only way out. Here is a fragment from
Q & A: C++ (Periodicals 1998) from MSDN Library 1999 that does something
similar:
After calculating the heights of the toolbars, the next troublesome task is calculating the height and width of all the splitter window components: the border with which it surrounds each pane and the splitter bar itself. All these magic numbers are contained within data members in CSplitterWnd, but naturally the data is protected, which means you can’t access it! Sigh. So what do you do? Simple: just derive a new class with public functions to export the protected data, and use it instead of CSplitterWnd in your main frame.
class CMySplitterWnd : public CSplitterWnd {
public:
CSize GetBorderSize()
{ return CSize(m_cxBorder,m_cyBorder); }
CSize GetSplitterSize()
{ return CSize(m_cxSplitter,m_cySplitter); }
};
|
|
|
|
|
(To be complete) this is what can be done:
CRect rect;
m_wndSplitter.GetClientRect(rect);
CSize splitter_size = m_wndSplitter.GetSplitterSize();
CSize border_size = m_wndSplitter.GetBorderSize();
int row_height = rect.Height() - ((splitter_size.cy * (m_rows - 1)) + (border_size.cy * 2));
int col_width = rect.Width() - ((splitter_size.cx * (m_cols - 1)) + (border_size.cx * 2));
row_height /= m_rows;
col_width /= m_cols;
for (int i = 0; i < m_rows; i++) {
m_wndSplitter.SetRowInfo(i, row_height, 100);
}
for (int j = 0; j < m_cols; j++) {
m_wndSplitter.SetColumnInfo(j, col_width, 100);
}
m_wndSplitter.RecalcLayout();
Regards
Mahendra
|
|
|
|
|
I have added a new ATL class in the project but now I want to remove this class from the project. How can I remove the class because If I remove the class manually then i need to remove other settings of the class also as it is an ATL class so it must be having enteries in the coclasses of the project.
Thanks in advance for ur help
Rits
|
|
|
|
|
Hm, not so easy work.
1st - remove the class .h and .cpp files (and delete/rename on HDD)
Then you'll have probably corresponding .rgs file in the project tree.
Then you need to remove corresponding parts in the projects .idl file - these should be probably the interface declaration IYourClass somewhere on the beginning of the .idl file. Then remove the coclass definition from .idl (should be somewhere at the end of the file).
Then last thing should be the OBJECT_ENTRY macro in the yourProject.cpp file.
Then rebuild the project and compiler will remind you about missed includes or macros.
|
|
|
|
|
Yes, u r right
I had to remove entries from the idl file also.
Thanks
Rits
|
|
|
|
|
Hi,
I'm not sure but i think that removing "class.h" and "class.cpp" files from the project will do the job.
Regards,
Eli
|
|
|
|
|
Hello,
How can I find out what program is running my program
by OpenWith... Dialog?
For example a user right-clicks on a file and chooses OpenWith...
and then my program.What is the address?How can my program knows
the address?
Please help me on this...
Thanks.
|
|
|
|
|
I'm not exactly sure what you are asking, but does AssocQueryString() or FindExecutable() help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi All,
I' m writing a Visual C++ MFC dialog-based program. I added a Menu bar uisng Insert->Resource-> Menu, not by writing code. Then, I tried to show and hide the Menu bar of a modal dialog dynamically but didn't succeed? Could anyone kindly help me?
Cheers,
hmc
|
|
|
|
|
I don't know any direct command that show/hide menu but the following will work too.
For removing menu bar at run time use following code
CWnd* pMain = AfxGetMainWnd();
if (pMain != NULL)
{
CMenu* pMenu = pMain->GetMenu();
while(pMenu != NULL && pMenu->GetMenuItemCount() > 0)
{
pMenu->DeleteMenu(0, MF_BYPOSITION);
pMain->DrawMenuBar();
}
}
For adding menu items again, use
AppendMenu
|
|
|
|
|
Hi Freind,
Thanks. But I only successfully hide the Menu, but not showing it again. Do I just need to replace "pMenu->DeleteMenu(0, MF_BYPOSITION);" to
"pMenu->AppendMenu(0, MF_BYPOSITION);" without changing other code?
Cheers
|
|
|
|
|
Can anyone help me find three different C++ statements for a source code that will print out the ASCII value of a character and only the ASCII value?
Thank you
|
|
|
|
|
#1
for(int i=65;<120;i++)
printf("\nASCII of %c is %d",i,i);
#2#3
I forget
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
There are 256 values in the ASCII table. If you are only wanting to print out the ASCII value, then you simply need to print out the numbers 0 through 255.
for (int x = 0; x < 256; x++)
cout << x << endl; It would be a little more useful if you printed out the ASCII character and its value:
for (int x = 0; x < 256; x++)
cout << (char) x << " = " << x << endl;
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Another option:
#include <iostream><br />
<br />
using std::cout;<br />
using std::endl;<br />
<br />
int main() {<br />
<br />
char character = 'A';<br />
cout << character << " " << (int) character << endl;<br />
<br />
return 0;<br />
}
|
|
|
|
|
I need help to make a simple application using Embedded Visual c++ 3.0
It's just a simple application that enables me to read and write files.
Write a file - save it - then retrieve it within the application.
Can anyone help to give me the codes needed for me to make the application work?? Thanks.
|
|
|
|
|
Using Win32 or MFC?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Using MFC. I need to do a simple Open/Save Dialog application. I'm a beginner and i ain't sure how to link the menu to the dialog.
Help please! Thanks.
|
|
|
|
|
CT Menot wrote:
Using MFC.
Ok, then you should check out the CFile and CStdioFile classes. They allow you to read from and write to a file.
CT Menot wrote:
I need to do a simple Open/Save Dialog application.
See if the CFileDialog class is what you are after.
CT Menot wrote:
...i ain't sure how to link the menu to the dialog.
What menu? While they can co-exist, menus and dialogs are not necessarily related.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have to make a mobile IP client. I understand the principles but I don't know how to implement it.
What I need to do is getting any packet passed to network layer from link-layer, then processing them before passing them to network-layer. But I don't know how to get those frames.
One friend told me that I have to hook some Windows API, which are used for processing link-layer's frames, another told me that perhaps data from link-layer is put in a buffer.
Any one can help me?. Please give me advises or ideas.
Thank you very much!
|
|
|
|
|
I think, if you'll search the MSDN or google for NDIS.
These drivers sits between the TCP and link-layer, so it should be suitable for your needs.
|
|
|
|
|
Thank you geo_m.
After posting the question, I found that Visual Studio provides Filter-Hook driver and Firewall-Hook driver
These drivers are provided with the same purpose of NDIS. But I don't know what is the best one to use in this case.
How about system-suplied IP filter driver? I heard about it but I don't know whether we can use it or not.
|
|
|
|
|
Yes, first I looked also for he firewall-hook, but it states in documentation that
It is not recommended to implement a firewall-hook driver (or firewall driver) for Microsoft® Windows® XP and later versions of the operating system
With filter-hook, it seems better for me, but the documenatation I have is still marked as preliminary, and there is no statement about supported operating systems (if important)
Personally I would go to NDIS driver, as it is a proven solution and you can probably find more samples.
System-supplied ip filter driver - didn't heared about.
One warning - if it somehow transfer the data from driver to user mode process, it can kill the overal performance of the network on the machine, as switching from user mode to kernel mode and back is quite expensive operation. So consider carefully which method is best for use also with calculations of the expected data flow.
|
|
|
|
|
Thank you geo_m!
Now I'm implementing using NDIS. However. What I need is an IP packet that has been added an Ethernet header. But I in a source code example I saw that what we get in the function MPSendPackets() is a packet which is added an Ethernet header.
What should I do now?
|
|
|
|
|
I'm not sure, that I understood the question. Can you rephrase it somehow?
Just meanwhile, you can check FAQ and related stuff @ www.ndis.com[^]
|
|
|
|