|
SetActive() is for select page among the set of pagess.but my requirement is delete the page and addpage into property sheet from another view dynamically.
|
|
|
|
|
rgchezhian wrote:
but my requirement is delete the page and addpage...
Then use RemovePage() and AddPage() respectively.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yes i used but i couldn't delete or add.since i couldn't get the handle of property sheet from my treeview.
|
|
|
|
|
I am trying to centre the dialog launched by the GetOpenFileName API function. My hook function tries to centre the window in response to the WM_INITDIALOG but has no effect - the dialog still appears in the top-left corner. The hook function is definitely being called.
I've tried responding to all the messages that the hook function is called with and still nothing happens.
If anyone has any ideas what else I could try I'd be very grateful,
Thanks,
Stuart
UINT CALLBACK OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
UINT uiRetCode = 0;
switch(uiMsg)
{
case WM_INITDIALOG:
CWnd* pWnd = CWnd::FromHandle(hdlg);
if(pWnd != NULL)
{
pWnd->CenterWindow();
}
uiRetCode = 1;
};
return uiRetCode;
}
// Display file selection box
OPENFILENAME ofn;
memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
// Define filters. Get all link files (shortcuts)
ofn.lpstrFilter = _T("Shortcuts (*.lnk)\0*.lnk\0");
// Set the dialog title
ofn.lpstrTitle = _T("Resource Finder");
// Set the initial directory to be the All users Start Menu
ofn.lpstrInitialDir = tempString;
// Specify a buffer to hold the file selections
ofn.lpstrFile = path;
ofn.nMaxFile = MAX_BUFFER;
ofn.Flags = OFN_ALLOWMULTISELECT | OFN_EXPLORER | OFN_PATHMUSTEXIST
| OFN_FILEMUSTEXIST| OFN_HIDEREADONLY | OFN_ENABLEHOOK ;
ofn.lpfnHook = OFNHookProc; //Addr of callback
// Display the dialog
int nResult = ::GetOpenFileName(&ofn);
|
|
|
|
|
Change 4 this
CWnd* pWnd = CWnd::FromHandle(::GetParent(hdlg));
Best regards, Mauro.
|
|
|
|
|
Thanks very much Mauro, this works perfectly! Anyone wondering why the article on MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/commondialogboxlibrary/commondialogboxreference/commondialogboxfunctions/ofnhookproc.asp
explains it.
Stuart
|
|
|
|
|
Hi all,
Sorry if this has been asked before (I couldn't find anything) but does anyone know if its possiable to use the MSDN collections that come with VC.NET with VC6? All I can find is they are "not compatable", but I was wondering if anyone knew a workaround.
Cheers
|
|
|
|
|
The last MSDN that could be used with VS6 is October 2001.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hiho@ll
i have a dialog which is resizable
the problem is, if i resize it using the borders of my dialog (not the minimize or maximize button) i get a blinking cursor in the lower right corner of my dialog
the cursor is drawn over the little triangle u have in resizable windows
i don't really know where it comes from?
i'm just using a tab control, a check box some static controls
anyone knows a workaround?
thx@ll
|
|
|
|
|
Hello,
I'm trying to change the size of a groupbox dynamically in an MFC application. I mapped a CStatic object to the groupbox, but could not find an appropriate function. It does not seem to be the riht way to me.
I will be glad if someone could give a hint.
Thanks in advance,
caykahve
|
|
|
|
|
|
This is how my mapped control is defined:
CStatic m_Groupbox1;<br />
<br />
DDX_Control(pDX, IDC_STATIC_G, m_Groupbox1) ;
I tried this line:
m_Groupbox1.SetWindowPos(&this->wndTopMost,NewStartPosX,NewStartPosY,NewWidth,NewHeight,SWP_SHOWWINDOW);
It did not help
|
|
|
|
|
and don't you have to redraw the dialog after resizing it (like Invalidate() ) ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I can change the size of the dialog, that works already with SetWindowPos(). However I also want to change the size of the groupbox on the dialog. that is what i cannot do.. I first resize and reposition the dialog, then try to do for the groupbox.
|
|
|
|
|
i dunno.....tis just a guess.....try calling the Invalidate function for the window.....maybe there is a change,but maybe not updated!!!!!
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
|
Thank you ThatsAlok, it works with MoveWindow().
|
|
|
|
|
Hi, i'm going to work on a project to redesign and implement a new look for an old application.
The language is c++. The purpose is having the following prerequisites (for which i need some
wise advice):
1. MENU's: The menu will be created on the fly from a database table with user preferences. In my menu's
I need icons next to the function names like in ms office. The menu's should, just as the toolbars, be
repositioned by the user.
2. TOOLBARs: The toolbars must be created on the fly from a database table with user preferences. The
toolbars must be dockable and there must be some support for toolbars that are 'too long', chevrons for
example. We should also need to remember the user's 'dockstatus' (in the registry or so probably). We
need tooltips. The toolbars can, just as the menu's, be customized by the user.
3. STYLEs: It is necessary to easily use other styles in the program (e.g. changing between office
2003, vs 2005, xp and other styles), like i have seen in demo's of the guys of http://www.bcgsoft.com/
This will be quite some work. Can some readers point me to (preferably free) components to use? I can
find a lot of examples on codeproject and codeguru, a lot of them are good solutions, but some are
small scale. For example I found a great class CMenuXP for XP style menu's/toolbars, it works, i have
used it, but it's not easy to adapt it to my needs (e.g. change styles at runtime) and it's certainly not
easy to merge it with other examples i need (e.g. one i found about chevrons).
So can someone point me to some (preferably free) components that provide a big part of the solutions i
can use?
|
|
|
|
|
Recommend you use (purchase) one of the MFC extension libraries on the market and save your self a lot of pain. DUNDAS or PROFESSIONAL USER INTERFACE (Theres and article on this one at CP).
You can also go to sourceforge.net, to look for opensource projects.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi,
In my project,the server should listen to several clients(multycast connection),and be able to send messages to the clients(different client every time).
The problem is that i don't have access to the client(each client is some unit
that has RS232 output,and uses RS232 to Ethernet converter and all the units
should act as network with my PC).
I assume that each client uses P2P connection(otherwise - broadcast connection is good enough).
Another problem is:
In multycast - after one client send a message to the server,and the server recieves this message,the clinet needs to connect to the server again,in order to send another message(i.e the client needs to connect every time he want to send a message).
I was told to set the socket of each client to nonblocking mode,and i've set every socket(after socket() function) - but it didn't work(select() still blocking my apllication).
Where do i need to set the socket to non blocking mode????
Any example or good tutorial????
With best regards,
Eli
|
|
|
|
|
hiho@ll
i just need to remove the system menu icon of an dialog, but the dialog must be resizeable using the minimize and maximize button on the upper right of the frame
if i use the options in the resource tab of my dialog the maximize and minimize options get disabled
one solution is remove the system menu icon in the program and enable the option for the system menu in the resource tab or the other solution, add the maximize and minimize button in my code and disable the system menu option in the resource tab!?
but how to do both ways? didn't found anything helpful in the CWnd or CDialog docu
thx@ll
|
|
|
|
|
modify the CDialog::OnPaint() function to change the behavior of your icon painting...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I need to capture Image from devices like digital camera, Webcam, Scaner,etc.
I don't anything about this. Anyone please direct me.provide links, samples if you know.
|
|
|
|
|
Hello Friends,
Please observe the first c++ program
#include <iostream.h>
class ABC
{
public :
void show()
{
cout <<"inside the show function"<< endl;
}
void show2()
{
cout <<"inside the show2 function" << endl;
}
friend void showme(ABC obj );
};
void showme(ABC obj)
{
obj.show();
obj.show2();
}
int main(void)
{
ABC xyz;
showme(xyz);
return 0;
}
Here a single object xyz is as the argument and in the friend function the object call the two member functions which is defined in the class ABC.
Please observe the second c++ program
#include <iostream.h>
class ABC
{
public :
void show()
{
cout <<"inside the show function"<< endl;
}
void show2()
{
cout <<"inside the show2 function" << endl;
}
friend void showme(ABC obj , ABC obj1 );
};
void showme(ABC obj,ABC obj1)
{
obj.show();
obj1.show2();
}
int main(void)
{
ABC xyz,xyz1;
showme(xyz,xyz1);
return 0;
}
In this c++ program two objects are passed as the argument for the friend function.In the main function two objects ie xyz ,xyz1 are passed as the arguments.
Both the program shows the same output.
My question is out of two c++ program , the optimized code is which one. If not the case the two programs how can I write optimised code for the c++ program which is described above.
One more question ? object are allocated space in the memory.when define a class and it members and member functions.Does class have its own memory space as it is with object of class?
Hoping for a reply,
Yours,
Phijo
|
|
|
|
|
hi,
i'm not sure to understand your whole question, but here is what i can say :
first, i cannot see any relevant change btween your two programs, except the fact tha the former has another ABC object. in this case, xyz and xyz1 are two distinct objects, but constructed the same way (that's why the outputs are the same).
i've got a question about your code...
why putting showme() functions as friend
when you have no data members (moreover no protected members) ? this could have been done with external functions because show() and show2() are public .
phijophlip wrote:
My question is out of two c++ program , the optimized code is which one. If not the case the two programs how can I write optimised code for the c++ program which is described above.
i don't understand this question, please reformulate... (what optimization do you want ? mem, speed ?)
phijophlip wrote:
object are allocated space in the memory.when define a class and it members and member functions.Does class have its own memory space as it is with object of class?
that's not exactly like this. data members are allocated in the stack while dynamically allocated datas are in the heap. this way, each object has its own datas, even if they contain the same values as another object.
BUT ! every objects of the same type share the functions of the class. that means that the functions code is written once in the code segment. to determinate which object is calling a function, the functiopn receive an implicite parameter (this ) that points the object. the static member functions have no this pointer, so, they can manipulate only static data members (shared with every objects of a same type).
i know what i explain is a bit deep, but look for these infos if you like to code better...
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|