|
Is there a way to add some sort of a box for displaying text on the toolbar? I'm drawing a graphics program using openGL and I want to display the degrees of rotation on the toolbar as the object is rotated.
|
|
|
|
|
|
I have about 4 books on VC++.. and i've looked through all of the articles i can find here on CP.. and i still have problems understanding..
1) Is it possible to split the main window and put 2 different property pages (or views, dialogs, etc.) in each view when a button is pressed, and not just during OnCreateClient().. every single example i have seen splits the main window during OnCreateClient()..
2) Is it possible to create a CWnd derived class that displays full screen, and is split in two with 2 different dialogs in it (one in each half).
could someone please let me know what the best way to go about this is? im basicly trying to have a split screen with a dialog (or property sheet) on the left, and a form on the right which updates based on what is typed in the dialog on the left. Any help would be much appreciated.
-dz
|
|
|
|
|
(1) - yes, it's possible. Are you using static or dynamic splitter?
(2) - yes, it's possible. KB article Q164162 has information about going full-screen in MFC. Once you have full-screen option implemented, you can use splitter.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
1) I'm using neither as I can't figure out how to create the splitter outside of OnCreateClient(). OnCreateClient takes a pointer of CCreateContext* pContext, and I don't know how to create this type. I have tried creating my own CCreateContext and set all of its member variables to NULL, but this causes nothing but assertion errors.
I basicly have a function CSplitTestApp::OnFileTest() which gets called when you click a button on the toolbar, at that point i want either the main window to split, or a new window to popup split in half with a dialog in each view. The Create function of CSplitterWnd also takes a pointer to the parent window (CWnd*), which i dont' know how to do since it is being called from CSplitTestApp which is derived from CWinApp, not CWnd.
I have tried to create a class that has CSplitterWnd as its base class, but again I can't call the Create, or CreateStatic because I cant create the CCreateContext, and I cant get a pointer to the MainFrame from the CSplitTestApp.
Basicly I don't know how to even get started it seems, but i've been pushing this off for too long in this project and I have to be able to have a split view somehowwhen the user clicks a button from the file menu.
2) I found the article just now, im off to lunch, hopefully that will help some.
thanks for your responce, i hope im not too newbie for ya!
-dz
|
|
|
|
|
First of all, it can be done. I have done this - switching between 'normal' view and two splittered views. Unfortunately, I'm not allowed to post code snippets from this app - business, you know
Splitter creation will be identical. You'll be just doing this not in OnCreateClient but later.
Good starting point in learning how to switching view at runtime would be C++ QA column by Paul DiLascia published Feb'96 issue of MSJ. The article may be included in MSDN on your hard disk. If it's not there, go to msdn.microsoft.com
This article doesn't deal with splitters - however, it very clearly shows how to switch views. You should just go one step at the time and surely you'll be OK.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
I've got a window now which pops up and puts the forms in them, now the question is how do i send data between the two different views since the views were created by using RUNTIME_CLASS(CFormView)... any suggestions?
-dz
|
|
|
|
|
Override OnUpdate function in the views. Use command routing. After command routing is implemented, pass some unique parameter to the document UpdateAllViews function, which you will use in the OnUpdate function.
Hope this helps,
Deian
|
|
|
|
|
Hi!
I´m trying to create a simple ftp client but I´m having problems creating an instance of the CInternetSession class.
I´ve downloaded an example ftp client that works but I just can´t get my own to work.
Do I have to link the CInternetSession class in a certain way?
I´m using VC++ 6 SP5.
/Jii
|
|
|
|
|
Here is some code i wrote:
void CTransmitView::TransmitReports(CString ftpserver, CString user, CString pass)
{
CInternetSession mySession;
CFtpConnection* pFtpConn = mySession.GetFtpConnection(ftpserver, user, pass);
if (pFtpConn)
{
pFtpConn->SetCurrentDirectory("\\uploads\\");
pFtpConn->PutFile("test.txt", "test.txt");
pFtpConn->Close();
}
----
there is no exception handling in there.. you should add some for CInternetException and some other stuff prolly..
-dz
|
|
|
|
|
You are using a Direct Connection or a Proxy?
You are trying to connect using any Port?
Show any of your code...
Best Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I'm looking to create a modeless dialog in a dialog based mfc application.
This has to be done by the main dialog on a signal received from a working thread.
I've tried sending an user message and by directly calling a method of the main dialog class; the result was runtime error on release configuration, so i need a better way to communicate between the worker and the main dialog.
I'm waiting for a clue.
rechi
|
|
|
|
|
Could you post some code to see how you've implemented the thing? In principle, sending a message from a worker thread to a dialog to perform some UI operation is OK, so I guess there's hope your approach will work
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
There is nothing special in the code; in fact is really classical:
(in the thread)
((CDialog *)GetOutput())->SendMessage(WM_VIRTUAL_WANTCHAT);
(in the dialog message map)
ON_MESSAGE(WM_VIRTUAL_WANTCHAT, OnVirtualWantChat)
(the method)
void CClientxDlg::OnVirtualWantChat()
{
CChatDlg *dlg=new CChatDlg();
dlg->Create(IDD_DIALOG_CHAT, this);
if (dlg)
dlg->ShowWindow(SW_SHOW);
}
rechi
|
|
|
|
|
- What does
GetOutput exactly do?
- Is the
CClientxDlg blocked in any way as in your previous questions from yesterday?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
GetOutput returns the pointer to the main dialog window object (CClientxDlg *) and the window is - 100% sure - not blocked.
The facts are: i read a group chat request from a socket in the worker and i have to order the main dialog to create the chatting modeless dialog.
I also have to say that i'm not sure of the problem's origin so, if you find out that it's not this one, i should not be surprised.
rechi
|
|
|
|
|
I've created a test application with a worker that sends commands (WM_USER+1) once in 3 seconds for the main to create modelesses.
It works the first time and fails the second.
Despite this, it's perfect on debuggin' configuration.
So, this remains the problem!
rechi
|
|
|
|
|
Ummm... I think your user-message handler does not have the right signature. Try declaring (and defining) it like this:
afx_msg LRESULT OnVirtualWantChat(WPARAM wParam, LPARAM lParam); And don't forget to tell us back the result Good luck.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Now it runs perfectly!
Thanks a lot!
|
|
|
|
|
// In the following code :
m_app.CreateDispatch("Word.Application")
oDocs = m_app.GetDocuments();
oDoc = oDocs.Add(vOpt, vOpt, vOpt, vOpt);
(...)m_app.Activate();
oDoc.Activate();
// Can i obtain a reference or handle on a picture object in
// my MS Word, by using oDoc ?
Thanks.
|
|
|
|
|
how to implement remote shutdown in Windows NT ??
|
|
|
|
|
There's a utility to do this in the Windows NT resource kit.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
There's a program called shutdown.exe for doing this, available in the Windows NT resource kit.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Or you can use InitiateSystemShutdown/InitiateSystemShutdownEx.
|
|
|
|
|
Yes, this one works pretty nicely.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|