|
Greatly appreciated assistance. Is there any way to force one of these checkbox buttons to pop back up when another button is pressed (just curious). Thanks again.
|
|
|
|
|
Yes when you mapped a variable of type control to the dialog item id, you can use the variablename.SetCheck
-Erik
|
|
|
|
|
I need to create some property pages that depends of the same dialog box, and the data stored in those property pages only differs by its owner, then I would change the caption for the assistant window when every property page would be selected.
This is my piece of code:
for (iCounter = 0; iCounter < 5; iCounter++)
{
CaptionPPAgACT.Format("Paràmeters for: %i",iCounter + 1);
m_PPag2[iCounter].m_psp.pszTitle = CaptionPPAgACT;
m_PPag2[iCounter].m_psp.dwFlags |= PSP_USETITLE;
AddPage(&m_PPag2[iCounter]);
}
Thank you in advance for your help.
|
|
|
|
|
Hi,
i want to get hwnd of control in another window from my app
and then call the getwindowtext function to get its title or value
if you have a solution related this, please to show it to me.
thank you
hqu0c
|
|
|
|
|
I suppose the other window is a dialog:
- get the control's hwnd with GetDlgItem(dlgHwnd, ctrlID)
where dlgHwnd is the dialog's window handle and ctrlID is the control id.
Paolo.
|
|
|
|
|
I am new to MFC, and I was puzzled about the principle "Object Serialize". And I wish somebody can explain it to me, how the things done. very thankful.
|
|
|
|
|
When an object is serialized, it means it is converted to a stream of data that can be stored in persistent storage, or sent across a communications channel, then reconstituted into an object at a later time.
This is usually done by writing out a code for the object type followed by the data stored in its data members, one by one. Data members that are basic types (such as char, int, long, etc.) can be streamed out just by writing their bits to the output. Data members that are user defined types (such as other objects) are told to serialize themselves, and they repeat the process, serializing their own data members, until the whole object has been serialized to the output stream as a sequence of basic types.
Data members that are pointers or references to external objects must be handled differently so that only one copy of the external object is serialized. There are various ways of doing this, depending on the library in use. Some implementations give each object that is pointed to a unique ID, and output this ID for each pointer. When the objects are reconstituted, the pointers are replaced by the address of the reconstituted external object.
Reconstituting objects from the serialized stream is the reverse of serialization. The object type is read in, and an empty object of that type is constructed. Each data serialized member is then read in turn and assigned to the new object's corresponding data member.
Note that this system requires that full details of the serialization system and the object types are available for both serializing and reconstituting the objects. Also, a default constructor (taking no arguments) is usually required when objects are reconstituted.
Dave
|
|
|
|
|
Is there a way to programmatically determine the user's proxy server settings for Windows95/98/NT?
|
|
|
|
|
Just a flier on this one, but you can get IE's proxy setting from the registry.
|
|
|
|
|
i have a static code here:
==========================================
class A{
public:
static int a;
A();
~A();
};
A::A()
{ a++;}
A::~A()
{ a--;}
main()
{
A m;
}
============================================
complie passed
linker terminate and print:
"unsloved external reference A::a"
i don't know where is wrong.
thank you first.
|
|
|
|
|
This is a weird C++ rule (I didn't know it myself 'till a couple years ago, after 6 years of doing C++), but when you have a static member variable, you also have to instantiate it. So, you need to do this (add the line in red):
class A
{
public:
static int a;
A();
~A();
};
<font color=red>int A::a;</font>
|
|
|
|
|
It's not so weird really. Because a static variable belongs to the class itself rather than an instance, it must be defined separately from an instance.
Dave
|
|
|
|
|
The static members are shared by all instances of the class where it was defined . The scope of this kind of members is in the file where it was defined , and their duration is from the start of the program until the end of the program . So ,because the static members are allocated at the compilation time , you must initilize them at the file scope , even if are private . If you don't specify a value , 0 is implicit.
|
|
|
|
|
I'm creating an interface to program industrial machines and I need to be able to control various kind of documents.
One of those docs. must be viewed using an assistant, how could I do this if the CMultiDoctemplate parameters has to be filled with CMDIChildWnd (or derived) and CView (or derived too).
An example would be very useful.
Thank you in advance.
PD: I beg your pardon if I has written something impolite, but I'm very novice speaking english too.
|
|
|
|
|
After receiving a little bit of help I have solved the problem:
I have created three classes: one document derived, another view derived, and a ChildFrame derived of a CMDIChild, and in this last one I have written:
BOOL CChildFrmS7::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
m_PS->SetWizardMode();
m_PS->Create(this,WS_CHILD | WS_VISIBLE);
m_PS->SetActivePage(0);
CreateView(pContext);
return TRUE;
}
int his way I have got the property sheet in a MDI environment, but there is a little problem:
when the application erases the background, the body of the active page of the propertysheet disappears, I have overriden the OnEraseBackground message, but The window borders are not painted then.
How should I get the borders painted and the contents of the MDIChildwindow don't?
|
|
|
|
|
Is there a way to detect if any sound is currently playing in win98 using MSVC++6?
Thanks in advance!
|
|
|
|
|
Client and Server communicate using CSocket.For the communication, object serialization is used with the help of CArchive class in MFC.
But under high data transmission rates between server and client using serialization, client hangs after calling "Flush" method in CArchive class.
(For each object sending , we use Serialize() method of CObject class and Flush method of CArchive)
I increased the buffer size of CArchive class and tested .
I found that Client has sucessfully sent the object, but Client hasn't got any reply from the server although the server had sent it to client.
In this case client waits without any reply.
The Problem Occurs only when the server resides in a dual processor machine.
|
|
|
|
|
Hi,
I am trying to make a browse for folder dialog with 'Add folder' button ( like in winzip). I succeeded to insert the new folder to the tree view (using
TreeView_InsertItem) but if the parent item is not null (no the root), I receive
an exception from the shell when I try to select the new folder I have just added.
thanks,
Shai
|
|
|
|
|
Hi Shai,
I think that simply adding a tree item cannot work, because the shell uses the tree control only to show directories, while it holds the data in its own structures.
Try creating the directory first, but I think it will not work. When you choose the item just added, the Shell goes searching its own structures but probably it obtains a wrong pointer stored in the item data, so it generates an exception.
I think WinZip uses a custom dialog, not a subclassed BrowseForFolder dialog.
Cheers,
Paolo.
|
|
|
|
|
Subject: MFC Socket problem in Windows2000 environment
Client makes a connection to the Server using CSocket.
Server will be listening for incoming connections from the Client.
When a Client makes a connection to the Server the following takes place in the Server:
1) Calls CSocket::Detach() function to detach the socket handle.
2) Closes the socket handle.
3) Spawns a secondary process to handle the real communication between Server and the Client by passing the socket handle.
Secondary process attaches (using CSocket::Attach()) the socket handle to a new socket inorder to communicate with the Client.
The problem is:
When the Secondary process attaches the socket, a socket notification is sent to the Server.
Then the Server crashes because at that time the socket handle is null in the server as we have already closed it after detaching.
This is prevalent in Windows2000 Server machine which is also a dual processor. We are using MFC sockets for the communication. (VC 6 Environment)
This is running fine in Windows NT environment.
We would like to know why this is happening in Windows2000 Server environment and any solutions to it.
Thanks
Gane
|
|
|
|
|
I'm using MFC and the SDI architecture. I use a control bar with a spin control among others. I'd like to change the properties of the spin control (e.g range) according to the data in the loaded document. Maybe it will be obvious to some of you, but i just cant figure it out !
Thanx for help!
|
|
|
|
|
Assuming that ID_SPINSCTRL is the ID of you spin button, and m_ctrlBar is your control bar
CSpinControl* pCtrl = (CSpinControl*)m_ctrlBar.GetDlgItem(ID_SPINCTRL);
ASSERT(pCtrl);
pCtrl->SetRange(nLower,nUpper);
|
|
|
|
|
I have a class derived from CBitmap which contains a DIBSection, and I'm trying to write a copy function.
Can anyone tell me how, given an instance of my class, which is essentially a DIBSection, how I can create a deep copy of the DIBSection ? I've looked at CreateDIBSection, but I'm unsure where to get the parameters from.
Thanks
Christian
|
|
|
|
|
I would like to capture and print the currently displayed dialog box. Is it possible to do this without pressing the <alt><print screen=""> buttons on the keyboard. If possible, I would like to attach this function to a print button. Any ideas??
|
|
|
|
|
Send the dialog a WM_PRINT message, along with a DC, to print the window to that DC.
|
|
|
|